|
#1
|
|||
|
|||
Vizard Headlight in Shader
Dear Vizard Support,
I am trying to use your headlamp in some shader code for lighting an procedurally generated terrain. I am using on-the-fly objects to create the terrain. My shader is attempting to access the headlamp through gl_LightSource[0]. However, I am unsure as to what type of light the headlamp is. Is it a directional, positional or spot light? When I attempt to access the position information from gl_LightSource[0].position I get a value that does not appear to match my actual lamp direction. vec3 normal = normalize(gl_NormalMatrix * gl_Normal); vec3 lightPos = normalize(vec3(gl_LightSource[0].position)); dotted = max( dot(normal, lightPos), 0.0 ); I am really looking for a better understanding of the headlight in Vizard and how it would be properly integrated into a shader. |
#2
|
|||
|
|||
The default headlight is a directional light. If you are accessing the light in a fragment shader, then the direction vector will be stored in gl_LightSource[0].position.xyz.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Realistic Light and Shadows Using Vizard and 3DS Max | jde | Vizard | 4 | 07-13-2012 11:58 AM |
Vizard 4 Beta Testing | farshizzo | Announcements | 0 | 02-01-2011 11:46 AM |
Vizard 4 Beta Testing | farshizzo | Vizard | 0 | 02-01-2011 11:46 AM |
Multiple Textures for Diffuse and Specularity Shader Issue | shivanangel | Vizard | 1 | 05-11-2009 11:44 AM |
Vizard tech tip: Using the Python Imaging Library (PIL) | Jeff | Vizard | 0 | 03-23-2009 12:13 PM |