View Full Version : Point Lighting
03-14-2003, 09:30 PM
Does any one know how to implement a point light in volume rendering?
03-14-2003, 11:18 PM
I have managed to implement shading using directional light with the lookat as the camera position.
From my understanding, to make it a point light, i got to include attenuation like
1 - (distance from light to pixel / radius of area of light influence)^2
If so, how do I get the position for each pixel in the case of volume rendering?
Do I have to do lighting computation in the texture space and how?
03-16-2003, 10:17 PM
I haven't done much volume rendering, but I think it's something like this:
Precalculate object-space normals and store them into a 3d texture. In addition to this you need a cubemap that gives you the light's direction vector, after that it's just a matter of taking a dot product between the light dir and the normal.
The cubemap is almost similar to a normalization cubemap, it's supposed to return for each vector a normalized vector in the opposite direction. You use texgen to generate texture coordinates for this cubemap, and it returns the light->fragment vector for each fragment. The texgen is as simple as
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.