summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/shaders
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-11-28 22:51:59 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-11-28 22:58:54 +0100
commit0beacf2ce8f5c3aed811944272aa411081393087 (patch)
treefebc11d17a3b5222b08a33f07733d637f30be3d6 /servers/rendering/renderer_rd/shaders
parent69a194f051c5f02243092e305633b9ffbd03b05f (diff)
Remove unused code in GI shaders
Diffstat (limited to 'servers/rendering/renderer_rd/shaders')
-rw-r--r--servers/rendering/renderer_rd/shaders/giprobe_write.glsl1
-rw-r--r--servers/rendering/renderer_rd/shaders/voxel_gi.glsl1
-rw-r--r--servers/rendering/renderer_rd/shaders/voxel_gi_debug.glsl56
-rw-r--r--servers/rendering/renderer_rd/shaders/voxel_gi_sdf.glsl5
4 files changed, 2 insertions, 61 deletions
diff --git a/servers/rendering/renderer_rd/shaders/giprobe_write.glsl b/servers/rendering/renderer_rd/shaders/giprobe_write.glsl
index 25d87ca45d..a6d65bffeb 100644
--- a/servers/rendering/renderer_rd/shaders/giprobe_write.glsl
+++ b/servers/rendering/renderer_rd/shaders/giprobe_write.glsl
@@ -7,7 +7,6 @@
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
#define NO_CHILDREN 0xFFFFFFFF
-#define GREY_VEC vec3(0.33333, 0.33333, 0.33333)
struct CellChildren {
uint children[8];
diff --git a/servers/rendering/renderer_rd/shaders/voxel_gi.glsl b/servers/rendering/renderer_rd/shaders/voxel_gi.glsl
index 779f04ed35..73a97d9df1 100644
--- a/servers/rendering/renderer_rd/shaders/voxel_gi.glsl
+++ b/servers/rendering/renderer_rd/shaders/voxel_gi.glsl
@@ -13,7 +13,6 @@ layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
#ifndef MODE_DYNAMIC
#define NO_CHILDREN 0xFFFFFFFF
-#define GREY_VEC vec3(0.33333, 0.33333, 0.33333)
struct CellChildren {
uint children[8];
diff --git a/servers/rendering/renderer_rd/shaders/voxel_gi_debug.glsl b/servers/rendering/renderer_rd/shaders/voxel_gi_debug.glsl
index 281c496df3..3f3437f527 100644
--- a/servers/rendering/renderer_rd/shaders/voxel_gi_debug.glsl
+++ b/servers/rendering/renderer_rd/shaders/voxel_gi_debug.glsl
@@ -90,66 +90,10 @@ void main() {
#endif
#ifdef MODE_DEBUG_LIGHT
-
-#ifdef USE_ANISOTROPY
-
-#define POS_X 0
-#define POS_Y 1
-#define POS_Z 2
-#define NEG_X 3
-#define NEG_Y 4
-#define NEG_Z 5
-
- const uint triangle_aniso[12] = uint[](
- NEG_X,
- NEG_Z,
- NEG_Y,
- NEG_Z,
- NEG_X,
- NEG_Y,
- POS_Z,
- POS_X,
- POS_X,
- POS_Y,
- POS_Y,
- POS_Z);
-
- color_interp.xyz = texelFetch(sampler3D(color_tex, tex_sampler), ivec3(posu), int(params.level)).xyz * params.dynamic_range;
- vec3 aniso_pos = texelFetch(sampler3D(aniso_pos_tex, tex_sampler), ivec3(posu), int(params.level)).xyz;
- vec3 aniso_neg = texelFetch(sampler3D(aniso_neg_tex, tex_sampler), ivec3(posu), int(params.level)).xyz;
- uint side = triangle_aniso[gl_VertexIndex / 3];
-
- float strength = 0.0;
- switch (side) {
- case POS_X:
- strength = aniso_pos.x;
- break;
- case POS_Y:
- strength = aniso_pos.y;
- break;
- case POS_Z:
- strength = aniso_pos.z;
- break;
- case NEG_X:
- strength = aniso_neg.x;
- break;
- case NEG_Y:
- strength = aniso_neg.y;
- break;
- case NEG_Z:
- strength = aniso_neg.z;
- break;
- }
-
- color_interp.xyz *= strength;
-
-#else
color_interp = texelFetch(sampler3D(color_tex, tex_sampler), ivec3(posu), int(params.level));
color_interp.xyz *params.dynamic_range;
-
#endif
-#endif
float scale = (1 << params.level);
gl_Position = params.projection * vec4((vec3(posu) + vertex) * scale, 1.0);
diff --git a/servers/rendering/renderer_rd/shaders/voxel_gi_sdf.glsl b/servers/rendering/renderer_rd/shaders/voxel_gi_sdf.glsl
index e20b3f680d..3bb4421646 100644
--- a/servers/rendering/renderer_rd/shaders/voxel_gi_sdf.glsl
+++ b/servers/rendering/renderer_rd/shaders/voxel_gi_sdf.glsl
@@ -6,10 +6,9 @@
layout(local_size_x = 4, local_size_y = 4, local_size_z = 4) in;
-#define MAX_DISTANCE 100000
+#define MAX_DISTANCE 100000.0
#define NO_CHILDREN 0xFFFFFFFF
-#define GREY_VEC vec3(0.33333, 0.33333, 0.33333)
struct CellChildren {
uint children[8];
@@ -44,7 +43,7 @@ params;
void main() {
vec3 pos = vec3(gl_GlobalInvocationID);
- float closest_dist = 100000.0;
+ float closest_dist = MAX_DISTANCE;
for (uint i = params.offset; i < params.end; i++) {
vec3 posu = vec3(uvec3(cell_data.data[i].position & 0x7FF, (cell_data.data[i].position >> 11) & 0x3FF, cell_data.data[i].position >> 21));