diff options
Diffstat (limited to 'scene/resources/canvas_item_material.cpp')
-rw-r--r-- | scene/resources/canvas_item_material.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/resources/canvas_item_material.cpp b/scene/resources/canvas_item_material.cpp index 7ba57a6532..7501efea9e 100644 --- a/scene/resources/canvas_item_material.cpp +++ b/scene/resources/canvas_item_material.cpp @@ -30,6 +30,8 @@ #include "canvas_item_material.h" +#include "core/version.h" + Mutex CanvasItemMaterial::material_mutex; SelfList<CanvasItemMaterial>::List *CanvasItemMaterial::dirty_materials = nullptr; Map<CanvasItemMaterial::MaterialKey, CanvasItemMaterial::ShaderData> CanvasItemMaterial::shader_map; @@ -78,7 +80,10 @@ void CanvasItemMaterial::_update_shader() { //must create a shader! - String code = "shader_type canvas_item;\nrender_mode "; + // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). + String code = "// NOTE: Shader automatically converted from " VERSION_NAME " " VERSION_FULL_CONFIG "'s CanvasItemMaterial.\n\n"; + + code += "shader_type canvas_item;\nrender_mode "; switch (blend_mode) { case BLEND_MODE_MIX: code += "blend_mix"; |