From 686eebd969a4771aa712732e3950ed7790ad3ac3 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 27 Nov 2021 02:06:53 +0100 Subject: [PATCH] examples: Fix float4->float2 cast --- data/examples/shaders/filter/displace.effect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/examples/shaders/filter/displace.effect b/data/examples/shaders/filter/displace.effect index f71aa7c7..cbdc02bd 100644 --- a/data/examples/shaders/filter/displace.effect +++ b/data/examples/shaders/filter/displace.effect @@ -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].