forked from w23/xash3d-fwgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f9928a
commit 77dc69e
Showing
12 changed files
with
451 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_ray_query: require | ||
|
||
#define RAY_QUERY | ||
|
||
#define SECOND_POSITION gi_position_t | ||
|
||
#define GI | ||
|
||
#define LIGHT_POINT 1 | ||
#define OUTPUTS(X) \ | ||
X(20, light_point_diffuse_gi, rgba16f) \ | ||
X(21, light_point_specular_gi, rgba16f) | ||
#include "lk_dnsr_lights_direct_w23.glsl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#version 460 | ||
|
||
#include "noise.glsl" | ||
#include "utils.glsl" | ||
#include "brdf.h" | ||
#include "lk_dnsr_config.glsl" | ||
#include "lk_dnsr_spherical_harmonics.glsl" | ||
#include "lk_dnsr_utils.glsl" | ||
#include "color_spaces.glsl" | ||
|
||
#define GI_LIMIT_LUMINANCE 0.2 | ||
|
||
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; | ||
|
||
layout(set = 0, binding = 0, rgba16f) uniform image2D out_specular_accum; | ||
layout(set = 0, binding = 1, rgba16f) uniform image2D out_diffuse_accum; | ||
layout(set = 0, binding = 2, rgba16f) uniform image2D out_gi_sh1_accum; | ||
layout(set = 0, binding = 3, rgba16f) uniform image2D out_gi_sh2_accum; | ||
|
||
layout(set = 0, binding = 4, rgba8) uniform readonly image2D base_color_a; | ||
layout(set = 0, binding = 5, rgba8) uniform readonly image2D refl_base_color_a; | ||
|
||
layout(set = 0, binding = 6, rgba16f) uniform readonly image2D light_poly_diffuse; | ||
|
||
layout(set = 0, binding = 7, rgba16f) uniform readonly image2D light_point_diffuse; | ||
|
||
|
||
|
||
vec3 samplePolyDirect(ivec2 pix, ivec2 res) { | ||
if (any(lessThan(pix, ivec2(0))) && any(greaterThanEqual(pix, res))) return vec3(-100.); | ||
return FIX_NAN(imageLoad(light_poly_diffuse, pix)).rgb; | ||
} | ||
|
||
vec3 samplePolyDirectOpposite(ivec2 pix1, ivec2 pix2, ivec2 res) { | ||
const vec3 first = samplePolyDirect(pix1, res); | ||
const vec3 second = samplePolyDirect(pix2, res); | ||
if (first.x < 0.99) return second; | ||
else if (first.x < 0.99) return first; | ||
return (first + second) / 2.; | ||
} | ||
|
||
void main() { | ||
ivec2 res = ivec2(imageSize(base_color_a)); | ||
ivec2 pix = ivec2(gl_GlobalInvocationID); | ||
|
||
if (any(greaterThanEqual(pix, res))) { | ||
return; | ||
} | ||
|
||
const vec3 diffuse = FIX_NAN(imageLoad(light_point_diffuse, pix)).rgb | ||
+ FIX_NAN(imageLoad(light_poly_diffuse, pix)).rgb; | ||
|
||
imageStore(out_diffuse_accum, pix, vec4(diffuse, 0.)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#version 460 | ||
#extension GL_GOOGLE_include_directive : require | ||
|
||
#define SVGF_STEP_SIZE 4 | ||
#define INPUT_IMAGE specular_pre_blur_2 | ||
#define OUTPUT_IMAGE out_specular_pre_blured | ||
//#define VARIANCE_IMAGE specular_variance | ||
|
||
#define MAXIMAL_VARIANCE 1 | ||
|
||
#include "lk_dnsr_svgf_kernel.glsl" |
Oops, something went wrong.