mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Avoid div0 in shiny water shader
This commit is contained in:
parent
d2a7aa34b1
commit
a404707f87
@ -136,7 +136,7 @@ void main() {
|
|||||||
// Possibility of div by zero when slope = 0,
|
// Possibility of div by zero when slope = 0,
|
||||||
// however this only results in no water surface appearing
|
// however this only results in no water surface appearing
|
||||||
// and is not likely to occur (could not find any occurrences)
|
// 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(
|
vec3 nmap = vec3(
|
||||||
-(wave10 - wave00) / 0.1,
|
-(wave10 - wave00) / 0.1,
|
||||||
|
Loading…
Reference in New Issue
Block a user