TokisanGames / Terrain3D

A high performance, editable terrain system for Godot 4.
MIT License
2.02k stars 115 forks source link

Change roughness modifier to make puddles #303

Open TokisanGames opened 7 months ago

TokisanGames commented 7 months ago

Description

Painting wetness introduces a roughness modifier that can increase or decrease roughness (-0.5, 0.5). Consider, instead of allowing rougher values, move the range to (-1, 0). (-0.5, 0) still increases wetness as is current. But below -0.5 have it flatten the normal to make puddles.

https://www.youtube.com/watch?v=DxOjiV-vNqM

Interpolate normals: https://stackoverflow.com/questions/38070899/how-to-interpolate-normals-for-phong-shading-in-opengl https://en.wikipedia.org/wiki/Slerp https://hub.jmonkeyengine.org/t/normals-interpolation-in-shader/31598/14

This could automatically darken the surrounding, and raise the vertex level as well as decreasing roughness and flattening normals. https://x.com/MattTkocz/status/1814369448826155331?t=MUnXuR2zXJSDqSPNIy2kSA&s=19

FishOfTheNorthStar commented 4 months ago

I started a discussion about this concept recently, not the exact same implementation but pretty similar. Here's a link: https://github.com/TokisanGames/Terrain3D/discussions/375

There's an animated rain drop texture there I made that might come in handy.