#Tilemap texture shader not pixel perfect
1 messages · Page 1 of 1 (latest)
texture padding tileset property converts the texture when it's loaded. A 128x tilemap with 16x tiles secretly becomes a 144x with 18x tiles. Equivalent of exporting a tileset with a 1 pixel inner extrude.
can I change this padding property? Or should I export my tilesheets with padding?
hmmm..
The tileset settings would be margin=1,1;spacing=2,2;padding=false if you want to provide it with a pre-extruded tileset.
Disabling padding altogether is an option if you can guarantee the tilemaplayer and camera will never stray from the viewport's pixel grid. Considering the shader is asking for mipmapping, that's probably not the case!
It warns me about bleeding in reference to texture padding, do you know what cases would cause bleeding when disabled? it seems fine..
Wrote a script to align to viewport pixels, it looks a little snappy but honestly that might be fine as long as this works
Don't need a script, there's project settings for that, set:
rendering/2d/snap/snap_2d_transforms_to_pixel = true
(Make sure it's not snap_2d_vertices_to_pixel)
And setting the scale mode = viewport will lock the viewport size to the project resolution. (A retro Super Nintendo style game might have resolution = 320x240 scale_mode = viewport)