summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-07-27 10:27:21 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-08-02 09:44:45 -0700
commit21ee88a088054d520b35e6c7e2c65b07a3899bc3 (patch)
tree23c61401e63c5526250ed2f6eaf09a9a4c5fba2d /indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
parent4c07a4a44553e29a5d54215119fcf056c62e45e8 (diff)
SL-17762: PBR: Add support for spot lights
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl46
1 files changed, 46 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
index e29e5d69a2..20309d9673 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
@@ -161,7 +161,53 @@ void main()
vec3 colorSpec = vec3(0);
vec3 colorEmissive = spec.rgb; // PBR sRGB Emissive. See: pbropaqueF.glsl
vec3 packedORM = texture2DRect(emissiveRect, tc).rgb; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl
+ float metal = packedORM.b;
+// if (proj_tc.x > 0.0 && proj_tc.x < 1.0
+// && proj_tc.y > 0.0 && proj_tc.y < 1.0)
+ if (nl > 0.0)
+ {
+ vec3 c_diff, reflect0, reflect90;
+ float alphaRough, specWeight;
+ initMaterial( diffuse, packedORM, alphaRough, c_diff, reflect0, reflect90, specWeight );
+
+ dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy );
+ slit = getProjectedLightSpecularColor( pos, n );
+
+// vec3 intensity = getLightIntensitySpot( color, size, lightDist, v );
+ colorDiffuse = shadow * dlit * nl * dist_atten;
+ colorSpec = shadow * slit * nl * dist_atten;
+
+// colorDiffuse *= BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh );
+// colorSpec *= BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh );
+
+ #if DEBUG_PBR_SPOT_DIFFUSE
+ colorDiffuse = dlit.rgb; colorSpec = vec3(0);
+ #endif
+ #if DEBUG_PBR_SPOT_SPECULAR
+ colorDiffuse = vec3(0); colorSpec = slit.rgb;
+ #endif
+ #if DEBUG_PBR_SPOT
+ colorDiffuse = dlit; colorSpec = vec3(0);
+ colorDiffuse *= nl;
+ colorDiffuse *= shadow;
+ #endif
+
+ #if DEBUG_SPOT_SPEC_POS
+ colorDiffuse = pos + ref * dot(pdelta, proj_n)/ds; colorSpec = vec3(0);
+ #endif
+ #if DEBUG_SPOT_REFLECTION
+ colorDiffuse = ref; colorSpec = vec3(0);
+ #endif
+
+ }
+
+ #if DEBUG_SPOT_DIFFUSE
+ colorDiffuse = vec3(nl * dist_atten);
+ #endif
+ #if DEBUG_SPOT_NL
+ colorDiffuse = vec3(nl); colorSpec = vec3(0);
+ #endif
#if DEBUG_PBR_LIGHT_TYPE
colorDiffuse = vec3(0.5); colorSpec = vec3(0);
#endif