Skip to content

Add padding to the atlas tiles#31

Merged
norman784 merged 2 commits into
masterfrom
add-padding-to-atlas-tiles
Jan 19, 2021
Merged

Add padding to the atlas tiles#31
norman784 merged 2 commits into
masterfrom
add-padding-to-atlas-tiles

Conversation

@norman784

Copy link
Copy Markdown
Owner

This seems to fix #23 (comment) and #27 (comment)

@QuantumEntangledAndy

QuantumEntangledAndy commented Jan 17, 2021

Copy link
Copy Markdown
Contributor

I see yes the artifacts were probably caused by rounding error moving the closest pixel to the one just outside side of the tile.

We could also have fixed this by added a 1 pixel border with color bleeding into this border.

@norman784

Copy link
Copy Markdown
Owner Author

So far the ellipsis 1e-5 seems to work in bevy and blender, could you check in amethyst?

We could also have fixed this by added a 1 pixel border with color bleeding into this border.

About this I'm not sure how to tackle the issue when we start using textures instead of solid colors, maybe stretch by one pixel the edges?

@QuantumEntangledAndy

QuantumEntangledAndy commented Jan 19, 2021

Copy link
Copy Markdown
Contributor

I was thinking

  • at init increase texture size by +2 per tile per dimension
  • adjust start xy to accomidate the extra pixels
  • When using the set pixels:
    • if pixel is being set at the edges copy pixel to the neighbouring border padding

It is not perfect but I suspect it will reduce the visibilty of artifacts.

I also expect your 1e-5 to help with textures too as long as we always work with whole square faces

@QuantumEntangledAndy

Copy link
Copy Markdown
Contributor

Without this PR:

Screenshot 2021-01-19 at 10 32 01

With this PR:

Screenshot 2021-01-19 at 11 54 25

@QuantumEntangledAndy

Copy link
Copy Markdown
Contributor

From the pink in the tree at the bottom right I think we are still getting color bleeding from somewhere

@QuantumEntangledAndy

Copy link
Copy Markdown
Contributor

I increased the pad size to 5e-2 and that tree is still pinkish:

  • pad: 5e-2

Screenshot 2021-01-19 at 12 22 18

@QuantumEntangledAndy

Copy link
Copy Markdown
Contributor

I have gone and added border pixels too please see #34

@norman784
norman784 merged commit c735bc3 into master Jan 19, 2021
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