# \[Chapter 12: Render Passes\] Object selection

**URL:** <https://forums.kodeco.com/t/chapter-12-render-passes-object-selection/182699>\
**Category:** Metal by Tutorials\
**Created:** [January 13, 2023, 2:58am UTC](https://forums.kodeco.com/t/chapter-12-render-passes-object-selection/182699 "2023-01-13T02:58:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![caroline](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/caroline/32/111867_2.png) [@caroline](https://forums.kodeco.com/u/caroline)\
**Post date:** [January 14, 2023, 11:58pm UTC](https://forums.kodeco.com/t/chapter-12-render-passes-object-selection/182699/2 "2023-01-14T23:58:29Z")

</div>

Hi @armorix and welcome to the forums 🙂 !

I’m afraid I don’t have a non-Apple Silicon device any more to test it 😒

However, this could be related to the scale factor of the device not being x2 (although I thought the MacBook Pro i9 is x2), which I failed to take into account. If you try out the app on iPhone Pro Max, which has a scale factor of 3, it doesn’t work either.

This thread has the code to fix the problem:

> [@Question about input coordinates in fragment shader](https://forums.kodeco.com/t/question-about-input-coordinates-in-fragment-shader/179791):
>
> I am working along Chapter 12: Render Passes. Towards the end, when we pass the ID Texture that is the result of rendering to a render pass with an r32Uint texture as color attachment 0, I see this fragment shader snippet that determines wether an object has been clicked by checking the ID against the .r value encoded in the texture: if (!is\_null\_texture(idTexture)) { uint2 coord = uint2(params.touchX \* 2, params.touchY \* 2); uint objectID = idTexture.read(coord).r; if (params.objectId !=…

---

_[View the full topic](https://forums.kodeco.com/t/chapter-12-render-passes-object-selection/182699)._
