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

Set sampling per-texture-basis #18

Open
ikeycode opened this issue Mar 9, 2020 · 3 comments
Open

Set sampling per-texture-basis #18

ikeycode opened this issue Mar 9, 2020 · 3 comments

Comments

@ikeycode
Copy link
Collaborator

ikeycode commented Mar 9, 2020

Right now we set MAG_POINT sampling universally - however this breaks non-pixel-perfect applications when scaling.

See with MAG_POINT
BeforeSamplingFix

And without MAG_POINT

AfterSamplingFix

It's a fairly quick fix, bgfx_set_texture should respect texture clamp/sampling via uint32_t.max, and in texture construction we should allow overriding the sampling. Make a clearly documented API on this one to avoid confusion.

@ikeycode
Copy link
Collaborator Author

ikeycode commented Mar 9, 2020

It should be pointed out that you're kinda stuck with MAG_POINT if using dense tilesheets - and ideally a logical scale should be used with MAG_POINT. This is perfect for 2d pixel art, tiled maps, etc, but not so great for more modern styles.

@ikeycode
Copy link
Collaborator Author

ikeycode commented Mar 9, 2020

Note both screenshots are at 1920x1080p fullscreen w/ vulkan, logical render size 1366x768.

@ikeycode
Copy link
Collaborator Author

ikeycode commented Mar 9, 2020

Also we need to stop abusing npow2 textures in our demos. >_>

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

No branches or pull requests

1 participant