Archived

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

Lighting

This topic is 5976 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

Ok, I am an artist, not a programmer, but I have been discussing some lighting methods with a mate of mine to simulate some principles of global illumination and raytracing. I know that they aren''t new ideas, as I feel that games such as GT3 use them already. But it thought i would share them with you, in the hope that they could be used to inject new life into the games in development. The first system is Fresnel Falloff on reflected objects.. In a raytracer, you can apply a fresnel fall off to reflections, to simulate the real world effect of objects getting more reflective the more ''edge-on'' they are to the view angle.. lift up a CD box for example, and look directly at the top. You can see directly through it, and although there are reflections, these are not vivid enough to sto you being able to see through the clear plastic. If you start to tilt the CD box away from you, so you are looking straight down across the lid of the box, you will notice that as the angle moves towards perpendicular its reflections increase untill it becomes like a mirror. This effect can be seen on all reflective objects, such as car bodies. In the real-world, this value is linked to the objects ''Index of Refraction'' but given that we are a few years off realtime effects such as those, lets simplify it a little. At it''s basic level, we have observed that relflective qualities of an object and its transparency alters depending on the angle it is viewed at. If we were to create n object, say a car, and to that object we apply an envmap. In reality, if you reflect a white light in a cars surface we get a white reflection.. if you reflect a black object in a cars surface, you get the color of the car (assuming that the area isbeing lit by diffuse) So what we can assume is that reflections (in this case) are additive.. Ok, so we can make our envmap additive, it still doesn''t look realistic. What we need to simulate is the effect of fresnel falloff. What I figure, is that if you were to go through all of the verticies in an object, and assign an alpha value to the envmap based on that angle (so where it faces the camera it would be fully transparent, and where it is perpendular to the camera''s direction it will be fully opaque). This would instantly give much more realistic reflections.. I am not saying that this is ideal.. for instance, you could use a curve to calculate the alpha value, so the mirror like relfectios could be limited to very extremities of the object. but obviously the more caculations you make the slower it will be. For the windows of the car, you could use the same calcuation to also set the transparancy of the actual window.. so if you were to make the color of the windows black, and apply an additive envmap to this. you would make the window fully transparent facing you, and fully opaque edge on.. doing this to the envmap at the same time, will give the effect we are looking for.. if you have implemented the curves, i''m sure tweaking these will give you the effect you are after. One thing that would be cool also is an upper and lower value on the alpha values.. for example, you may not want the envmap to fully fade out, nor may you want full mirror-like relflections around the edges. Why not implement min/max values, and give the artists a say in this one . I didn''t intend to type that much, but i hope it is clear. The effects described definatly work, i have knocked up tests in Max using very basic things such as a base color, one directional light, some ambient, and a spherical envmap. When the falloff is applied to the opacity of the envmap, it can start to look very realistic indeed. Another thing that we discussed (and you will be pleased to know, is easier to describe) is the effect of global illumination. In a radiosity renderer, to get realistic lighting, we ditch point lights and instead light objects with the luminosity of other objects. Many of the renderers on the market have the functionality of assigning a sky color, and your object will then be lit by a virtual hemisphere of light. Also we would ditch the ambient, as ambient light is really just light that has bounced around for a bit and lit your scene.. If you were able to rip the reflections off your shiney new car, and get to the base coat of color. You would notice that although you do get ''specular/phong'' lighting from directional lights (ie the sun) most of the light on the car is coming from the world, with the top being lit with the sky color, and the bottom being darker, but recieving some colors seeping in from the terrain it is on. What i propose is that you replace your ambient light with a virtual sphere. You would define a colour value as your top value which would be the color of your sky, and you would define a bottom value which would be a dark version of the upper colour, but tending towards the colour of your terain. Now what you would do is light the verts in your object based on the colous the normal is pointing to... (ie a normal straight up would be lit with your top colour, and a normal straight down would be lit with your bottome colour, and all angles in between being interpolated between those values.. You could get try working with a hemisphere where it is the same except all the nomals going straight sideways to straight downwards will pick up the bottom colour. Or if you wanna get advanced, you could define a top, middle and bottom color.. I hope this has got some people thinking. If anybody has any questions or comments, I can be emailed on daz_genetic@hotmail.com I''m not stating that the methods I am describing are the best.. But they are reletively inexpensive for the improvement you will get. and the best thing is that these principles can be applied to all graphics engines on all systems, not just PCs, and not just Direct X. I''ll let you guys know if I come accross anything else useful.. Darren Tilley Artist/Animator Rage Software

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Many thanks for posting that long explanation, it has certainly got me thinking on cheap illumination techniques. I''ve taken a break from my graphics engine for now, but I''ll consider adding the effects you discussed when I resume work on it.

Share this post


Link to post
Share on other sites
Hi Darren,

Would it be possible to post a shot or two of the results you got for Fresnel Falloff?... I would be very interested to see them (i love shiny things )

cheers,
Adam

Share this post


Link to post
Share on other sites
Darren:

Have a chat to John Heap - get him to show you the CD & notes from Meltdown... in particular Chas Boyds advanced lighting talk...


Hemispherical lighting per vertex - piss easy - about the same cost as a directional light in a vertex shader/VU

Per-vertex Fresnel term - I did a play with this, it works quite nicely. Take a look at the demo Digital Illusions did for the launch of G400, they did that exact thing with the transparencies and reflections on the water.

Per-pixel Fresnel is possible on pixel shader capable hardware too which looks quite cool - take a look at the demos on the nVidia developer site (www.nvidia.com/developer), in particular the shader browser.


--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites