Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Go Back   mental images Forum > mental ray > mental ray - Shaders > mr Shaders - Advanced

Reply
 
Thread Tools Display Modes
  #1  
Old May 18th, 2010, 22:49
Wessel Wessel is offline
mi Dev Forum User
 
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?
Reply With Quote
  #2  
Old June 17th, 2010, 18:51
maxt maxt is offline
mi Dev Forum User
 
Join Date: Nov 2008
Posts: 54
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
Reply With Quote
Reply

Tags
init, shader, texture coordinates

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +1. The time now is 06:21.