mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Added light affect parameter to baked AO
This commit is contained in:
parent
3c857033df
commit
81c9cfdc1b
5 changed files with 34 additions and 0 deletions
|
|
@ -1536,6 +1536,7 @@ void main() {
|
|||
|
||||
#if defined(ENABLE_AO)
|
||||
float ao=1.0;
|
||||
float ao_light_affect=0.0;
|
||||
#endif
|
||||
|
||||
float alpha = 1.0;
|
||||
|
|
@ -1920,9 +1921,13 @@ FRAGMENT_SHADER_CODE
|
|||
|
||||
#if defined(ENABLE_AO)
|
||||
ambient_light*=ao;
|
||||
ao_light_affect = mix(1.0,ao,ao_light_affect);
|
||||
specular_light*=ao_light_affect;
|
||||
diffuse_light*=ao_light_affect;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//energu conservation
|
||||
diffuse_light=mix(diffuse_light,vec3(0.0),metallic);
|
||||
ambient_light=mix(ambient_light,vec3(0.0),metallic);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue