Skip to content

Commit

Permalink
chore: more terrain blending fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlum committed Jul 4, 2024
1 parent d257da0 commit 81a4224
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions package/Shaders/Lighting.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2046,6 +2046,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace
psout.Depth = lerp(depthSampled, input.Position.z, blendFactorTerrain > screenNoise);
# endif

psout.Depth = lerp(max(depthSampled, input.Position.z), input.Position.z, blendFactorTerrain > screenNoise);
# endif

psout.MotionVectors.zw = float2(0.0, psout.Diffuse.w);
Expand Down
3 changes: 2 additions & 1 deletion src/Features/TerrainBlending.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ struct TerrainBlending : Feature
singleton->renderTerrainDepth = inTerrain;
}

func(a_pass, a_technique, a_alphaTest, a_renderFlags); // Run terrain twice
if (inTerrain)
func(a_pass, a_technique, a_alphaTest, a_renderFlags); // Run terrain twice
} else if (singleton->renderWorld) {
// Entering or exiting terrain section
bool inTerrain = a_pass->shaderProperty && a_pass->shaderProperty->flags.all(RE::BSShaderProperty::EShaderPropertyFlag::kMultiTextureLandscape);
Expand Down

0 comments on commit 81a4224

Please sign in to comment.