Skip to content

Commit

Permalink
fix: pbr parallax and terrain parallax intensity (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlum authored Aug 16, 2024
1 parent 605b68b commit 578172f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ float GetMipLevel(float2 coords, Texture2D<float4> tex)
float2 textureDims;
tex.GetDimensions(textureDims.x, textureDims.y);

#if !defined(PARALLAX) && !defined(TRUE_PBR)
textureDims /= 2.0;
#endif

float2 texCoordsPerSize = coords * textureDims;

float2 dxSize = ddx(texCoordsPerSize);
Expand All @@ -42,7 +46,7 @@ float GetMipLevel(float2 coords, Texture2D<float4> tex)
// Compute the current mip level (* 0.5 is effectively computing a square root before )
float mipLevel = max(0.5 * log2(minTexCoordDelta), 0);

#if !defined(PARALLAX)
#if !defined(PARALLAX) && !defined(TRUE_PBR)
mipLevel++;
#endif

Expand Down

0 comments on commit 578172f

Please sign in to comment.