custom Light Position uniform value...

edited May 2014 in GLSL / Shaders

Hello... Im currently trying to use my own light position vertices custom uniform values fed to the shaders from the sketch... My question is what transformations must be done to the position vector for the point light so it properly renders... The example utilized the usage of the pointlight() function and the shaders uses the uniform vec4 lightPosition( Which Im trying to avoid because I want to add more lights the limit )... Ive tried:

relevant sketch code:

float fCameraEyePositionX = 0.00; float fCameraEyePositionY = -500.00; float fCameraEyePositionZ = 2800.00; float fCameraDestinationX = 0.00; float fCameraDestinationY = 0.00; float fCameraDestinationZ = 0.00; float fCameraUpVectorX = 0.00; float fCameraUpVectorY = 1.00; float fCameraUpVectorZ = 0.00;

camera( fCameraEyePositionX, fCameraEyePositionY, fCameraEyePositionZ, fCameraDestinationX, fCameraDestinationY, fCameraDestinationZ, fCameraUpVectorX, fCameraUpVectorY, fCameraUpVectorZ );

m_shader.set( ("v4LightPosition"            ),
                      (0.00                               ),
                      (0.00                               ),
                      (0.00                               ),
                      (1.0                                 )  );

/////////////// vertex_shader_code:

vec3 ecVertex = vec3( modelview * vertex );

//backwards reflection// lightDir = normalize( ( transform * v4LightPosition ).xyz - ecVertex ); // no show// lightDir = normalize( ( modelview * v4LightPosition ).xyz - ecVertex ); // reflection relative to the camera position not the light position// lightDir = normalize( ( v4LightPosition ).xyz - ecVertex );

Tagged:
Sign In or Register to comment.