examples: Fix float4->float2 cast

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2021-11-27 02:06:53 +01:00
parent 2962be9d52
commit 686eebd969

View file

@ -54,7 +54,7 @@ uniform float DisplacementRange<
float4 DisplacementPixelShader_v1(VertexInformation vtx) : TARGET {
// Calculate proper offset.
// 1. Sample the DisplacementMap texture.
float2 offset = DisplacementMap.Sample(LinearClampSampler, vtx.texcoord0.xy);
float2 offset = DisplacementMap.Sample(LinearClampSampler, vtx.texcoord0.xy).rg;
// 2. Convert from [+0.0, +1.0] to [-0.5, +0.5].
offset -= .5f;
// 3. Fix the aliasing that happens with 8bpc normal maps, which also gives us the range [-1.0, +1.0].