diff options
author | reduz <reduzio@gmail.com> | 2021-04-13 17:01:43 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2021-04-14 11:37:52 -0300 |
commit | d3b49c416ab0f2009bb41a035f8171726f892cce (patch) | |
tree | 12b9832f1840a72c886680cadd55a7b6bcf74cd3 /servers/rendering/renderer_rd/shaders/particles.glsl | |
parent | 8ce0fb0a946455ed6a7bc8a54fcf90a9d5a9ae4d (diff) |
Refactor GLSL shader compilation
-Used a more consistent set of keywords for the shader
-Remove all harcoded entry points
-Re-wrote the GLSL shader parser, new system is more flexible. Allows any entry point organization.
-Entry point for sky shaders is now sky().
-Entry point for particle shaders is now process().
Diffstat (limited to 'servers/rendering/renderer_rd/shaders/particles.glsl')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/particles.glsl | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/servers/rendering/renderer_rd/shaders/particles.glsl b/servers/rendering/renderer_rd/shaders/particles.glsl index cb6d8dc7f6..c438352c05 100644 --- a/servers/rendering/renderer_rd/shaders/particles.glsl +++ b/servers/rendering/renderer_rd/shaders/particles.glsl @@ -2,7 +2,7 @@ #version 450 -VERSION_DEFINES +#VERSION_DEFINES layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; @@ -146,11 +146,11 @@ layout(set = 2, binding = 1) uniform texture2D height_field_texture; /* SET 3: MATERIAL */ -#ifdef USE_MATERIAL_UNIFORMS +#ifdef MATERIAL_UNIFORMS_USED layout(set = 3, binding = 0, std140) uniform MaterialUniforms{ - /* clang-format off */ -MATERIAL_UNIFORMS - /* clang-format on */ + +#MATERIAL_UNIFORMS + } material; #endif @@ -196,11 +196,7 @@ bool emit_subparticle(mat4 p_xform, vec3 p_velocity, vec4 p_color, vec4 p_custom return true; } -/* clang-format off */ - -COMPUTE_SHADER_GLOBALS - -/* clang-format on */ +#GLOBALS void main() { uint particle = gl_GlobalInvocationID.x; @@ -540,10 +536,6 @@ void main() { } if (PARTICLE.is_active) { - /* clang-format off */ - -COMPUTE_SHADER_CODE - - /* clang-format on */ +#CODE : PROCESS } } |