diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl | 18 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl | 6 |
2 files changed, 21 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl index d4e82cebf3..513b748f5f 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl @@ -88,6 +88,24 @@ void main() 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 + vec3 c_diff, reflect0, reflect90; + float alphaRough, specWeight; + initMaterial( diffuse, packedORM, alphaRough, c_diff, reflect0, reflect90, specWeight ); + + for (int light_idx = 0; light_idx < LIGHT_COUNT; ++light_idx) + { + vec3 lightColor = light_col[ light_idx ].rgb; + float lightSize = light [ light_idx ].w; + vec3 lv =(light [ light_idx ].xyz - pos); + calcHalfVectors(lv, n, v, h, l, nh, nl, nv, vh, lightDist); + + if (nl > 0.0 || nv > 0.0) + { + vec3 intensity = getLightIntensityPoint(lightColor, lightSize, lightDist); + colorDiffuse += intensity * nl * BRDFLambertian (reflect0, reflect90, c_diff , specWeight, vh); + colorSpec += intensity * nl * BRDFSpecularGGX(reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh); + } + } final_color = colorDiffuse + colorSpec; } else diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl index ddfbafd739..8886abb7d1 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl @@ -99,9 +99,9 @@ void main() if (nl > 0.0 || nv > 0.0) { - vec3 intensity = size * color; - colorDiffuse += intensity * nl * BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh ); - colorSpec += intensity * nl * BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh ); + vec3 intensity = getLightIntensityPoint(color, size, lightDist); + colorDiffuse += intensity * nl * BRDFLambertian (reflect0, reflect90, c_diff , specWeight, vh); + colorSpec += intensity * nl * BRDFSpecularGGX(reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh); } final_color = colorDiffuse + colorSpec; |