You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
fix reflection probe box projection stretching
This commit is contained in:
@@ -1916,7 +1916,8 @@ void fragment_shader(in SceneData scene_data) {
|
|||||||
vec3 bent_normal = normal;
|
vec3 bent_normal = normal;
|
||||||
#endif
|
#endif
|
||||||
vec3 ref_vec = normalize(reflect(-view, bent_normal));
|
vec3 ref_vec = normalize(reflect(-view, bent_normal));
|
||||||
ref_vec = mix(ref_vec, bent_normal, roughness * roughness);
|
// Interpolate between mirror and rough reflection by using linear_roughness * linear_roughness.
|
||||||
|
ref_vec = mix(ref_vec, bent_normal, roughness * roughness * roughness * roughness);
|
||||||
|
|
||||||
for (uint i = item_from; i < item_to; i++) {
|
for (uint i = item_from; i < item_to; i++) {
|
||||||
uint mask = cluster_buffer.data[cluster_reflection_offset + i];
|
uint mask = cluster_buffer.data[cluster_reflection_offset + i];
|
||||||
|
|||||||
@@ -1401,7 +1401,8 @@ void main() {
|
|||||||
vec3 bent_normal = normal;
|
vec3 bent_normal = normal;
|
||||||
#endif
|
#endif
|
||||||
vec3 ref_vec = normalize(reflect(-view, bent_normal));
|
vec3 ref_vec = normalize(reflect(-view, bent_normal));
|
||||||
ref_vec = mix(ref_vec, bent_normal, roughness * roughness);
|
// Interpolate between mirror and rough reflection by using linear_roughness * linear_roughness.
|
||||||
|
ref_vec = mix(ref_vec, bent_normal, roughness * roughness * roughness * roughness);
|
||||||
|
|
||||||
uvec2 reflection_indices = instances.data[draw_call.instance_index].reflection_probes;
|
uvec2 reflection_indices = instances.data[draw_call.instance_index].reflection_probes;
|
||||||
for (uint i = 0; i < sc_reflection_probes(); i++) {
|
for (uint i = 0; i < sc_reflection_probes(); i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user