George,

thank you for your solution, that is exactly what I am looking for! At a first 
glance the comparison between left and right looks pretty good. It may also be 
a good starting point to learn about lighting because your code doesn't look to 
complicated.

best,

Achim Breidenbach
Boinx Software Ltd.


On 10.05.2013, at 07:32, George Toledo wrote:

> <Lighting with GLSL Shader (gt).qtz>
> 
> 
> It's a late hour over here and it's possible I made some small mistake… but I 
> think it should be OK and do the job. 
> 
> This is a Blinn-Phong lighting in GLSL, which is the standard OpenGL pipeline 
> lighting. I'm only receiving one light (what the lighting environment is set 
> to right now), so to receive more light values and create the correct 
> lighting, the code will need to be modified. 
> 
> The principals can obviously be used to create fancier effects.
> 
> -George Toledo
> 
> On May 10, 2013, at 12:55 AM, Achim Breidenbach <[email protected]> wrote:
> 
>> Hi George,
>> 
>> thanks for the infos. Do you have a sample code? How could this be applied 
>> to my sample composition?
>> 
>> I don't have any experience with lighting calculations in shaders yet. I 
>> don't want to dive deep into materials and such, but simply want to have the 
>> left cube look the same way as the right cube.
>> 
>> Achim Breidenbach
>> Boinx Software Ltd.
>> 
>> 
>> On 10.05.2013, at 06:47, George Toledo wrote:
>> 
>>> 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