Post

Replies

Boosts

Views

Activity

Reply to How can I get pixel coordinates in the fragment tile function?
After some searching, I found the answer to my question. We can use the following arguments: pixel_position_in_tile – (x, y) position of the fragment in the tile. pixels_per_tile – (width, height) of the tile in pixels. tile_index – 1D tile index. fragment FragmentIO my_fragment(FragmentIO i, ushort index [[tile_index]], ushort2 pixelPositionInTile [[pixel_position_in_tile]], ushort2 pixelPerTile [[pixels_per_tile ]]) { FragmentIO fragOut; return fragOut; }
Topic: Graphics & Games SubTopic: Metal Tags:
Mar ’25