Repository navigation
Add the Terrain400 shader family with simultaneous height blending - #7344
Draft
TimMasalme wants to merge 2 commits into
Draft
TimMasalme wants to merge 2 commits into
TimMasalme wants to merge 2 commits into
Conversation
Terrain400, 401 and 402 blend all strata at once by height, as Unity's terrain shaders do, instead of laying them over each other in order. The stratum masks are weights, the lower layer takes what they leave, and SpecularColor.r sets the height transition. Each stratum carries its height in the alpha of its albedo and normal map; the atlas in the upper slot supplies the roughness. Terrain400T, 401T and 402T sample Stratum2 and Stratum3 triplanar, using the two strongest of the three projections chosen from the map-wide normal in Stratum7.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the proposed changes
Adds a new terrain shader family, Terrain400, next to Terrain200. No existing technique changes, so no existing map changes.
The 2XX shaders lay the strata over each other in order, and
splatLerp()compares each layer's height only with its own opacity. Terrain400 blends all layers at once by height instead, after Unity'sHeightBasedSplatModify:ps_2_a decided the texture convention: holding eight albedos plus the atlas gradients does not fit in 22 temp registers, and ps_3_0 would lose the fixed-function terrain fog. So:
tex2Dbias(..., -16)) to avoid seams at tile bordersTechniques:
Terrain400,Terrain401,Terrain402(last digit = macrotexture mode, as in Terrain20x) andTerrain400T,Terrain401T,Terrain402T, where Stratum2 and Stratum3 are sampled triplanar from the two strongest of the three projections (biplanar mapping as described by Inigo Quilez), chosen from the map-wide normal in Stratum7.Testing done on the proposed changes
terrain.fxcompiles with d3dx9_31, the compiler the game uses.Not tested yet: other GPUs than mine, and maps made from scratch for this convention by other mappers.
Additional context
Draft, following a short chat with @BlackYps. Open questions:
generate-pbror Ozone could write it.Checklist
Approval
[ ] The feature is greenlighted through