1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

ReflectionProbe priority

This commit is contained in:
landervr
2024-12-05 22:50:06 +01:00
parent 691d8bee2b
commit 1637736c20
7 changed files with 68 additions and 29 deletions

View File

@@ -1897,17 +1897,29 @@ void fragment_shader(in SceneData scene_data) {
continue; //not masked
}
if (reflection_accum.a >= 1.0 && ambient_accum.a >= 1.0) {
break;
}
reflection_process(reflection_index, vertex, ref_vec, normal, roughness, ambient_light, specular_light, ambient_accum, reflection_accum);
}
}
if (ambient_accum.a < 1.0) {
ambient_accum.rgb = mix(ambient_light, ambient_accum.rgb, ambient_accum.a);
}
if (reflection_accum.a < 1.0) {
reflection_accum.rgb = mix(specular_light, reflection_accum.rgb, reflection_accum.a);
}
if (reflection_accum.a > 0.0) {
specular_light = reflection_accum.rgb / reflection_accum.a;
specular_light = reflection_accum.rgb;
}
#if !defined(USE_LIGHTMAP)
if (ambient_accum.a > 0.0) {
ambient_light = ambient_accum.rgb / ambient_accum.a;
ambient_light = ambient_accum.rgb;
}
#endif
}