UPDATE: Fixed
Hello
To summarise the issue I’ve found a thread detailing how the SampleHeight method works in the backend:
The code works within a burst job I’ve implemented. I had the idea of packing this into a custom ShaderGraph node (HLSL file). To translate this code over to HLSL I did the following:
So this produces the following result:
The fully white planes are the ones in a burstable Job (same as Unity’s Terrain System) and the coloured ones are the GPU Shader versions done with sampling the heightmap.
To my knowledge tex2D already does Bilinear interpolation of the tex-coordinate to the nearest pixel in the backend, and I double checked this with OpenAI ChatGPT. The actual geometry of the terrain does indeed also look interpolated.
I can’t for the love of god figure out why they don’t match if both are sampled via Bi-Linear Interpolation?