I want to offload some 3D calculations to the GPU without raising my requirements to DX10. Specifically, I am generating densities in 64x64x64 3D blocks, which fit nicely into 512x512 2D textures. I would like to be able to convert my float2
texture coordinates to float3
values, so I can offset them, convert back to float2
, perform lookups against my randomness texture, and interpolate the results manually.
This has been easy to do with integer values on the CPU side, but the GPU's texture coordinates are all floating points. Is there an easy way to do this? Or is there a way to coax pixel shader 3.0 into using something similar to 3D textures, so I can take advantage of automatic interpolation?
Another caveat is that I am using the Vector4
image format for my render targets (need better resolution in each channel) in XNA, so I am restricted to Point sampling.
frac()
. \$\endgroup\$