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

Add new terrain shaders #4902

Merged
merged 42 commits into from
May 21, 2023
Merged

Add new terrain shaders #4902

merged 42 commits into from
May 21, 2023

Conversation

BlackYps
Copy link
Contributor

@BlackYps BlackYps commented May 6, 2023

Continued from #4900
I used the rock scaling idea to increase texture quality when being zoomed in. This way the texel density of the ground now somewhat matches the texel density on units and props, making it look much better.
I also fixed some important typos in the shader. Due to the different normal interpolation and mask ranges this isn't a drop in replacement for existing maps, but it looks promising for future maps.

I noticed that in #3585 there were some commits that added different albedo blending and a shadow map, these could be further improvements.

This adds two new terrain shaders. One that is basically behaving like the TTerrainXP one, but we use the channels of the upper albedo to provide a shadow map, our own terrain base normals, and a channel to tune the albedo like the "overlay" blend mode. This means 0.5 keeps the albedo as is, greater values lighten it and smaller values darken it.

The other one uses the same improvements, but on top of that uses advanced texture splatting based on heightmap textures and a PBR implementation based on roughness maps for the reflections.

Both also come with improved light absorption and scattering calculations for the water. To get good results these maps should use the PBR shader for units, because the mesh shader needs to do equal computations on the units for the effect to look believable.

@BlackYps BlackYps mentioned this pull request May 6, 2023
@BlackYps
Copy link
Contributor Author

BlackYps commented May 6, 2023

Some comparison pics. I had to cheat a bit and adjust the mask scaling for the screenshots so the texture layers are the same. But this is not relevant as we can adjust the map generator to the new shader.
Screenshot 2023-05-06 234318
Screenshot 2023-05-06 234338
Screenshot 2023-05-07 000034
Screenshot 2023-05-07 000054

@BlackYps BlackYps requested a review from Garanas May 15, 2023 18:30
@BlackYps BlackYps changed the title Terrain texture scaling Add new terrain shaders May 17, 2023
@BlackYps
Copy link
Contributor Author

Showcasing the reflections and different texture splatting of the PBR shader
Screenshot 2023-05-12 165609
Screenshot 2023-05-12 163715

@BlackYps
Copy link
Contributor Author

A comparison of the water improvements
Screenshot 2023-05-17 004351
Screenshot 2023-05-17 003754
By manipulating the color ramp of the water it is even possible to fake a glow effect
Screenshot 2023-05-17 124717

@BlackYps BlackYps added the area: graphics Anything Related to the Game Graphics label May 19, 2023
@Garanas Garanas merged commit b5b2d78 into deploy/fafdevelop May 21, 2023
2 checks passed
@Garanas Garanas deleted the terrain-texture-scaling branch May 21, 2023 19:12
@Garanas Garanas added this to the Development iteration II milestone Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Anything Related to the Game Graphics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants