Results 1 to 2 of 2

Thread: Are texture lookups in init shaders impossible?

  1. #1
    Join Date
    Dec 2009
    Posts
    2

    Default Are texture lookups in init shaders impossible?

    Hey everyone!

    I'm having some difficulties sampling a color texture inside an init shader.
    Some heavy pre-processing is needed on the texture, but whenever I try to sample it at a certain coordinate (using mi_lookup_color_texture or mi_call_shader_x) it will always return the color at the [0,0,0] coordinate. It reads the texture alright but it just won't listen to any coordinate supplied.

    I've also tried changing the state->tex and state->tex_list[] variables before calling any function, but since it's in an init shader i'm guessing that's kind of pointless.



    It might have something to do with there being no intersection, because the same problem occurs in volume shaders when the eye ray never hits any geometry. This can be solved however by enclosing the scene in a large box. Dirty but effective. It won't work on init shaders though.

    Does anyone know what I need to do to get this to work?

  2. #2
    Join Date
    Nov 2008
    Location
    Mantova
    Posts
    352

    Default

    not sure what are you trying to do. however you might use low level APIs to acces your image. mi_img_xxx

    ciao, max

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •