From 9bdc98ed474f15dd9a26fb58f65eb96e1002d57a Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 15 Dec 2023 23:09:40 +0100 Subject: [PATCH] Removed remaining particle material code. --- drivers/gles2/rasterizer_storage_gles2.cpp | 6 +----- servers/rendering/shader_types.cpp | 24 ---------------------- servers/rendering_server.cpp | 1 - servers/rendering_server.h | 1 - 4 files changed, 1 insertion(+), 31 deletions(-) diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index ee9efb2..d77363e 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -1180,11 +1180,7 @@ void RasterizerStorageGLES2::shader_set_code(RID p_shader, const String &p_code) String mode_string = ShaderLanguage::get_shader_type(p_code); RS::ShaderMode mode; - if (mode_string == "particles") { - mode = RS::SHADER_PARTICLES; - } else { - mode = RS::SHADER_CANVAS_ITEM; - } + mode = RS::SHADER_CANVAS_ITEM; if (shader->custom_code_id && mode != shader->mode) { shader->shader->free_custom_shader(shader->custom_code_id); diff --git a/servers/rendering/shader_types.cpp b/servers/rendering/shader_types.cpp index c34537f..cbbf8f0 100644 --- a/servers/rendering/shader_types.cpp +++ b/servers/rendering/shader_types.cpp @@ -120,29 +120,5 @@ ShaderTypes::ShaderTypes() { shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("unshaded"); shader_modes[RS::SHADER_CANVAS_ITEM].modes.push_back("light_only"); - /************ PARTICLES **************************/ - - shader_modes[RS::SHADER_PARTICLES].functions["global"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT); - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4; - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["VELOCITY"] = ShaderLanguage::TYPE_VEC3; - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["MASS"] = ShaderLanguage::TYPE_FLOAT; - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["ACTIVE"] = ShaderLanguage::TYPE_BOOL; - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["RESTART"] = constt(ShaderLanguage::TYPE_BOOL); - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["CUSTOM"] = ShaderLanguage::TYPE_VEC4; - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["TRANSFORM"] = ShaderLanguage::TYPE_MAT4; - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["LIFETIME"] = constt(ShaderLanguage::TYPE_FLOAT); - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["DELTA"] = constt(ShaderLanguage::TYPE_FLOAT); - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["NUMBER"] = constt(ShaderLanguage::TYPE_UINT); - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["INDEX"] = constt(ShaderLanguage::TYPE_INT); - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["EMISSION_TRANSFORM"] = constt(ShaderLanguage::TYPE_MAT4); - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].built_ins["RANDOM_SEED"] = constt(ShaderLanguage::TYPE_UINT); - shader_modes[RS::SHADER_PARTICLES].functions["vertex"].main_function = true; - - shader_modes[RS::SHADER_PARTICLES].modes.push_back("disable_force"); - shader_modes[RS::SHADER_PARTICLES].modes.push_back("disable_velocity"); - shader_modes[RS::SHADER_PARTICLES].modes.push_back("keep_data"); - - shader_types.insert("spatial"); shader_types.insert("canvas_item"); - shader_types.insert("particles"); } diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 8da3d4e..c7571f7 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -1618,7 +1618,6 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(TEXTURE_FLAGS_DEFAULT); BIND_ENUM_CONSTANT(SHADER_CANVAS_ITEM); - BIND_ENUM_CONSTANT(SHADER_PARTICLES); BIND_ENUM_CONSTANT(SHADER_MAX); BIND_ENUM_CONSTANT(ARRAY_VERTEX); diff --git a/servers/rendering_server.h b/servers/rendering_server.h index 5bc7976..6fdf4bf 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -180,7 +180,6 @@ public: enum ShaderMode { SHADER_CANVAS_ITEM, - SHADER_PARTICLES, SHADER_MAX };