• Advertisement

Archived

This topic is now archived and is closed to further replies.

problem modeling realistic translucent objects

This topic is 5768 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I''m currently trying to model realistic translucent objects in OpenGL. Especially when light is shining through the textured translucent object, the texture should be projected on the other geometry in the scene. I searched the web for any information about this topic but my result were not that satisfactory. Most information relating to this topic I found describes projecting a texture on geometry but without the possibility attaching this texture to a real object in the scene. My goal is to show the textured translucent object as well as the projection itself. Therefore it is important that the projection is perspective correct. It should be possible to draw lines from the the light source going through the edges of the translucent into infinity. Each time one of this lines penetrates the geometry there should be the according edge of the projected texture. The only valuable information I found is the website of T. Kano. He describes this kind of thing assuming the light source located perpendicularly above the center of the translucent object. He uses GL_EYE_LINEAR projection with a special Q plane (see http://cgi3.tky.3web.ne.jp/~tkano/stained.shtml). But I need a more general solution. The translucent object as well as the light source should be located arbitrarily and idependently. For simplicity I''m assuming the translucent object being co-planar and rectangular. Has anyone information how I can do this texture projection in OpenGL? Code snippets or an example source code would be fine. Many thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
hmm. interesting.

although I can''t say this is exactly what you want, it may interest you:

what you could do it use the projected texture to actually draw the light image completly.. this would have a few interesting advantages...


ok,

the first thing you''d have to do would be to render a texture from the perspective of the light (very easy).. but... heres a trick...

render the scene full white, with black fog, where the fog is EXP, not linear... ie, the fog will represent the fall off of the light.

them, you can render your translucent object using modulation beldning (glBlendFunc(GL_DST_COLOR,GL_ZERO) - I think ) setting the colour of the object (ie, glColor).. where white would be higherst transparency, and black would be solid.

then, project the light texture to the scene around the transparent object using modulate multitexturing.

Share this post


Link to post
Share on other sites
That''s exactly the way I thought to solve this problem. Multi texturing even enables me to let the light go through several translucent objects AND to have the scene itself textured. But I didn''t think of using fog for light fall off. Many thanks for this idea.
Actually I have problems settings up the correct texgen an texture matrix to get the right projection. You say it''s easy, but I just can''t get it working... (any help would be fine)

Share this post


Link to post
Share on other sites
I don''t get the effect.

Do you want to colorize objects behind a coloured glass ?
or
Do you want to colorize objects when the light is reflected in the coloured glass ?

For the first case, imagine a car with rainbow glasses. The effect would colorize the interior of the car with rainbow colors (if the light comes from the exterior).

For the second case, imagine a mirror tainted with rainbow colors, and put a spotlight for this mirror. The effect would colorize objects that lie in the ''reflection field'' of the mirror.

Share this post


Link to post
Share on other sites

  • Advertisement