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
0bc585e
commit 9aa9c7c
Showing
21 changed files
with
1,746 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#version 460 | ||
|
||
#include "noise.glsl" | ||
#include "utils.glsl" | ||
#include "color_spaces.glsl" | ||
#include "lk_dnsr_utils.glsl" | ||
|
||
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; | ||
|
||
layout(set = 0, binding = 0, rgba16f) uniform writeonly image2D out_blue_noise; | ||
|
||
#define GLSL | ||
#include "ray_interop.h" | ||
#undef GLSL | ||
|
||
layout(set = 0, binding = 1) uniform UBO { UniformBuffer ubo; } ubo; | ||
layout(set = 0, binding = 2) uniform sampler2D textures[MAX_TEXTURES]; | ||
|
||
layout(set = 0, binding = 3) uniform sampler3D blue_noise_texture; | ||
|
||
#include "bluenoise.glsl" | ||
|
||
void main() { | ||
ivec2 res = ivec2(imageSize(out_blue_noise)); | ||
ivec2 pix = ivec2(gl_GlobalInvocationID); | ||
|
||
if (any(greaterThanEqual(pix, res))) { | ||
return; | ||
} | ||
|
||
const ivec2 out_pix = pix; // need a checkerboard? | ||
|
||
vec4 blue_noise = blueNoise(ivec3(pix.xy, ubo.ubo.frame_counter)); | ||
blue_noise += blue_noise.yzwx / 256. + blue_noise.zwxy / (256. * 256.); // add extra details up to 16 bits | ||
|
||
imageStore(out_blue_noise, out_pix, FIX_NAN(blue_noise)); | ||
} |
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 @@ | ||
|
||
// not plane, it's sphere, but working | ||
#define NEAR_PLANE_OFFSET 5. | ||
|
||
// we downsample gi map and store bounces positions in neighboor texels | ||
// downsample image dimensions by 2 = store 4 bounces | ||
// downsample image dimensions by 3 = store 9 bounces | ||
#define GI_DOWNSAMPLE 2 | ||
|
||
// max bounces for testing bounces visiblity | ||
#define GI_BOUNCES_MAX 1 |
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,26 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_ray_query: require | ||
#extension GL_EXT_shader_atomic_float: require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
|
||
#define RAY_QUERY | ||
|
||
#define PRIMARY_VIEW 1 | ||
|
||
#define SRC_FIRST_POSITION refl_position_t | ||
#define SRC_POSITION position_t | ||
#define SRC_NORMALS normals_gs | ||
#define SRC_MATERIAL material_rmxx | ||
#define SRC_BASE_COLOR base_color_a | ||
|
||
#define LIGHT_CHOOSE_PASS 1 | ||
#define OUT_LIGHTING out_light_poly_chosen_direct | ||
|
||
#define LIGHT_POLYGON 1 | ||
#define GRAY_MATERIAL 1 | ||
|
||
//#define MAX_LIGHTS_PER_TEXEL 32 | ||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#include "lk_dnsr_lights_adaptive.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_ray_query: require | ||
#extension GL_EXT_shader_atomic_float: require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
|
||
#define RAY_QUERY | ||
|
||
#define PRIMARY_VIEW 1 | ||
|
||
#define SRC_FIRST_POSITION refl_position_t | ||
#define SRC_POSITION position_t | ||
#define SRC_NORMALS normals_gs | ||
#define SRC_MATERIAL material_rmxx | ||
#define SRC_BASE_COLOR base_color_a | ||
|
||
#define OUT_SEPARATELY 1 | ||
|
||
#define OUT_DIFFUSE out_light_poly_diffuse | ||
#define OUT_SPECULAR out_light_poly_specular | ||
|
||
#define LIGHT_SAMPLE_PASS 1 | ||
#define SRC_LIGHTS_CHOSEN light_poly_chosen_direct | ||
|
||
#define LIGHT_POLYGON 1 | ||
#define GRAY_MATERIAL 1 | ||
//#define MAX_LIGHTS_PER_TEXEL 32 | ||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#include "lk_dnsr_lights_adaptive.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
#extension GL_EXT_ray_query: require | ||
|
||
#define GLOBAL_ILLUMINATION 1 | ||
|
||
#define SRC_FIRST_POSITION position_t | ||
#define SRC_POSITION gi_position_t | ||
#define SRC_NORMALS gi_normals_gs | ||
#define SRC_MATERIAL material_rmxx | ||
#define SRC_BASE_COLOR gi_base_color_a | ||
|
||
#define OUT_LIGHTING out_light_point_gi | ||
|
||
#define ADAPT_LIGHTS_COUNT 1 | ||
|
||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#define RAY_QUERY | ||
#define LIGHT_POINT 1 | ||
#include "lk_dnsr_lights_direct.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
#extension GL_EXT_ray_query: require | ||
|
||
#define GLOBAL_ILLUMINATION 1 | ||
|
||
#define SRC_FIRST_POSITION gi_prev_bounce_pos | ||
#define SRC_POSITION gi_position_t | ||
#define SRC_NORMALS gi_normals_gs | ||
#define SRC_MATERIAL material_rmxx | ||
#define SRC_BASE_COLOR gi_base_color_a | ||
|
||
#define OUT_LIGHTING out_light_poly_gi | ||
|
||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#define RAY_QUERY | ||
#define LIGHT_POLYGON 1 | ||
#include "lk_dnsr_lights_direct.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_ray_query: require | ||
#extension GL_EXT_shader_atomic_float: require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
|
||
#define RAY_QUERY | ||
|
||
#define GLOBAL_ILLUMINATION 1 | ||
|
||
#define SRC_FIRST_POSITION position_t | ||
#define SRC_POSITION gi_position_t | ||
#define SRC_NORMALS gi_normals_gs | ||
#define SRC_MATERIAL material_rmxx | ||
#define SRC_BASE_COLOR gi_base_color_a | ||
|
||
#define LIGHT_CHOOSE_PASS 1 | ||
#define OUT_LIGHTING out_light_poly_chosen_gi | ||
|
||
#define LIGHT_POLYGON 1 | ||
|
||
|
||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#include "lk_dnsr_lights_adaptive.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_ray_query: require | ||
#extension GL_EXT_shader_atomic_float: require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
|
||
#define RAY_QUERY | ||
|
||
#define GLOBAL_ILLUMINATION 1 | ||
|
||
#define SRC_FIRST_POSITION position_t | ||
#define SRC_POSITION gi_position_t | ||
#define SRC_NORMALS gi_normals_gs | ||
#define SRC_MATERIAL material_rmxx | ||
#define SRC_BASE_COLOR gi_base_color_a | ||
|
||
#define OUT_LIGHTING out_light_poly_gi | ||
|
||
#define LIGHT_SAMPLE_PASS 1 | ||
#define SRC_LIGHTS_CHOSEN light_poly_chosen_gi | ||
|
||
#define LIGHT_POLYGON 1 | ||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#include "lk_dnsr_lights_adaptive.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
#extension GL_EXT_ray_query: require | ||
|
||
#define REFLECTIONS 1 | ||
|
||
#define SRC_FIRST_POSITION position_t | ||
#define SRC_POSITION refl_position_t | ||
#define SRC_NORMALS refl_normals_gs | ||
#define SRC_MATERIAL refl_material_rmxx | ||
#define SRC_BASE_COLOR refl_base_color_a | ||
|
||
#define OUT_LIGHTING out_light_point_refl | ||
|
||
#define ADAPT_LIGHTS_COUNT 1 | ||
|
||
//#define MAX_LIGHTS_PER_TEXEL 32 | ||
//#define REUSE_SCREEN_LIGHTING 1 | ||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#define RAY_QUERY | ||
#define LIGHT_POINT 1 | ||
#include "lk_dnsr_lights_direct.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
#extension GL_EXT_ray_query: require | ||
|
||
#define REFLECTIONS 1 | ||
|
||
#define SRC_FIRST_POSITION position_t | ||
#define SRC_POSITION refl_position_t | ||
#define SRC_NORMALS refl_normals_gs | ||
#define SRC_MATERIAL refl_material_rmxx | ||
#define SRC_BASE_COLOR refl_base_color_a | ||
|
||
#define OUT_LIGHTING out_light_poly_refl | ||
|
||
//#define REUSE_SCREEN_LIGHTING 1 | ||
|
||
//#define MAX_LIGHTS_PER_TEXEL 32 | ||
//#define REUSE_SCREEN_LIGHTING 1 | ||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#define RAY_QUERY | ||
#define LIGHT_POLYGON 1 | ||
#include "lk_dnsr_lights_direct.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_ray_query: require | ||
#extension GL_EXT_shader_atomic_float: require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
|
||
#define RAY_QUERY | ||
|
||
#define REFLECTIONS 1 | ||
|
||
#define SRC_FIRST_POSITION position_t | ||
#define SRC_POSITION refl_position_t | ||
#define SRC_NORMALS refl_normals_gs | ||
#define SRC_MATERIAL refl_material_rmxx | ||
#define SRC_BASE_COLOR refl_base_color_a | ||
|
||
#define LIGHT_CHOOSE_PASS 1 | ||
#define OUT_LIGHTING out_light_poly_chosen_refl | ||
|
||
#define LIGHT_POLYGON 1 | ||
|
||
//#define REUSE_SCREEN_LIGHTING 1 | ||
|
||
//#define MAX_LIGHTS_PER_TEXEL 32 | ||
//#define REUSE_SCREEN_LIGHTING 1 | ||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#include "lk_dnsr_lights_adaptive.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#version 460 core | ||
#extension GL_GOOGLE_include_directive : require | ||
#extension GL_EXT_ray_query: require | ||
#extension GL_EXT_shader_atomic_float: require | ||
#extension GL_EXT_shader_16bit_storage : require | ||
|
||
#define RAY_QUERY | ||
|
||
#define REFLECTIONS 1 | ||
|
||
#define SRC_FIRST_POSITION position_t | ||
#define SRC_POSITION refl_position_t | ||
#define SRC_NORMALS refl_normals_gs | ||
#define SRC_MATERIAL refl_material_rmxx | ||
#define SRC_BASE_COLOR refl_base_color_a | ||
|
||
#define OUT_LIGHTING out_light_poly_refl | ||
|
||
#define LIGHT_SAMPLE_PASS 1 | ||
#define SRC_LIGHTS_CHOSEN light_poly_chosen_refl | ||
|
||
#define LIGHT_POLYGON 1 | ||
//#define REUSE_SCREEN_LIGHTING 1 | ||
|
||
//#define MAX_LIGHTS_PER_TEXEL 32 | ||
//#define REUSE_SCREEN_LIGHTING 1 | ||
//#define ONE_LIGHT_PER_TEXEL 1 | ||
|
||
#include "lk_dnsr_lights_adaptive.glsl" |
Oops, something went wrong.