Sign in to follow this  
stringa

GLSL error's - How to fix

Recommended Posts

stringa    100
Vertex Shader : shaders/car_shader.vert Output from shader : Vertex shader was successfully compiled to run on hardware. Fragment Shader : shaders/car_shader.frag Output from shader : Fragment shader failed to compile with the following errors : Compiler error: Sampler array indexes must be integral constant expressions Output from shader Fragment shader(s) were not successfully compiled before glLi nkProgram() was called. Link failed.

// --- car_shader.frag
// --- This is the main frag shader for car objects
// --- We will later add texture spatting and use it for terrain

// --- Preprocessor Defines

#define MAX_POINT_LIGHTS 7
#define NUM_SHADOW_SAMPLES 9


uniform sampler2DShadow Directional_Light;
uniform sampler2DShadow Point_Lights[ MAX_POINT_LIGHTS ];



[Edited by - stringa on August 18, 2008 2:50:32 PM]

Share this post


Link to post
Share on other sites
MARS_999    1627
Change this
uniform sampler2DShadow Point_Lights[ MAX_POINT_LIGHTS ];

to
uniform sampler2DShadow Point_Lights[7];

and download Rendermonkey to test/debug your code its fast and easy to use.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this