summaryrefslogtreecommitdiff
path: root/servers/rendering/rasterizer_rd/shaders/canvas.glsl
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2020-12-01 22:40:47 -0300
committerreduz <reduzio@gmail.com>2020-12-02 13:07:59 -0300
commit70f5972905a5ea6916e9aab909f9a34b963f67b1 (patch)
treef9bca7f6950e8a69fd61c0ea8b341a4976accb80 /servers/rendering/rasterizer_rd/shaders/canvas.glsl
parent3beab2646fa8744a84382d9fcfb73848404fe5b5 (diff)
Refactored Mesh internals and formats.
-Changed how mesh data is organized, hoping to make it more efficient on Vulkan and GLES. -Removed compression, it now always uses the most efficient format. -Added support for custom arrays (up to 8 custom formats) -Added support for 8 weights in skeleton data. -Added a simple optional versioning system for imported assets, to reimport if binary is newer -Fixes #43979 (I needed to test) WARNING: -NOT backwards compatible with previous 4.x-devel, will most likely never be, but it will force reimport scenes due to version change. -NOT backwards compatible with 3.x scenes, this will be eventually re-added. -Skeletons not working any longer, will fix in next PR.
Diffstat (limited to 'servers/rendering/rasterizer_rd/shaders/canvas.glsl')
-rw-r--r--servers/rendering/rasterizer_rd/shaders/canvas.glsl7
1 files changed, 5 insertions, 2 deletions
diff --git a/servers/rendering/rasterizer_rd/shaders/canvas.glsl b/servers/rendering/rasterizer_rd/shaders/canvas.glsl
index 51d7193a03..7808e7ed52 100644
--- a/servers/rendering/rasterizer_rd/shaders/canvas.glsl
+++ b/servers/rendering/rasterizer_rd/shaders/canvas.glsl
@@ -9,7 +9,8 @@ layout(location = 0) in vec2 vertex_attrib;
layout(location = 3) in vec4 color_attrib;
layout(location = 4) in vec2 uv_attrib;
-layout(location = 6) in uvec4 bones_attrib;
+layout(location = 10) in uvec4 bone_attrib;
+layout(location = 11) in vec4 weight_attrib;
#endif
@@ -61,6 +62,7 @@ void main() {
color = vec4(unpackHalf2x16(draw_data.colors[4]), unpackHalf2x16(draw_data.colors[5]));
}
uvec4 bones = uvec4(0, 0, 0, 0);
+ vec4 bone_weights = vec4(0.0);
#elif defined(USE_ATTRIBUTES)
@@ -68,7 +70,8 @@ void main() {
vec4 color = color_attrib;
vec2 uv = uv_attrib;
- uvec4 bones = bones_attrib;
+ uvec4 bones = bone_attrib;
+ vec4 bone_weights = weight_attrib;
#else
vec2 vertex_base_arr[4] = vec2[](vec2(0.0, 0.0), vec2(0.0, 1.0), vec2(1.0, 1.0), vec2(1.0, 0.0));