Add custom shader attributes to Canvas Item Shaders

This commit is contained in:
Giwayume 2023-12-27 15:58:50 -05:00
parent 13a0d6e9b2
commit bb83c4adec
10 changed files with 106 additions and 25 deletions

View file

@ -2562,6 +2562,9 @@ RendererCanvasRenderRD::RendererCanvasRenderRD() {
actions.renames["INSTANCE_ID"] = "gl_InstanceIndex";
actions.renames["VERTEX_ID"] = "gl_VertexIndex";
actions.renames["CUSTOM0"] = "custom0";
actions.renames["CUSTOM1"] = "custom1";
actions.renames["LIGHT_POSITION"] = "light_position";
actions.renames["LIGHT_DIRECTION"] = "light_direction";
actions.renames["LIGHT_IS_DIRECTIONAL"] = "is_directional";
@ -2583,6 +2586,8 @@ RendererCanvasRenderRD::RendererCanvasRenderRD() {
actions.usage_defines["LIGHT"] = "#define LIGHT_SHADER_CODE_USED\n";
actions.usage_defines["SPECULAR_SHININESS"] = "#define SPECULAR_SHININESS_USED\n";
actions.usage_defines["POINT_SIZE"] = "#define USE_POINT_SIZE\n";
actions.usage_defines["CUSTOM0"] = "#define CUSTOM0_USED\n";
actions.usage_defines["CUSTOM1"] = "#define CUSTOM1_USED\n";
actions.render_mode_defines["skip_vertex_transform"] = "#define SKIP_TRANSFORM_USED\n";
actions.render_mode_defines["unshaded"] = "#define MODE_UNSHADED\n";