Sign in to follow this  
sduatepe

Texture Array in shader program

Recommended Posts

Is there any way send to texture array to shader program?
varying vec2 v_texCoord;
const TEXTURE_NUMBER 10
uniform sampler2D textures[TEXTURE_NUMBER]

void main()
{
   int i=0;
   vec4 colorValue[TEXTURE_NUMBER];

   for(i=0;i<TEXTURE_NUMBER;i++)
   {
       colorValue[i]=texture2D(textures[i],v_texCoord);
   }
}

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