Jump to content
  • Advertisement
Sign in to follow this  
Naruto-kun

Indexing texture arrays

This topic is 1814 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

Hi guys

 

I am having a little problem with a loop in my pixel shader

int i = start;
do
{
	i ++;

	if(lt[i] != 0)
	{
		color1 = shaderTextures[i].SampleLevel(SampleType, input.tex, 0)*lt[i];
		//
		//image processing
	}			
}while(i < 8);

When i try to compile i get the error X3512: sampler array index must be a literal expression

for the line where the texture is sampled. Does this mean that I cant use a loop counter variable in the array? How can i get around this so i can prevent textures from being sampled when not necessary without going into a brute force method using a whole string of if/else statements?

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!