0
votes

I want to draw a series of textures into METAL view in order to present a complete image. On a regular screen, the images are presented on exactly 1:1 scale (Meaning a 100x100 pixels texture will be presented in a 100x100 pixels square)

Drawing it on a retina display, will actually give me a 200x200 square.

Now, there may be 2 different approaches:

1) Generate entire image into 100x100 square and let Metal View to upscale it to 200x200 square - It works.

2) Upscale each texture and generate image directly into 200x200 square. Why to take this approach? Because some of the textures (Like texts) are generated dynamically, and can be generated in a better resolution. Something impossible if you take the first approach.

Unfortunately, in this approach, some ugly square is visible around each texture. I tried to play with sizes, clamp options etc, yet I could not find any solution. Any help would be highly appreciated!

Image from regular screen

Image from regular screen

Image from retina screen

Image from retina screen

1

1 Answers

1
votes

Found a solution. In Fragment shader, texture sampler was defined as:

constexpr sampler s = sampler(coord::normalized, address::repeat, filter::nearest);

instead of:

constexpr sampler s = sampler(coord::normalized, address::clamp_to_edge, filter::nearest);