Works like garbage

This commit is contained in:
Dynamitos
2024-10-22 15:00:39 +02:00
parent 72e60cfe30
commit c7c7e4dd3e
7 changed files with 25 additions and 7 deletions
+4
View File
@@ -32,7 +32,11 @@ VertexOutput vert(VertexInput input)
// Which vertex should be read?
local_vert_id = local_vert_id == 0 ? 2 : (local_vert_id == 2 ? 0 : 1);
float3 positionRWS = pParams.currentVertexBuffer[output.triangleID * 3 + local_vert_id].xyz;
//positionRWS.y = pParams.displacementMap.SampleLevel(pParams.displacementSampler, positionRWS.xz, 0).r;
float2 texCoord = positionRWS.xz / 1000;
positionRWS.y = pParams.displacementMap.SampleLevel(pParams.displacementSampler, texCoord, 0).r * 100;
// Apply the view projection
output.positionCS = mul(pViewParams.projectionMatrix, mul(pViewParams.viewMatrix, float4(positionRWS, 1.0)));
return output;
+5 -1
View File
@@ -86,6 +86,10 @@ struct ComputeParams
// 22
StructuredBuffer<float> lebMatrixCache;
// 23
globallycoherent RWStructuredBuffer<DebugStruct> debugBuffer;
RWStructuredBuffer<DebugStruct> debugBuffer;
// 24
SamplerState displacementSampler;
// 25
Texture2D<float4> displacementMap;
};
ParameterBlock<ComputeParams> pParams;