Skip to content

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

Open
berinhardt wants to merge 2 commits into
oxygine:masterfrom
berinhardt:Feature/HPCOnPrebuiltAtlasses
Open

[Feature] Half-Pixel correction on prebuilt atlasses#164
berinhardt wants to merge 2 commits into
oxygine:masterfrom
berinhardt:Feature/HPCOnPrebuiltAtlasses

Conversation

@berinhardt

Copy link
Copy Markdown
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

frankinshtein commented Aug 13, 2019

Copy link
Copy Markdown
Contributor

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

@berinhardt

Copy link
Copy Markdown
Contributor Author

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

@frankinshtein

frankinshtein commented Aug 13, 2019

Copy link
Copy Markdown
Contributor

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

berinhardt commented Aug 14, 2019

Copy link
Copy Markdown
Contributor Author

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