diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2024-03-06 17:56:16 -0800 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2024-03-06 17:56:16 -0800 |
commit | 1fc45a50ff15e6f31a4554da83256b7f59b1af15 (patch) | |
tree | b65f155530ebc130443582ca0fedda284833b02d /indra/newview/app_settings/shaders/class1 | |
parent | 47cd3cb0ad03c91f118fd20fea8d8924759fd2b7 (diff) |
#681 Add probe blending for mirrors.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl | 4 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl index c83a6be85d..57c0a6024f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl @@ -133,6 +133,7 @@ uniform vec4 minimum_alphas; // PBR alphaMode: MASK, See: mAlphaCutoff, setAlpha #if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 in vec4[2] vary_coords; #endif +in vec3 vary_position; in vec3 vary_normal; in vec3 vary_tangent; flat in float vary_sign; @@ -140,11 +141,14 @@ in vec4 vary_texcoord0; in vec4 vary_texcoord1; vec2 encode_normal(vec3 n); +void mirrorClip(vec3 position); float terrain_mix(TerrainMix tm, vec4 tms4); void main() { + // Make sure we clip the terrain if we're in a mirror. + mirrorClip(vary_position); #if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 TerrainCoord terrain_texcoord = vary_coords; diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl index dbb9404219..489fc26e3f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl @@ -25,6 +25,7 @@ uniform mat3 normal_matrix; uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; in vec3 position; @@ -42,6 +43,7 @@ out vec3 vary_tangent; flat out float vary_sign; out vec4 vary_texcoord0; out vec4 vary_texcoord1; +out vec3 vary_position; // *HACK: tangent_space_transform should use texture_normal_transform, or maybe // we shouldn't use tangent_space_transform at all. See the call to @@ -55,6 +57,7 @@ void main() { //transform vertex gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vary_position = (modelview_matrix*vec4(position.xyz, 1.0)).xyz; vec3 n = normal_matrix * normal; vary_vertex_normal = normal; |