Merge branch 'zesterer-master-patch-57550' into 'master'

Avoid div0 in shiny water shader

See merge request veloren/veloren!1669
This commit is contained in:
Joshua Barretto 2020-12-31 00:23:15 +00:00
commit 6cdac39075

View File

@ -136,7 +136,7 @@ void main() {
// Possibility of div by zero when slope = 0,
// however this only results in no water surface appearing
// and is not likely to occur (could not find any occurrences)
float slope = abs(wave00 - wave10) * abs(wave00 - wave01);
float slope = abs((wave00 - wave10) * (wave00 - wave01)) + 0.001;
vec3 nmap = vec3(
-(wave10 - wave00) / 0.1,