Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Dependencies
Cpp
mirrage
Commits
16d26c81
Commit
16d26c81
authored
Apr 16, 2018
by
Florian Oetke
Browse files
fixed reprojection of spec GI
parent
53dca3c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
assets/core_assets/shader/bin/gi_sample_spec.frag.spv
View file @
16d26c81
No preview for this file type
assets/core_assets/shader/bin/gi_spec_blur.frag.spv
View file @
16d26c81
No preview for this file type
assets/core_assets/shader/gi_sample_spec.frag
View file @
16d26c81
...
...
@@ -108,12 +108,12 @@ void main() {
float
max_distance
=
min
(
32
,
4
/
(
tan
(
coneTheta
)
*
2
));
float
max_steps
=
max_distance
*
8
;
vec3
jitter
=
PDnrand3
(
vertex_out
.
tex_coords
);
vec3
jitter
=
PDnrand3
(
vertex_out
.
tex_coords
+
global_uniforms
.
time
.
x
);
vec2
raycast_hit_uv
;
vec3
raycast_hit_point
;
if
(
spec_visible
&&
traceScreenSpaceRay1
(
P
+
dir
*
0
.
25
,
dir
,
pcs
.
projection
,
depth_sampler
,
traceScreenSpaceRay1
(
P
+
(
dir
*
0
.
25
+
jitter
*
0
.
1
)
,
dir
,
pcs
.
projection
,
depth_sampler
,
depthSize
,
1
.
0
,
global_uniforms
.
proj_planes
.
x
,
10
,
0
.
5
*
jitter
.
z
,
max_steps
,
max_distance
,
int
(
startLod
+
0
.
5
),
raycast_hit_uv
,
raycast_hit_point
))
{
...
...
@@ -136,7 +136,7 @@ void main() {
out_color
.
rgb
/=
(
1
+
luminance_norm
(
out_color
.
rgb
));
}
else
{
out_color
.
rgb
=
textureLod
(
diffuse_sampler
,
vertex_out
.
tex_coords
,
pcs
.
prev_projection
[
0
][
3
]).
rgb
/
(
PI
*
PI
*
4
);
out_color
.
rgb
=
textureLod
(
diffuse_sampler
,
vertex_out
.
tex_coords
,
pcs
.
prev_projection
[
0
][
3
]).
rgb
/
(
PI
*
PI
*
2
);
}
float
history_weight
=
texelFetch
(
history_weight_sampler
,
...
...
assets/core_assets/shader/gi_spec_blur.frag
View file @
16d26c81
...
...
@@ -38,5 +38,5 @@ void main() {
color_out
=
vec4
(
result
/
weight_sum
,
1
.
0
);
//
color_out.rgb = read(vertex_out.uv_center, center_depth, weight_sum, 1.0).rgb;
color_out
.
rgb
=
mix
(
color_out
.
rgb
,
read
(
vertex_out
.
uv_center
,
center_depth
,
weight_sum
,
1
.
0
).
rgb
,
0
.
5
)
;
}
src/mirrage/renderer/src/pass/gi_pass.cpp
View file @
16d26c81
...
...
@@ -727,7 +727,7 @@ namespace mirrage::renderer {
_min_mip_level
,
_color_diffuse_in
,
_gi_diffuse_history
,
_gi_specular
_history
,
_gi_specular
,
_history_weight
,
_reproject_framebuffer
))
,
_reproject_descriptor_set
(
_descriptor_set_layout
.
create_set
(
renderer
.
descriptor_pool
(),
...
...
@@ -735,7 +735,7 @@ namespace mirrage::renderer {
renderer
.
gbuffer
().
mat_data
.
view
(),
renderer
.
gbuffer
().
albedo_mat_id
.
view
(
0
),
_gi_diffuse_result
.
view
(),
_gi_specular
.
view
(),
_gi_specular
_history
.
view
(),
renderer
.
gbuffer
().
prev_depth
.
view
(),
_integrated_brdf
.
view
(),
_history_weight_prev
.
view
()}))
...
...
@@ -892,6 +892,14 @@ namespace mirrage::renderer {
_history_weight_prev
,
vk
::
ImageLayout
::
eUndefined
,
vk
::
ImageLayout
::
eShaderReadOnlyOptimal
);
graphic
::
blit_texture
(
command_buffer
,
_gi_specular
,
vk
::
ImageLayout
::
eShaderReadOnlyOptimal
,
vk
::
ImageLayout
::
eShaderReadOnlyOptimal
,
_gi_specular_history
,
vk
::
ImageLayout
::
eUndefined
,
vk
::
ImageLayout
::
eShaderReadOnlyOptimal
);
}
void
Gi_pass
::
_integrate_brdf
(
vk
::
CommandBuffer
&
command_buffer
)
{
...
...
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