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?