Hazel icon indicating copy to clipboard operation
Hazel copied to clipboard

Implemented Texture UVs Offset for SpriteComponent

Open lucho1 opened this issue 4 years ago • 1 comments

It follows the same implementation than texture tilling of #403

It also includes an extension of the scene serializer to read glm::vec2 (required for doing the serialization of the UVOffset variable, but I can change it to 2 separated floats)

Describe the issue

It's no issue actually, it's just a feature consisting on adding a vec2 acting as an X & Y offset for the UVs of a texture in the Texture shader, as it can be common in for sprites.

PR impact

List of related issues/PRs this will solve:

Impact Issue/PR
Issues this solves None
Other PRs this solves None

Additional context

I tested it on Windows 10 (my PC), I just loaded a square with a texture and works perfectly in my machine (including the save & load)

lucho1 avatar Feb 23 '21 19:02 lucho1

Overall, a good suggestion. In the future we'd probably want some UI to set offsets (so we could actually see the texture and maybe set a bounding box around the portion we want to use), however this is good for now. Definitely no additional vertex attributes for this though!

Please update/fix any merge conflicts and I'll merge it in. 🙂

TheCherno avatar Jun 28 '22 09:06 TheCherno