Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alchemy
Alchemy Next
Commits
c3e5e3b5
Commit
c3e5e3b5
authored
Sep 14, 2021
by
Rye Mutt
🍞
Browse files
HDR lighting
parent
3b3d797a
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
indra/newview/app_settings/settings_alchemy.xml
View file @
c3e5e3b5
...
...
@@ -769,13 +769,13 @@
<key>
RenderToneMapType
</key>
<map>
<key>
Comment
</key>
<string>
Tonemapping type 0 -
None
, 1 - Linear, 2 - Reinhard, 3 - Reinhard2, 4 - Filmic, 5 - Unreal, 6 - ACES, 7 - Uchimura, 8 - Lottes, 9 - Uncharted
</string>
<string>
Tonemapping type 0 -
HDR Debug
, 1 - Linear, 2 - Reinhard, 3 - Reinhard2, 4 - Filmic, 5 - Unreal, 6 - ACES, 7 - Uchimura, 8 - Lottes, 9 - Uncharted
</string>
<key>
Persist
</key>
<integer>
1
</integer>
<key>
Type
</key>
<string>
U32
</string>
<key>
Value
</key>
<integer>
0
</integer>
<integer>
7
</integer>
</map>
<key>
RenderToneMapUchimuraA
</key>
<map>
...
...
@@ -803,7 +803,7 @@
<key>
Value
</key>
<array>
<real>
0.4
</real>
<real>
1.
3
3
</real>
<real>
1.
1
3
</real>
<real>
0.0
</real>
</array>
</map>
...
...
indra/newview/app_settings/shaders/class1/alchemy/toneMapF.glsl
View file @
c3e5e3b5
...
...
@@ -46,7 +46,7 @@ vec3 linear_to_srgb(vec3 cl);
vec3
reinhard
(
vec3
x
)
{
return
x
/
(
1
+
x
);
return
x
/
(
1
+
x
);
}
vec3
reinhard2
(
vec3
x
)
{
...
...
@@ -56,9 +56,9 @@ vec3 reinhard2(vec3 x) {
vec3
filmic
(
vec3
color
)
{
color
=
max
(
vec3
(
0
.),
color
-
vec3
(
0
.
004
));
color
=
(
color
*
(
6
.
2
*
color
+
.
5
))
/
(
color
*
(
6
.
2
*
color
+
1
.
7
)
+
0
.
06
);
return
color
;
color
=
max
(
vec3
(
0
.),
color
-
vec3
(
0
.
004
));
color
=
(
color
*
(
6
.
2
*
color
+
.
5
))
/
(
color
*
(
6
.
2
*
color
+
1
.
7
)
+
0
.
06
);
return
color
;
}
vec3
unreal
(
vec3
x
)
...
...
@@ -178,8 +178,9 @@ void main()
#if TONEMAP_METHOD == 0 // None, Gamma Correct Only
#define NEEDS_GAMMA_CORRECT 1
#elif TONEMAP_METHOD == 1 // Linear
#elif TONEMAP_METHOD == 1 // Linear
#define NEEDS_GAMMA_CORRECT 1
diff
.
rgb
=
clamp
(
diff
.
rgb
,
0
,
1
);
#elif TONEMAP_METHOD == 2 // Reinhard method
#define NEEDS_GAMMA_CORRECT 1
diff
.
rgb
=
reinhard
(
diff
.
rgb
);
...
...
@@ -212,25 +213,25 @@ void main()
#if COLOR_GRADE_LUT
// Invert coord for compat with DX-style LUT
diff
.
y
=
1
.
0
-
diff
.
y
;
diff
.
y
=
1
.
0
-
diff
.
y
;
// Convert to texel coords
vec3
lutRange
=
diff
.
rgb
*
(
colorgrade_lut_size
.
w
-
1
);
// Convert to texel coords
vec3
lutRange
=
diff
.
rgb
*
(
colorgrade_lut_size
.
w
-
1
);
// Calculate coords in texel space
vec2
lutX
=
vec2
(
floor
(
lutRange
.
z
)
*
colorgrade_lut_size
.
w
+
lutRange
.
x
,
lutRange
.
y
);
vec2
lutY
=
vec2
(
ceil
(
lutRange
.
z
)
*
colorgrade_lut_size
.
w
+
lutRange
.
x
,
lutRange
.
y
);
vec2
lutX
=
vec2
(
floor
(
lutRange
.
z
)
*
colorgrade_lut_size
.
w
+
lutRange
.
x
,
lutRange
.
y
);
vec2
lutY
=
vec2
(
ceil
(
lutRange
.
z
)
*
colorgrade_lut_size
.
w
+
lutRange
.
x
,
lutRange
.
y
);
// texel to ndc
lutX
=
(
lutX
+
0
.
5
)
*
colorgrade_lut_size
.
xy
;
lutY
=
(
lutY
+
0
.
5
)
*
colorgrade_lut_size
.
xy
;
// texel to ndc
lutX
=
(
lutX
+
0
.
5
)
*
colorgrade_lut_size
.
xy
;
lutY
=
(
lutY
+
0
.
5
)
*
colorgrade_lut_size
.
xy
;
// LUT interpolation
diff
.
rgb
=
mix
(
// LUT interpolation
diff
.
rgb
=
mix
(
texture2D
(
colorgrade_lut
,
lutX
).
rgb
,
texture2D
(
colorgrade_lut
,
lutY
).
rgb
,
fract
(
lutRange
.
z
)
);
);
#endif
frag_color
=
diff
;
...
...
indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
View file @
c3e5e3b5
...
...
@@ -158,7 +158,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
{
float
scol
=
fres
*
texture2D
(
lightFunc
,
vec2
(
nh
,
spec
.
a
)).
r
*
gt
/
(
nh
*
da
);
vec3
speccol
=
lit
*
scol
*
light_col
.
rgb
*
spec
.
rgb
;
speccol
=
clamp
(
speccol
,
vec3
(
0
)
,
vec3
(
1
)
);
speccol
=
max
(
speccol
,
vec3
(
0
));
col
+=
speccol
;
float
cur_glare
=
max
(
speccol
.
r
,
speccol
.
g
);
...
...
indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
View file @
c3e5e3b5
...
...
@@ -229,8 +229,9 @@ void main()
if
(
nh
>
0
.
0
)
{
float
scol
=
fres
*
texture2D
(
lightFunc
,
vec2
(
nh
,
spec
.
a
)).
r
*
gt
/
(
nh
*
da
);
col
+=
dlit
*
scol
*
spec
.
rgb
;
//col += spec.rgb;
vec3
speccol
=
dlit
*
scol
*
spec
.
rgb
;
speccol
=
max
(
speccol
,
vec3
(
0
));
col
+=
speccol
;
}
}
...
...
indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
View file @
c3e5e3b5
...
...
@@ -229,8 +229,9 @@ void main()
if
(
nh
>
0
.
0
)
{
float
scol
=
fres
*
texture2D
(
lightFunc
,
vec2
(
nh
,
spec
.
a
)).
r
*
gt
/
(
nh
*
da
);
col
+=
dlit
*
scol
*
spec
.
rgb
;
//col += spec.rgb;
vec3
speccol
=
dlit
*
scol
*
spec
.
rgb
;
speccol
=
max
(
speccol
,
vec3
(
0
));
col
+=
speccol
;
}
}
...
...
indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
View file @
c3e5e3b5
...
...
@@ -43,7 +43,6 @@ vec3 srgb_to_linear(vec3 cs)
vec3
linear_to_srgb
(
vec3
cl
)
{
cl
=
clamp
(
cl
,
vec3
(
0
),
vec3
(
1
));
vec3
low_range
=
cl
*
12
.
92
;
vec3
high_range
=
1
.
055
*
pow
(
cl
,
vec3
(
0
.
41666
))
-
0
.
055
;
bvec3
lt
=
lessThan
(
cl
,
vec3
(
0
.
003130
8
));
...
...
indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
View file @
c3e5e3b5
...
...
@@ -225,9 +225,10 @@ void main()
vec4
spec
=
texture2DRect
(
specularRect
,
frag
.
xy
);
if
(
spec
.
a
>
0
.
0
)
{
vec3
npos
=
-
normalize
(
pos
);
dlit
*=
min
(
da
*
6
.
0
,
1
.
0
)
*
dist_atten
;
vec3
npos
=
-
normalize
(
pos
);
//vec3 ref = dot(pos+lv, norm);
vec3
h
=
normalize
(
lv
+
npos
);
float
nh
=
dot
(
norm
,
h
);
...
...
@@ -243,7 +244,7 @@ void main()
{
float
scol
=
fres
*
texture2D
(
lightFunc
,
vec2
(
nh
,
spec
.
a
)).
r
*
gt
/
(
nh
*
da
);
vec3
speccol
=
dlit
*
scol
*
spec
.
rgb
*
shadow
;
speccol
=
clamp
(
speccol
,
vec3
(
0
)
,
vec3
(
1
)
);
speccol
=
max
(
speccol
,
vec3
(
0
));
col
+=
speccol
;
}
}
...
...
indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
View file @
c3e5e3b5
...
...
@@ -225,6 +225,7 @@ void main()
if
(
spec
.
a
>
0
.
0
)
{
dlit
*=
min
(
da
*
6
.
0
,
1
.
0
)
*
dist_atten
;
vec3
npos
=
-
normalize
(
pos
);
//vec3 ref = dot(pos+lv, norm);
...
...
@@ -242,7 +243,7 @@ void main()
{
float
scol
=
fres
*
texture2D
(
lightFunc
,
vec2
(
nh
,
spec
.
a
)).
r
*
gt
/
(
nh
*
da
);
vec3
speccol
=
dlit
*
scol
*
spec
.
rgb
*
shadow
;
speccol
=
clamp
(
speccol
,
vec3
(
0
)
,
vec3
(
1
)
);
speccol
=
max
(
speccol
,
vec3
(
0
));
col
+=
speccol
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment