Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pbr parallax and terrain parallax intensity #423

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading