Skip to content

Commit

Permalink
truncate vector explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps committed Jun 22, 2024
1 parent 7e8ba75 commit dd7a127
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions effects/terrain.fx
Original file line number Diff line number Diff line change
Expand Up @@ -2709,7 +2709,7 @@ float4 Terrain301NormalsPS ( VS_OUTPUT inV, uniform bool halfRange ) : COLOR
float4 position = TerrainScale * inV.mTexWT;
// 30° rotation
float2x2 rotationMatrix = float2x2(float2(0.866, -0.5), float2(0.5, 0.866));
position.zw = mul(position, rotationMatrix);
position.zw = mul(position.xy, rotationMatrix);

float4 mask0 = tex2D(UtilitySamplerA, position.xy);
float4 mask1 = tex2D(UtilitySamplerB, position.xy);
Expand Down Expand Up @@ -2754,7 +2754,7 @@ float4 Terrain301AlbedoPS ( VS_OUTPUT inV, uniform bool halfRange ) : COLOR
float4 position = TerrainScale * inV.mTexWT;
// 30° rotation
float2x2 rotationMatrix = float2x2(float2(0.866, -0.5), float2(0.5, 0.866));
position.zw = mul(position, rotationMatrix);
position.zw = mul(position.xy, rotationMatrix);

// do arithmetics to get range from (0, 1) to (-1, 1) as normal maps store their values as (0, 1)
float3 normal = normalize(2 * SampleScreen(NormalSampler,inV.mTexSS).xyz - 1);
Expand Down

0 comments on commit dd7a127

Please sign in to comment.