- Home /
Retrieving information from texture not working in shader graph
I'm trying to store information in a texture and retrieve it in a shader graph custom function, but it's not working no matter what I try. I'm trying to sample the exact center of the pixel (i, 0), of a texture that has TextureCount x TextureCount dimensions, but the numbers I'm getting are very off. Here is the line that causes the issue:
float StartHeight = SAMPLE_TEXTURE2D_ARRAY(StartHeights, samplerState, float2((0.5 + i) / TextureCount, 0.5 / TextureCount), 0).r;
Any help would be very appreciated, I've been trying to fix this issue for about 5 hours now and am at the point that I can't see anything other than a Unity bug as the issue.
How? Is this pre-processed texture or you're updating it after game starts?I'm trying to store information in a texture
Your answer
Follow this Question
Related Questions
Combining 2 black-white textures 2 Answers
How to use a shader to write to a mipmap (partial mipmap update) 2 Answers
Rendering Depth Texture 0 Answers
glTexSubImage3D in unity 0 Answers
GetPixel(x,y) within .shader? HLSL get color from texUV coordinates? 0 Answers