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:
parent
6a3be55fe2
commit
e49e2b4d65
9 changed files with 617 additions and 328 deletions
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue