Replies: 1 comment
-
In HLSL try to define the variable for the texture as "Texture2DArray" instead of just "Texture2D" - I regulary use TextureArrays with this method and it works well. I do tho use the .Sample(sampler, vec3) method instead of tex2D but I guess it's going to work with tex2D as well. I assume you properly prepared your Texture on CPU-Side with the appropriate .SetData version which take the slice? One of the params is the slice index the other is the mimaplevel, so dont mix them up. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use a Texture2D array and cannot get it to work.
I am using exactly the same HLSL syntax as I would for a single slice Texture2D except I am passing a float3 to tex2d() HLSL intrinsic with the z component being the slice id.
It only seems to sample pixels from the 0 slice.
Beta Was this translation helpful? Give feedback.
All reactions