The reason you don't get a lighting effect is because applying a lighting 
environment is equivalent to using GL_LIGHTING related methods.

Attaching a shader to a mesh makes the shader program produce the material. At 
that point, any OpenGL lighting methods no longer influence the material, but 
they are still valid. What one does is to reference GL_LIGHT0 through 8, and 
GL_DIFFUSE, etc, to receive the values into your shader as variables. 

That way you can have many meshes with different shaders, creating various 
different material effects while sending info "globally" from OpenGL lighting. 
You wouldn't want the stock OpenGL lighting to simply be applied on top of a 
shader anyway since it's per vertex. Using glsl in conjunction with the 
lighting environment you can get best of both worlds.

On May 10, 2013, at 12:29 AM, Achim Breidenbach <[email protected]> wrote:

> Hi list,
> 
> in the attached composition I have two cubes rendered within a Lighting 
> patch. The right one is rendered natively and the left one is rendered within 
> a GLSL Shader patch. The lighting isn't applied to the GLSL one. 
> 
> What do I have to do to apply the lighting of a Lighting patch to something 
> rendered within a GLSL Shader patch?
> 
> Thanks!
> 
> Achim Breidenbach
> Boinx Software Ltd.
> 
> <Lighting with GLSL Shader.qtz>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/quartzcomposer-dev/gtoledo3%40gmail.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to