completed fog example (#18)

* complete fog example
as both fog and basic lighting need the light system it made sense
to seperate it out, there are a few functions from raymath
int rlmath.py

* added shaders custom uniform

* added shaders_texture_waves.py

* added shaders_texture_drawing.py

* bug fix - unwanted transparent effect!

Co-authored-by: codifies <nospam@antispam.com>
This commit is contained in:
chriscamacho 2020-09-19 09:07:39 +01:00 committed by GitHub
parent 6a3be55fe2
commit e49e2b4d65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 617 additions and 328 deletions

View file

@ -78,6 +78,7 @@ void main()
// gamma
finalColor = pow(finalColor, vec4(1.0/2.2));
float dist = length(viewPos - fragPosition) ;
float fogFactor = 1.0 / exp( (dist * FogDensity) * (dist * FogDensity));
@ -88,4 +89,5 @@ void main()
fogFactor = clamp( fogFactor, 0.0, 1.0 );
finalColor = mix(fogColor, finalColor, fogFactor);
}