Skip to content

fix: fix for terrain variation with upscaling feature breaking mips#1364

Merged
doodlum merged 1 commit into
community-shaders:devfrom
davo0411:tv-upscaling-fix
Sep 9, 2025
Merged

fix: fix for terrain variation with upscaling feature breaking mips#1364
doodlum merged 1 commit into
community-shaders:devfrom
davo0411:tv-upscaling-fix

Conversation

@davo0411
Copy link
Copy Markdown
Collaborator

@davo0411 davo0411 commented Aug 4, 2025

adds mipbias to tv to make it not over-add miplevels with the upscaling shenanigans.
simple fix that ensures miplevel matches tv disabled.

Summary by CodeRabbit

  • Improvements
    • Enhanced terrain variation visuals by refining texture sampling with an adjusted mip level for more consistent detail.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 4, 2025

Using provided base ref: e39f8cc
Using base ref: e39f8cc
Base commit date: 2025-08-03T17:49:27-07:00 (Sunday, August 03, 2025 05:49 PM)

Actionable Suggestions

  • Light Limit Fix: Action required; Needs version bump to 2-4-0
  • Screen-Space Shadows: Action required; Needs version bump to 1-3-0
  • Subsurface Scattering: Action required; Needs version bump to 2-1-0
  • Upscaling: New ini added (v1-0-0)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 4, 2025

✅ A pre-release build is available for this PR:
Download

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 4, 2025

Walkthrough

A global mip bias has been incorporated into the mip level calculation within the StochasticEffect function in the shader file. The adjusted mip level is now used for all texture samples, ensuring consistent sampling. No changes were made to public API declarations or function signatures.

Changes

Cohort / File(s) Change Summary
Shader Mip Level Adjustment
features/Terrain Variation/Shaders/TerrainVariation/TerrainVariation.hlsli
Added a global mip bias to the mip level calculation in StochasticEffect; used adjusted mip for all texture samples.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A gentle tweak in shader land,
Where mipmaps blend by rabbit hand.
A bias added, textures clear,
With smoother hills both far and near.
Hop along, the pixels say,
For mip level math now leads the way!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e39f8cc and c5e35cc.

📒 Files selected for processing (1)
  • features/Terrain Variation/Shaders/TerrainVariation/TerrainVariation.hlsli (1 hunks)
🔇 Additional comments (2)
features/Terrain Variation/Shaders/TerrainVariation/TerrainVariation.hlsli (2)

145-145: LGTM! Clean mip bias adjustment implementation.

The addition of SharedData::MipBias to the calculated mip level directly addresses the upscaling-related mip level over-addition issue described in the PR objectives. The variable naming is clear and the implementation is straightforward.


148-150: Unable to locate TerrainVariation.hlsli – please verify consistent mip level usage

I tried to find TerrainVariation.hlsli in the repo but couldn’t locate it. Please confirm the file path (and extension) and manually ensure that every tex.Sample* call in this shader uses adjustedMipLevel for uniform mip‐level sampling to avoid visual artifacts.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@alandtse
Copy link
Copy Markdown
Collaborator

alandtse commented Aug 4, 2025

If this targets the upscaler, it should target the upscaler branch. There's no guarantee it will be merged. If you're saying this is required anyway regardless, please confirm.

@davo0411
Copy link
Copy Markdown
Collaborator Author

davo0411 commented Aug 6, 2025

Oh sorry alandtse, no this is just for upscaling. Will move to draft and can sit here till upscaling is merged/abandoned and i will remove it atp.
not needed for now, only for non-full res as it breaks mips

@davo0411 davo0411 marked this pull request as draft August 6, 2025 11:06
@davo0411 davo0411 marked this pull request as ready for review September 9, 2025 04:47
@doodlum doodlum merged commit 01da25a into community-shaders:dev Sep 9, 2025
24 checks passed
@davo0411 davo0411 deleted the tv-upscaling-fix branch December 31, 2025 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants