• Advertisement
Sign in to follow this  

error C6013: Only arrays of texcoords may be indexed in this profile, and only wit

This topic is 3326 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Getting an error in my GLSL frag shader....
(49) : error C6013: Only arrays of texcoords may be indexed in this profile, and only with a loop index variable
which corresponds to this shader code:

varying vec4 indices;

uniform float data[5];

main()
{
(snip)
	// get material emissivity
	int nIndex = int(indices.r);
	float dataPt = data[nIndex];
(/snip)
}
I am wondering the problem is that nIndex is not constant at compile time. Can I not calculate the index for the uniform array lookup at run time? Do I need to convert this to a 1D texture? Thanks, CB

Share this post


Link to post
Share on other sites
Advertisement
Some GPUs don't support indexing in the FS. Yes, use a texture instead.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement