Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Sampling a whole texture in HLSL

$
0
0

I have been looking at the SampleLevel function in https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-to-samplelevel

I would like to do a texture sampling of a whole texture in a Compute Shader, without doing a lookup.

Texture3D density: register(t1);

StructuredBuffer<float4> result: register(t2);

float4 lookup=density.SampleLevel(wwcSamplerState, textcoords ,0);

I would like to copy all texels to the result structured buffer.

How do I do this? 

Thanks!

 

 


Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>