Schnulla
08-03-2010, 08:37 AM
Hi,
in my fragment shader I have some uniform arrays like
this for my directional and positional light sources:
#define MAX_LIGHT_SOURCES 8
uniform vec4 LSAmbientGlobal;
uniform vec4 LSAmbient[MAX_LIGHT_SOURCES];
uniform vec4 LSDiffuse[MAX_LIGHT_SOURCES];
uniform vec4 LSSpecular[MAX_LIGHT_SOURCES];
uniform vec4 LSPosition[MAX_LIGHT_SOURCES];
uniform vec3 LSNearFarAttenuation[MAX_LIGHT_SOURCES];
uniform int LSCount;
uniform vec4 MatAmbient;
uniform vec4 MatDiffuse;
uniform vec4 MatSpecular;
uniform float MatShininess;
There should be at least 64 uniform floats available
and according to this statistics (http://www.kludx.com/capability.php?capability=404) there are at least
two ATI Mobility cards with only 64 uniform floats.
Now my question:
The code above would exceed this limit of 64 floats.
I do not really care about these cards but a general
question raised up for me. If I want a lot of lights
(maybe even more than 8), how to bypass this limitation?
Anyone knows a good tutorial with some sample code
that targets this limitation?
Help is really appreciated! :)
in my fragment shader I have some uniform arrays like
this for my directional and positional light sources:
#define MAX_LIGHT_SOURCES 8
uniform vec4 LSAmbientGlobal;
uniform vec4 LSAmbient[MAX_LIGHT_SOURCES];
uniform vec4 LSDiffuse[MAX_LIGHT_SOURCES];
uniform vec4 LSSpecular[MAX_LIGHT_SOURCES];
uniform vec4 LSPosition[MAX_LIGHT_SOURCES];
uniform vec3 LSNearFarAttenuation[MAX_LIGHT_SOURCES];
uniform int LSCount;
uniform vec4 MatAmbient;
uniform vec4 MatDiffuse;
uniform vec4 MatSpecular;
uniform float MatShininess;
There should be at least 64 uniform floats available
and according to this statistics (http://www.kludx.com/capability.php?capability=404) there are at least
two ATI Mobility cards with only 64 uniform floats.
Now my question:
The code above would exceed this limit of 64 floats.
I do not really care about these cards but a general
question raised up for me. If I want a lot of lights
(maybe even more than 8), how to bypass this limitation?
Anyone knows a good tutorial with some sample code
that targets this limitation?
Help is really appreciated! :)