#Resizing a sprite doesn't work as expected.

7 messages · Page 1 of 1 (latest)

fossil quiver
#

I'm rendering a sprite with a custom material, which means it has its own custom fragment shader that I wrote. For some reason though it refused the render if i make that entity's size only in x or y axises less than 0 (It works if both x and y is below 0). This doesn't change if I made my shader code as simple as just changing the color of the object, so I don't think this is related to shader code.

I added the code that I used to resize the entity, and there is also a video demonstration of whats happening.

#

In any case, here is the shader code.

open sequoia
#

I would guess having a scale like x: -1, y: 1 could result in the entity being 'flipped' in the sense of it being treated as facing away from the camera. No clue if that's accurate, but the "making both negative works fine" made me think it's probably flipping something for each negative axis.

#

If I'm right, the only fix I can think of would require re-ordering the vertices in the mesh for the negative cases, which I think would be more trouble than just keeping the scale positive and calculating the position differently for those cases.

#

or I've completely misunderstood what you're doing and am thinking of entirely the wrong problem

open sequoia
fossil quiver
#

I don't know if thats what I do, since I didn't really get what you meant there