From 93a025966649e281ceff8d1471bc983cc036bc17 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 29 Apr 2022 13:51:11 +0000 Subject: SL-17282 prototype mixing of reflection map into legacy materials --- indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 18616a9bb3..c1061f1933 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -36,7 +36,6 @@ out vec4 frag_color; uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; -uniform samplerCube environmentMap; uniform sampler2D noiseMap; uniform sampler2D lightFunc; uniform sampler2DRect depthMap; -- cgit v1.2.3 From 6115941c81b6f4aa49c33a82826bcfe2994c1a67 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 15 Jul 2022 16:54:45 -0700 Subject: DRTVWR-559: Cleanup class1 pointLightF --- indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index c1061f1933..5bb034d5c1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -1,5 +1,5 @@ /** - * @file pointLightF.glsl + * @file class1\deferred\pointLightF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code -- cgit v1.2.3 From 97277e74a9d966ed441e51f844f9012f55cca3dc Mon Sep 17 00:00:00 2001 From: Jonathan Goodman Date: Mon, 14 Nov 2022 18:12:22 +0000 Subject: Merged in SL-18332 (pull request #1194) First pass of Screen Space Reflections Approved-by: Dave Parks --- .../app_settings/shaders/class1/deferred/pointLightF.glsl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 5bb034d5c1..40a4f86c37 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -33,12 +33,12 @@ out vec4 frag_color; #define frag_color gl_FragColor #endif -uniform sampler2DRect diffuseRect; -uniform sampler2DRect specularRect; -uniform sampler2DRect normalMap; +uniform sampler2D diffuseRect; +uniform sampler2D specularRect; +uniform sampler2D normalMap; uniform sampler2D noiseMap; uniform sampler2D lightFunc; -uniform sampler2DRect depthMap; +uniform sampler2D depthMap; uniform vec3 env_mat[3]; uniform float sun_wash; @@ -57,6 +57,7 @@ uniform vec4 viewport; vec3 getNorm(vec2 pos_screen); vec4 getPosition(vec2 pos_screen); +float getDepth(vec2 pos); vec3 srgb_to_linear(vec3 c); void main() @@ -64,7 +65,6 @@ void main() vec4 frag = vary_fragcoord; frag.xyz /= frag.w; frag.xyz = frag.xyz*0.5+0.5; - frag.xy *= screen_res; vec3 pos = getPosition(frag.xy).xyz; vec3 lv = trans_center.xyz-pos; @@ -88,7 +88,7 @@ void main() float noise = texture2D(noiseMap, frag.xy/128.0).b; - vec3 col = texture2DRect(diffuseRect, frag.xy).rgb; + vec3 col = texture2D(diffuseRect, frag.xy).rgb; float fa = falloff+1.0; float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); @@ -99,7 +99,7 @@ void main() col = color.rgb*lit*col; - vec4 spec = texture2DRect(specularRect, frag.xy); + vec4 spec = texture2D(specularRect, frag.xy); if (spec.a > 0.0) { lit = min(da*6.0, 1.0) * dist_atten; @@ -125,6 +125,7 @@ void main() { discard; } + final_color.rgb = vec3(getDepth(frag.xy)); frag_color.rgb = col; frag_color.a = 0.0; -- cgit v1.2.3 From 34d3f94db6d2ab243f8ee63522e60cb1e22dedff Mon Sep 17 00:00:00 2001 From: Geenz Linden Date: Sun, 20 Nov 2022 11:09:05 +0100 Subject: Fix for SSAO not behaving properly. SL-18662 --- indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 40a4f86c37..f07ef92b26 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -86,7 +86,7 @@ void main() lv = normalize(lv); da = dot(norm, lv); - float noise = texture2D(noiseMap, frag.xy/128.0).b; + float noise = texture2D(noiseMap, frag.xy).b; vec3 col = texture2D(diffuseRect, frag.xy).rgb; -- cgit v1.2.3 From 623bb4d58c197fccc8a795426c5864104301cebe Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 24 Jan 2023 14:17:36 -0600 Subject: SL-18772 Potential fix for failed shader load on Intel HD 3000 --- .../shaders/class1/deferred/pointLightF.glsl | 104 +-------------------- 1 file changed, 2 insertions(+), 102 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index f07ef92b26..a025c4a1b4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -22,111 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - -#extension GL_ARB_texture_rectangle : enable -/*[EXTRA_CODE_HERE]*/ - -#ifdef DEFINE_GL_FRAGCOLOR +// debug stub out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform sampler2D diffuseRect; -uniform sampler2D specularRect; -uniform sampler2D normalMap; -uniform sampler2D noiseMap; -uniform sampler2D lightFunc; -uniform sampler2D depthMap; - -uniform vec3 env_mat[3]; -uniform float sun_wash; - -uniform vec3 color; -uniform float falloff; -uniform float size; - -VARYING vec4 vary_fragcoord; -VARYING vec3 trans_center; - -uniform vec2 screen_res; - -uniform mat4 inv_proj; -uniform vec4 viewport; - -vec3 getNorm(vec2 pos_screen); -vec4 getPosition(vec2 pos_screen); -float getDepth(vec2 pos); -vec3 srgb_to_linear(vec3 c); void main() { - vec4 frag = vary_fragcoord; - frag.xyz /= frag.w; - frag.xyz = frag.xyz*0.5+0.5; - - vec3 pos = getPosition(frag.xy).xyz; - vec3 lv = trans_center.xyz-pos; - float dist = length(lv); - dist /= size; - if (dist > 1.0) - { - discard; - } - - vec3 norm = getNorm(frag.xy); - - float da = dot(norm, lv); - if (da < 0.0) - { - discard; - } - - lv = normalize(lv); - da = dot(norm, lv); - - float noise = texture2D(noiseMap, frag.xy).b; - - vec3 col = texture2D(diffuseRect, frag.xy).rgb; - - float fa = falloff+1.0; - float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); - dist_atten *= dist_atten; - dist_atten *= 2.0; - - float lit = da * dist_atten * noise; - - col = color.rgb*lit*col; - - vec4 spec = texture2D(specularRect, frag.xy); - if (spec.a > 0.0) - { - lit = min(da*6.0, 1.0) * dist_atten; - - vec3 npos = -normalize(pos); - vec3 h = normalize(lv+npos); - float nh = dot(norm, h); - float nv = dot(norm, npos); - float vh = dot(npos, h); - float sa = nh; - float fres = pow(1 - dot(h, npos), 5) * 0.4+0.5; - float gtdenom = 2 * nh; - float gt = max(0,(min(gtdenom * nv / vh, gtdenom * da / vh))); - - if (nh > 0.0) - { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da); - col += lit*scol*color.rgb*spec.rgb; - } - } - - if (dot(col, col) <= 0.0) - { - discard; - } - final_color.rgb = vec3(getDepth(frag.xy)); - - frag_color.rgb = col; - frag_color.a = 0.0; + frag_color = vec4(0.0, 0.5, 0.5, 0.0); } -- cgit v1.2.3 From 1c2410b8af62254e96d60b2ae2e411d4756215e4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 3 Feb 2023 19:45:31 -0600 Subject: SL-19148 Decruft followthrough -- decruft shader tree and some remaining forward rendering code. --- .../shaders/class1/deferred/pointLightF.glsl | 32 ---------------------- 1 file changed, 32 deletions(-) delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl (limited to 'indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl deleted file mode 100644 index a025c4a1b4..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file class1\deferred\pointLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// debug stub -out vec4 frag_color; - -void main() -{ - frag_color = vec4(0.0, 0.5, 0.5, 0.0); -} -- cgit v1.2.3