serpent icon indicating copy to clipboard operation
serpent copied to clipboard

Set sampling per-texture-basis

Open ikeycode opened this issue 6 years ago • 3 comments

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 avatar Mar 09 '20 02:03 ikeycode

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 avatar Mar 09 '20 02:03 ikeycode

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

ikeycode avatar Mar 09 '20 02:03 ikeycode

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

ikeycode avatar Mar 09 '20 02:03 ikeycode