So im programming a raytracer at the moment and Im passing a 3d texture from the cpu to the gpu but the gpus texture has not the same values

The uniform part (its made in Unity):

RayTracingShader.SetTexture(0, "_VoxelPosTexture", tex);

The shader part:

Texture3D<float4> _VoxelPosTexture;

float4 color = _VoxelPosTexture.SampleLevel(sampler_VoxelPosTexture, int3(mapPos), 0);
  • \$\begingroup\$ Can you update this question to include a Minimal Complete Verifiable Example? We'll need to see a big enough code snippet to put into a new, empty project and reproduce the problem you're seeing, without needing to guess at how your variables are defined or when your SetTexture method is being called. \$\endgroup\$
    – DMGregory
    Aug 30, 2020 at 16:16

1 Answer 1


Figured it out. I had to use texture.load


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .