You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Merge pull request #100241 from lander-vr/reflection-probe-priority
Add priority-based blending to reflection probes.
This commit is contained in:
@@ -1928,17 +1928,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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user