Is there a limit on the number of active uniform variables within a shader? Because it seems to me that I cannot have more than 8 active uniform variables in my fragment shader.
I found nothing about that in the spec.
thanks
Is there a limit on the number of active uniform variables within a shader? Because it seems to me that I cannot have more than 8 active uniform variables in my fragment shader.
I found nothing about that in the spec.
thanks
In a vertex shader, you should be able to have upwards of 128 4-vector uniforms available, if not more. In a fragment shader, you can have as few as 12 or so. Note that built-in uniforms count against this limit. But only if you actually declare them.
And this is a querriable implementation-defined number.
thanks
how do I query that number…
since this
GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
tells me I have 512 uniform components within my fragment program.
And the spec. says
const int gl_MaxFragmentUniformComponents = 64;// ARB_fragment_shader
However I use two builtin 4x4 matrices - thus 32 uniforms + 4 vec4 = 16 + a sampler2D
in total this is 48 + sampler2D
Because it seems to me that I cannot have more than 8 active uniform variables
as korval saiz u need to include the built in ones eg texturecoords, also perhaps u dont realise its components
thus vec4 counts as 4 not as 1
I did realize that a vec4 consists of 4 components and I thought that only active uniforms count thus if I don’t use gl_TexCoord[i] it will not count or am I wrong here?
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.