Jump to content
  • Advertisement
Sign in to follow this  
michaelmk86

Texture Arrays

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

it is possible to pass to the shader a Texture Array and at the same time 2 or more Textures that are not in an arrey?

I have try like that but it doesn't work

deviceContext->PSSetShaderResources(0, 1, &ShadowMapTexture);//contains 1 Texture
deviceContext->PSSetShaderResources(1, 1, &ReflectionTexture);//contains 1 Texture
deviceContext->PSSetShaderResources(2, 4, modelTexturesArray);//contains 4 Textures



//HLSL
Texture2D Textures[6] : register(t0);

Textures[0].Sample(.....// it is the ShadowMapTexture
Textures[1].Sample(.....// it is the ReflectionTexture
Textures[2].Sample(.....// it is the modelTexturesArray 0
Textures[3].Sample(.....// it is the modelTexturesArray 1
Textures[4].Sample(.....// it is the modelTexturesArray 2
Textures[5].Sample(.....// it is the modelTexturesArray 3
...

the weird thing is that if i do the following it works but not with the hadowMapTexture and ReflectionTexture at the same time

deviceContext->PSSetShaderResources(0, 1, &ShadowMapTexture);//contains 1 Texture
deviceContext->PSSetShaderResources(1, 4, modelTexturesArray);//contains 4 Textures



//HLSL
Texture2D Textures[5] : register(t0);

Textures[0].Sample(.....// it is the ShadowMapTexture
Textures[1].Sample(.....// it is the modelTexturesArray 0
Textures[2].Sample(.....// it is the modelTexturesArray 1
Textures[3].Sample(.....// it is the modelTexturesArray 2
Textures[4].Sample(.....// it is the modelTexturesArray 3
...
Edited by michaelmk86

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!