Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Black Dragon Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
NiranV
Black Dragon Viewer
Commits
e70473f7
Commit
e70473f7
authored
4 years ago
by
Dave Houlton
Browse files
Options
Downloads
Patches
Plain Diff
DRTVWR-525 housekeeping: delete unused shader file
parent
ed7bff58
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/app_settings/shaders/class3/deferred/lightUtil.glsl
+0
-117
0 additions, 117 deletions
...wview/app_settings/shaders/class3/deferred/lightUtil.glsl
with
0 additions
and
117 deletions
indra/newview/app_settings/shaders/class3/deferred/lightUtil.glsl
deleted
100644 → 0
+
0
−
117
View file @
ed7bff58
/**
* @file lightInfo.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$
*/
struct
DirectionalLightInfo
{
vec4
pos
;
float
depth
;
vec4
normal
;
vec3
normalizedLightDirection
;
vec3
normalizedToLight
;
float
lightIntensity
;
vec3
lightDiffuseColor
;
float
specExponent
;
float
shadow
;
};
struct
SpotLightInfo
{
vec4
pos
;
float
depth
;
vec4
normal
;
vec3
normalizedLightDirection
;
vec3
normalizedToLight
;
float
lightIntensity
;
float
attenuation
;
float
distanceToLight
;
vec3
lightDiffuseColor
;
float
innerHalfAngleCos
;
float
outerHalfAngleCos
;
float
spotExponent
;
float
specExponent
;
float
shadow
;
};
struct
PointLightInfo
{
vec4
pos
;
float
depth
;
vec4
normal
;
vec3
normalizedToLight
;
float
lightIntensity
;
float
attenuation
;
float
distanceToLight
;
vec3
lightDiffuseColor
;
float
lightRadius
;
float
specExponent
;
vec3
worldspaceLightDirection
;
float
shadow
;
};
float
attenuate
(
float
attenuationSelection
,
float
distanceToLight
)
{
// LLRENDER_REVIEW
// sh/could eventually consume attenuation func defined in texture
return
(
attenuationSelection
==
0
.
0
f
)
?
1
.
0
f
:
// none
(
attenuationSelection
<
1
.
0
f
)
?
(
1
.
0
f
/
distanceToLight
)
:
// linear atten
(
attenuationSelection
<
2
.
0
f
)
?
(
1
.
0
f
/
(
distanceToLight
*
distanceToLight
))
// quadratic atten
:
(
1
.
0
f
/
(
distanceToLight
*
distanceToLight
*
distanceToLight
));
// cubic atten
}
vec3
lightDirectional
(
struct
DirectionalLightInfo
dli
)
{
float
lightIntensity
=
dli
.
lightIntensity
;
lightIntensity
*=
dot
(
dli
.
normal
.
xyz
,
dli
.
normalizedLightDirection
);
//lightIntensity *= directionalShadowSample(vec4(dli.pos.xyz, 1.0f), dli.depth, dli.directionalShadowMap, dli.directionalShadowMatrix);
return
lightIntensity
*
dli
.
lightDiffuseColor
;
}
vec3
lightSpot
(
struct
SpotLightInfo
sli
)
{
float
penumbraRange
=
(
sli
.
outerHalfAngleCos
-
sli
.
innerHalfAngleCos
);
float
coneAngleCos
=
max
(
dot
(
sli
.
normalizedLightDirection
,
sli
.
normalizedToLight
),
0
.
0
);
float
coneAttenFactor
=
(
coneAngleCos
<=
sli
.
outerHalfAngleCos
)
?
1
.
0
f
:
pow
(
smoothstep
(
1
,
0
,
sli
.
outerHalfAngleCos
/
penumbraRange
),
sli
.
spotExponent
);
float
distanceAttenuation
=
attenuate
(
sli
.
attenuation
,
sli
.
distanceToLight
);
float
lightIntensity
=
sli
.
lightIntensity
;
lightIntensity
*=
distanceAttenuation
;
lightIntensity
*=
max
(
dot
(
sli
.
normal
.
xyz
,
sli
.
normalizedLightDirection
),
0
.
0
);
lightIntensity
*=
coneAttenFactor
;
lightIntensity
*=
sli
.
shadow
;
return
lightIntensity
*
sli
.
lightDiffuseColor
;
}
vec3
lightPoint
(
struct
PointLightInfo
pli
)
{
float
padRadius
=
pli
.
lightRadius
*
0
.
1
;
// distance for which to perform smoothed dropoff past light radius
float
distanceAttenuation
=
attenuate
(
pli
.
attenuation
,
pli
.
distanceToLight
);
float
lightIntensity
=
pli
.
lightIntensity
;
lightIntensity
*=
distanceAttenuation
;
lightIntensity
*=
clamp
((
padRadius
-
pli
.
distanceToLight
+
pli
.
lightRadius
)
/
padRadius
,
0
.
0
,
1
.
0
);
lightIntensity
*=
pli
.
shadow
;
lightIntensity
*=
max
(
dot
(
pli
.
normal
.
xyz
,
pli
.
normalizedToLight
),
0
.
0
);
return
lightIntensity
*
pli
.
lightDiffuseColor
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment