Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
JennaHuntsman
XDG Integration
Commits
2c964e82
Commit
2c964e82
authored
4 years ago
by
Michael Pohoreski
Browse files
Options
Downloads
Plain Diff
Merged in SL-13465 (pull request #239)
Approved-by: Dave Houlton
parents
8189c900
f156730f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
+14
-2
14 additions, 2 deletions
...a/newview/app_settings/shaders/class1/deferred/moonF.glsl
indra/newview/app_settings/shaders/class1/windlight/moonF.glsl
+11
-2
11 additions, 2 deletions
.../newview/app_settings/shaders/class1/windlight/moonF.glsl
with
25 additions
and
4 deletions
indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
+
14
−
2
View file @
2c964e82
...
...
@@ -45,6 +45,12 @@ uniform float blend_factor; // interp factor between moon A/B
VARYING
vec2
vary_texcoord0
;
vec3
srgb_to_linear
(
vec3
c
);
vec3
getAdditiveColor
();
/// Soft clips the light with a gamma correction
vec3
scaleSoftClip
(
vec3
light
);
void
main
()
{
vec4
moonA
=
texture2D
(
diffuseMap
,
vary_texcoord0
.
xy
);
...
...
@@ -58,13 +64,19 @@ void main()
vec3
luma_weights
=
vec3
(
0
.
3
,
0
.
5
,
0
.
3
);
vec4
light_color
=
max
(
sunlight_color
,
moonlight_color
);
float
mix
=
1
.
0
-
dot
(
normalize
(
light_color
.
rgb
),
luma_weights
);
float
blend
=
1
.
0
-
dot
(
normalize
(
light_color
.
rgb
),
luma_weights
);
vec3
exp
=
vec3
(
1
.
0
-
mix
*
moon_brightness
)
*
2
.
0
-
1
.
0
;
vec3
exp
=
vec3
(
1
.
0
-
blend
*
moon_brightness
)
*
2
.
0
-
1
.
0
;
c
.
rgb
=
pow
(
c
.
rgb
,
exp
);
//c.rgb *= moonlight_color.rgb;
// Partial atmospherics calculation
vec3
ac
=
getAdditiveColor
();
c
.
rgb
+=
ac
;
c
.
rgb
=
scaleSoftClip
(
c
.
rgb
);
frag_data
[
0
]
=
vec4
(
c
.
rgb
,
c
.
a
);
frag_data
[
1
]
=
vec4
(
0
.
0
);
frag_data
[
2
]
=
vec4
(
0
.
0
f
);
...
...
This diff is collapsed.
Click to expand it.
indra/newview/app_settings/shaders/class1/windlight/moonF.glsl
+
11
−
2
View file @
2c964e82
...
...
@@ -44,6 +44,9 @@ uniform sampler2D altDiffuseMap;
uniform
float
blend_factor
;
// interp factor between moon A/B
VARYING
vec2
vary_texcoord0
;
vec3
getAdditiveColor
();
vec3
scaleSoftClip
(
vec3
light
);
void
main
()
{
vec4
moonA
=
texture2D
(
diffuseMap
,
vary_texcoord0
.
xy
);
...
...
@@ -53,12 +56,18 @@ void main()
// mix factor which blends when sunlight is brighter
// and shows true moon color at night
vec3
luma_weights
=
vec3
(
0
.
3
,
0
.
5
,
0
.
3
);
float
mix
=
1
.
0
f
-
dot
(
normalize
(
sunlight_color
.
rgb
),
luma_weights
);
float
blend
=
1
.
0
f
-
dot
(
normalize
(
sunlight_color
.
rgb
),
luma_weights
);
vec3
exp
=
vec3
(
1
.
0
-
mix
*
moon_brightness
)
*
2
.
0
-
1
.
0
;
vec3
exp
=
vec3
(
1
.
0
-
blend
*
moon_brightness
)
*
2
.
0
-
1
.
0
;
c
.
rgb
=
pow
(
c
.
rgb
,
exp
);
//c.rgb *= moonlight_color.rgb;
// Partial atmospherics calculation
vec3
ac
=
getAdditiveColor
();
c
.
rgb
+=
ac
;
c
.
rgb
=
scaleSoftClip
(
c
.
rgb
);
frag_color
=
vec4
(
c
.
rgb
,
c
.
a
);
}
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