-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: Use parallax in landscape texture blending #338
Conversation
…ePagi/skyrim-community-shaders into terrain_parallax_blending_new
do total = rcp(total) instead of division since it's slow, and add [unroll] where applicable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
features/Extended Materials/Shaders/ExtendedMaterials/ExtendedMaterials.hlsli
Outdated
Show resolved
Hide resolved
height = TexColorSampler.SampleLevel(SampTerrainParallaxSampler, coords, mipLevels[0]).w * input.LandBlendWeights1.x; | ||
pixelOffset[0] = pow(input.LandBlendWeights1.x, 1 + 1 * blendFactor) * (pow(TexColorSampler.SampleLevel(SampTerrainParallaxSampler, coords, mipLevels[0]).w, blendFactor * HEIGHT_POWER)); | ||
else | ||
pixelOffset[0] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same above, instead of branching here initialize the whole pixelOffset
array to zero beforehand and save some else
s. Or use inout
on the argument since it is already initialised outside the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made it a bit nicer. Idk if there is a faster way to zero-initialize, but I can't leave old values there with inout, otherwise they will be used when weight is 0.
Just a small change in the blending weights of landscape textures, makes details pop out more and make it feel more like distinct materials than a linear blend. Performance impact should be minimal.