Hi everyone, I've tried osgspotlight example and it works fine. I've generated *only*seven texture coordinates by using osg::TexGen and rendered the spotlight effects by fragment shader. But, I want to render multiple spotlight effects in my scene (for example 20 spotlight effects). * void main(void) { vec4 sceneColor = texture2D(baseTexture,gl_TexCoord[0].xy); vec4 spotColor1 = texture2DProj(spotTexture1, gl_TexCoord[1]); vec4 spotColor2 = texture2DProj(spotTexture2, gl_TexCoord[2]); vec4 spotColor3 = texture2DProj(spotTexture3, gl_TexCoord[3]); vec4 spotColor4 = texture2DProj(spotTexture4, gl_TexCoord[4]); vec4 spotColor5 = texture2DProj(spotTexture5, gl_TexCoord[5]); vec4 spotColor6 = texture2DProj(spotTexture6, gl_TexCoord[6]); vec4 spotColor7 = texture2DProj(spotTexture7, gl_TexCoord[7]);
vec3 spotColor = spotColor1.rgb + spotColor2.rgb + spotColor3.rgb + spotColor4.rgb + spotColor5.rgb + spotColor6.rgb + spotColor7.rgb; vec4 color = sceneColor * gl_LightSource[0].ambient; float spotMapIntensity = 1 - gl_LightSource[0].diffuse.g / 3; gl_FragColor = vec4(sceneColor.rgb * spotColor.rgb, 1.0) * spotMapIntensity + color; }* Is there any suggestion about this subject? How about *deferred lighting*method? Thanks. Selman
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org