Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Half-Pixel correction on prebuilt atlasses #164

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

berinhardt
Copy link
Contributor

Lets have a small texture (lets say under 10 px wide)
put it in a big atlas (1024x1024) somewhere in the middle
create a sprite with said texture and set its width to something big, maybe 500px
neigbour pixels of the atlas bleed into it
that's because the UV coords refer to the left border of the most left pixel and to the right border of the most right pixel of the texture
this pull request adresses this by imposing a halfpixel correction on AnimationFrame Generation time making the UVs point to the middle of those pixels

@frankinshtein
Copy link
Contributor

frankinshtein commented Aug 13, 2019

hi, have you tested examples/Demo/Pixel2Texel?
it should not break

@berinhardt
Copy link
Contributor Author

It only breaks with pregenerated atlases.
this pull request does not affect the texel2pixel

@frankinshtein
Copy link
Contributor

frankinshtein commented Aug 13, 2019

Demo has .bat files to prebuild atlasses, and if your code breaks it then it can't be merged

…a per resource basis

[Feature] compiling with -DENABLE_HPC makes true the hpc default for all 
pregenerated atlases
@berinhardt
Copy link
Contributor Author

berinhardt commented Aug 14, 2019

Ok, remade it so it doesnt break the texel2pixel demo.

on any image you can now add hpc="true/false" in it's xml and it will enable/disable this correction to it.

you can compile with -DFORCE_HPC and it will enable it by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants