Hi,
Using cos and sin you can compute the normal for the particle lighting :
n.x = -cos( pi * uv.x );
n.y = -cos( pi * uv.y );
n.z = sin( pi * length( uv ) );
n = normalize( n );
Is it a good way or a better way exists ?
Thanks
Hi,
Using cos and sin you can compute the normal for the particle lighting :
n.x = -cos( pi * uv.x );
n.y = -cos( pi * uv.y );
n.z = sin( pi * length( uv ) );
n = normalize( n );
Is it a good way or a better way exists ?
Thanks
You could replace a sin and a normalize with a sqrt:
n.z = sqrtf(max(0.0f, 1.0f - n.x*n.x - n.y*n.y))
I'm sure there's many other solutions. A texture lookup would probably be faster on mobile (but probably slower on desktop GPUs).