diff options
author | Jonathan Goodman <geenz@lindenlab.com> | 2022-11-14 18:12:22 +0000 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-11-14 18:12:22 +0000 |
commit | 97277e74a9d966ed441e51f844f9012f55cca3dc (patch) | |
tree | ed6a5c00a5065951ff9f77bf0277fb202dff0c0e /indra/newview/app_settings/shaders/class1/interface | |
parent | 843a5c287e34855fb7bd4882d8d0a106e987a9f7 (diff) |
Merged in SL-18332 (pull request #1194)
First pass of Screen Space Reflections
Approved-by: Dave Parks
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/interface')
9 files changed, 28 insertions, 29 deletions
diff --git a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl index cff8d9d50f..99662097bb 100644 --- a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl @@ -33,7 +33,7 @@ out vec4 frag_color; #define frag_color gl_FragColor #endif -uniform sampler2DRect depthMap; +uniform sampler2D depthMap; VARYING vec2 tc0; VARYING vec2 tc1; @@ -48,22 +48,22 @@ VARYING vec2 tc8; void main() { vec4 depth1 = - vec4(texture2DRect(depthMap, tc0).r, - texture2DRect(depthMap, tc1).r, - texture2DRect(depthMap, tc2).r, - texture2DRect(depthMap, tc3).r); + vec4(texture2D(depthMap, tc0).r, + texture2D(depthMap, tc1).r, + texture2D(depthMap, tc2).r, + texture2D(depthMap, tc3).r); vec4 depth2 = - vec4(texture2DRect(depthMap, tc4).r, - texture2DRect(depthMap, tc5).r, - texture2DRect(depthMap, tc6).r, - texture2DRect(depthMap, tc7).r); + vec4(texture2D(depthMap, tc4).r, + texture2D(depthMap, tc5).r, + texture2D(depthMap, tc6).r, + texture2D(depthMap, tc7).r); depth1 = min(depth1, depth2); float depth = min(depth1.x, depth1.y); depth = min(depth, depth1.z); depth = min(depth, depth1.w); - depth = min(depth, texture2DRect(depthMap, tc8).r); + depth = min(depth, texture2D(depthMap, tc8).r); gl_FragDepth = depth; } diff --git a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl index 71d80911d6..e104377037 100644 --- a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl @@ -45,7 +45,7 @@ void main() { gl_Position = vec4(position, 1.0); - vec2 tc = (position.xy*0.5+0.5)*screen_res; + vec2 tc = (position.xy*0.5+0.5); tc0 = tc+vec2(-delta.x,-delta.y); tc1 = tc+vec2(0,-delta.y); tc2 = tc+vec2(delta.x,-delta.y); diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index b5bbbb5c73..0b4680767a 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -34,7 +34,7 @@ out vec4 frag_color; #endif uniform sampler2D glowMap; -uniform sampler2DRect screenMap; +uniform sampler2D screenMap; VARYING vec2 vary_texcoord0; VARYING vec2 vary_texcoord1; @@ -42,5 +42,5 @@ VARYING vec2 vary_texcoord1; void main() { frag_color = texture2D(glowMap, vary_texcoord0.xy) + - texture2DRect(screenMap, vary_texcoord1.xy); + texture2D(screenMap, vary_texcoord1.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index a9e7ea1de8..6a4c2ca623 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -33,14 +33,14 @@ out vec4 frag_color; #define frag_color gl_FragColor #endif -uniform sampler2DRect diffuseRect; +uniform sampler2D diffuseRect; uniform vec2 screen_res; VARYING vec2 vary_tc; void main() { - vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb; + vec3 col = texture2D(diffuseRect, vary_tc).rgb; frag_color = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144))); } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl index 058f3b1b82..48aab1ce21 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl @@ -23,7 +23,6 @@ * $/LicenseInfo$ */ -uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; @@ -31,7 +30,7 @@ VARYING vec2 vary_tc; void main() { - vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); + vec4 pos = vec4(position.xyz, 1.0); gl_Position = pos; vary_tc = pos.xy*0.5+0.5; diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl index f7970b7f78..e08284f762 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl @@ -34,7 +34,7 @@ VARYING vec2 vary_texcoord1; void main() { - gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_Position = vec4(position.xyz, 1.0); vary_texcoord0 = texcoord0; vary_texcoord1 = texcoord1; } diff --git a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl index 839e10ce5e..858052281b 100644 --- a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl @@ -36,6 +36,7 @@ VARYING vec3 vary_dir; //uniform float roughness; uniform float mipLevel; +uniform int u_width; // ============================================================================================================= // Parts of this file are (c) 2018 Sascha Willems @@ -124,7 +125,7 @@ vec4 prefilterEnvMap(vec3 R) vec3 V = R; vec4 color = vec4(0.0); float totalWeight = 0.0; - float envMapDim = 128.0; + float envMapDim = u_width; int numSamples = 4; float numMips = 6.0; diff --git a/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl b/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl index f0d579f85e..a9c28b2974 100644 --- a/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl @@ -35,8 +35,8 @@ out vec4 frag_color; // NOTE screenMap should always be texture channel 0 and // depthmap should always be channel 1 -uniform sampler2DRect diffuseRect; -uniform sampler2DRect depthMap; +uniform sampler2D diffuseRect; +uniform sampler2D depthMap; uniform float resScale; uniform float znear; @@ -76,26 +76,25 @@ void main() for (int i = 0; i < 9; ++i) { - color += texture2DRect(screenMap, vary_texcoord0.xy+tc[i]).rgb * w[i]; - //color += texture2DRect(screenMap, vary_texcoord0.xy+tc[i]*2.0).rgb * w[i]*0.5; + color += texture2D(screenMap, vary_texcoord0.xy+tc[i]).rgb * w[i]; + //color += texture2D(screenMap, vary_texcoord0.xy+tc[i]*2.0).rgb * w[i]*0.5; } //color /= wsum; frag_color = vec4(color, 1.0); #else - vec2 depth_tc = vary_texcoord0.xy * resScale; - float depth = texture(depthMap, depth_tc).r; + float depth = texture(depthMap, vary_texcoord0.xy).r; float dist = linearDepth(depth, znear, zfar); // convert linear depth to distance vec3 v; - v.xy = depth_tc / 256.0 * 2.0 - 1.0; + v.xy = vary_texcoord0.xy / 512.0 * 2.0 - 1.0; v.z = 1.0; v = normalize(v); dist /= v.z; - vec3 col = texture2DRect(diffuseRect, vary_texcoord0.xy).rgb; + vec3 col = texture2D(diffuseRect, vary_texcoord0.xy).rgb; frag_color = vec4(col, dist/256.0); #endif } diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index 7614075cfd..bf6c1b355c 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -33,12 +33,12 @@ out vec4 frag_color; #define frag_color gl_FragColor #endif -uniform sampler2DRect screenMap; +uniform sampler2D screenMap; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; void main() { - frag_color = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color; + frag_color = texture2D(screenMap, vary_texcoord0.xy) * vertex_color; } |