fix sprite render

This commit is contained in:
John Alanbrook 2024-06-19 18:52:41 -05:00
parent 35deec52ae
commit 7e851756de
3 changed files with 4 additions and 5 deletions

View file

@ -260,7 +260,7 @@ SpriteAnim.aseprite = function(path) {
var anims = {};
var frames = Array.isArray(data.frames) ? data.frames : Object.values(data.frames);
var f = 0;
if (data.meta.frameTags.length === 0) {
if (!data.meta.frameTags || data.meta.frameTags.length === 0) {
anims[0] = aseframeset2anim(frames, data.meta);
return anims;
}

View file

@ -275,12 +275,13 @@ render.shader_apply_material = function(shader, material = {})
var s = shader.fs.unimap[p];
shader_unisize[s.size](1, s.slot, material[p]);
}
if (!material.diffuse) return;
if ("diffuse_size" in shader.fs.unimap)
render.setuniv2(1, shader.fs.unimap.diffuse_size.slot, [material.diffuse.width, material.diffuse.height]);
if ("diffuse_size" in shader.vs.unimap)
render.setuniv2(0, shader.vs.unimap.diffuse_size.slot, [material.diffuse.width, material.diffuse.height]);
render.setuniv2(0, shader.vs.unimap.diffuse_size.slot, [material.diffuse.width, material.diffuse.height]);
}
render.sg_bind = function(shader, mesh = {}, material = {}, ssbo)

View file

@ -1,8 +1,6 @@
@block vert
uniform vec4 mixcolor;
uniform vec4 emissive;
uniform vec4 rect;
uniform vec2 offset;
uniform vec2 diffuse_size;
void vert()
{