Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
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
Alchemy Viewer
Alchemy Viewer
Commits
cd0944ca
Commit
cd0944ca
authored
2 years ago
by
David Parks
Browse files
Options
Downloads
Patches
Plain Diff
SL-19239 Redo integration of Sascha's radiance map filter.
parent
a91c970e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl
+6
-11
6 additions, 11 deletions
...w/app_settings/shaders/class1/interface/radianceGenF.glsl
indra/newview/llreflectionmapmanager.cpp
+2
-2
2 additions, 2 deletions
indra/newview/llreflectionmapmanager.cpp
with
8 additions
and
13 deletions
indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl
+
6
−
11
View file @
cd0944ca
...
...
@@ -127,14 +127,11 @@ vec4 prefilterEnvMap(vec3 R)
vec3
V
=
R
;
vec4
color
=
vec4
(
0
.
0
);
float
totalWeight
=
0
.
0
;
float
envMapDim
=
u_width
;
int
numSamples
=
4
;
float
numMips
=
max_probe_lod
;
float
envMapDim
=
float
(
textureSize
(
reflectionProbes
,
0
).
s
);
float
roughness
=
mipLevel
/
max_probe_lod
;
int
numSamples
=
max
(
int
(
32
*
roughness
),
1
);
float
roughness
=
mipLevel
/
numMips
;
numSamples
=
max
(
int
(
numSamples
*
roughness
),
1
);
float
numMips
=
max_probe_lod
+
1
;
for
(
uint
i
=
0u
;
i
<
numSamples
;
i
++
)
{
vec2
Xi
=
hammersley2d
(
i
,
numSamples
);
...
...
@@ -154,11 +151,9 @@ vec4 prefilterEnvMap(vec3 R)
// Solid angle of 1 pixel across all cube faces
float
omegaP
=
4
.
0
*
PI
/
(
6
.
0
*
envMapDim
*
envMapDim
);
// Biased (+1.0) mip level for better result
float
mip
=
roughness
==
0
.
0
?
0
.
0
:
clamp
(
0
.
5
*
log2
(
omegaS
/
omegaP
)
+
1
.
0
,
0
.
0
f
,
numMips
);
//float mip = clamp(0.5 * log2(omegaS / omegaP) + 1.0, 0.0f, 7.f);
color
+=
textureLod
(
reflectionProbes
,
vec4
(
L
,
sourceIdx
),
mip
)
*
dotNL
;
float
mipLevel
=
roughness
==
0
.
0
?
0
.
0
:
max
(
0
.
5
*
log2
(
omegaS
/
omegaP
)
+
1
.
0
,
0
.
0
f
);
color
+=
textureLod
(
reflectionProbes
,
vec4
(
L
,
sourceIdx
),
mipLevel
)
*
dotNL
;
totalWeight
+=
dotNL
;
}
}
return
(
color
/
totalWeight
);
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llreflectionmapmanager.cpp
+
2
−
2
View file @
cd0944ca
...
...
@@ -94,7 +94,7 @@ void LLReflectionMapManager::update()
if
(
!
mRenderTarget
.
isComplete
())
{
U32
color_fmt
=
GL_RGB16
F
;
U32
color_fmt
=
GL_RGB16
;
U32
targetRes
=
mProbeResolution
*
2
;
// super sample
mRenderTarget
.
allocate
(
targetRes
,
targetRes
,
color_fmt
,
true
);
}
...
...
@@ -107,7 +107,7 @@ void LLReflectionMapManager::update()
mMipChain
.
resize
(
count
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
mMipChain
[
i
].
allocate
(
res
,
res
,
GL_RGBA16
F
);
mMipChain
[
i
].
allocate
(
res
,
res
,
GL_RGBA16
);
res
/=
2
;
}
}
...
...
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