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

Color map fix region edges #618

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Xtarsia
Copy link
Contributor

@Xtarsia Xtarsia commented Feb 7, 2025

Before:
image

After:
image

Also dropping mipmaps for the color maps, as texelfetch wont access them.

Also, this was the last use of uv2 - it is no longer used. making get_region_uv2 redundant as well...

@TokisanGames
Copy link
Owner

Thank you for fixing these artifacts!

Please also update lowpoly_colormap.gdshader.

Colormap mipmaps are still needed. Try inserting a satellite image on the colormap. It's noisy, especially when moving. If this doesn't apply to the regular, then the colormap debug shader should be adjusted to not use mipmaps.

{46997426-1A38-4229-B8E9-3CD0817641E2}

If uv2 and get_region_uv2 are truly not needed, they can be stripped out.

@Xtarsia Xtarsia force-pushed the color-map-fix-region-edges branch from f817fbd to 7a2f00a Compare February 10, 2025 19:19
@Xtarsia
Copy link
Contributor Author

Xtarsia commented Feb 10, 2025

uv2 gets to live another day! Though i had to remove that 0.5 offset to get things pixel perfect.

new method calculates a region_mip value directly from the derivatives, removing the need for textureQueryLod(), and the bilerp skip is now based off that value instead (log2 of fractional parts is negative, so checking less than 0. for that now.)

added bonus, the color map now blends at regions edges with flat/world noise, side effect of the new method it seems:
image

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.

2 participants