Point Sprite Diffuse Lighting

Hi People,

I’m using point sprite for rendering some spheres in my application. To be more convicent, I need to light it which is done by using a normal. Does someone know how I can do it using point sprite? Is it possible to calculate a normal from each point?

Thanks a lot.

Jose Ricardo

Within fragment shader, read the texcoord, it give x and y of the normal. only z has to be calculated, quite simple for a sphere.
as :
1 = sqrt(xx + yy + zz)
1 = (x
x + yy + zz)

zz = 1 - xx - yy = magnitude
if (magnitude >0 and magnitude <=1) {
z= sqrt(1 - x
x - y*y);
} else kill fragment