light & transparent

Started by
2 comments, last by mathfeel 22 years, 3 months ago
in the blending lesson, we got this "glass box"...I find that when I go inside the box...with the light on...I can''t see nothing...of course, if the box were wooden, light can''t go in there...reasonable...but since we intend the side to be translucent...shouldn''t we allow some light to pass through? how would we do that? (like sun light passing through the tainted window of a great cathedral)
Advertisement
perhaps if you knew you were in the box, why not move the light into the box? i dought this will give the proper effect though. just a thought.
http://www.lectersoft.com
you obviuosly dont understand how lighting works in opengl. simply put, lights are calculated on a per vertex basis using the normals. this you probally already knew. since lighting is done in this manner, textures/vertex alpha colors are ignored. whether a polygon is in front of a light or not will make no difference in how things behind it are lit. there is NO tracing of light rays at all. opengl does not care if you have invisible polygons or the light inside an enclosed box. in fact directional lights dont have a location at all. omni lights (point lights) do have a position and distance, but are not affected by polygons whether they ae solid or not.

for lighting effects you must develop tricks to handle things like translucnt textures. this is why most games today use lightmaps since you can calculate the non dynamic lighting (and dynamic lighting if you use animated textures) using high quality ray tracing. then at run time you only bother with dynamic lights from guns, flashlights, etc. you can do shadowing and light projection using the stencil buffer in realime, but this requires more advanced techniques then you are currently capable of. my advice is to continue working through the tutorials and try to UNDERSTAND what you are reading, coping, and modifing.
A simple fix could be to render both sides of the walls in the box. (It would be dark in there if the walls are not drawn). You could dim the light a bit when inside the cube.

Will this work? - Another beginner

This topic is closed to new replies.

Advertisement