{"action":"opened","issue":{"url":"https://api.github.com/repos/PixarAnimationStudios/USD/issues/616","repository_url":"https://api.github.com/repos/PixarAnimationStudios/USD","labels_url":"https://api.github.com/repos/PixarAnimationStudios/USD/issues/616/labels{/name}","comments_url":"https://api.github.com/repos/PixarAnimationStudios/USD/issues/616/comments","events_url":"https://api.github.com/repos/PixarAnimationStudios/USD/issues/616/events","html_url":"https://github.com/PixarAnimationStudios/USD/issues/616","id":359611794,"node_id":"MDU6SXNzdWUzNTk2MTE3OTQ=","number":616,"title":"Incorrect Pick ID calculate in OpenGL RefEngine","user":{"login":"nathanquirl","id":1806314,"node_id":"MDQ6VXNlcjE4MDYzMTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1806314?v=4","gravatar_id":"","url":"https://api.github.com/users/nathanquirl","html_url":"https://github.com/nathanquirl","followers_url":"https://api.github.com/users/nathanquirl/followers","following_url":"https://api.github.com/users/nathanquirl/following{/other_user}","gists_url":"https://api.github.com/users/nathanquirl/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanquirl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanquirl/subscriptions","organizations_url":"https://api.github.com/users/nathanquirl/orgs","repos_url":"https://api.github.com/users/nathanquirl/repos","events_url":"https://api.github.com/users/nathanquirl/events{/privacy}","received_events_url":"https://api.github.com/users/nathanquirl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-12T19:03:35Z","updated_at":"2018-09-12T19:03:35Z","closed_at":null,"author_association":"NONE","body":"### Description of Issue\r\nOn macOS when using the OpenGL engine in Hydra, the TestIntersection method does not return a path to a picked object. When running the usdview example app, on macOS, picking does not appear to be working.\r\n\r\nHydra appears to be using the fallback RefEngine implementation on macOS due to it's older OpenGL implementation. When unpacking a pick ID from a buffer color, one component is set to 1 which appears to be causing the wrong integer value to be calculated. When this incorrect value is passed to the path mapping method, it is unable to find a valid shape path.\r\n\r\nRecommended changes:\r\n\r\nChange primIdColor[3] = 1; \r\n\r\nto \r\n\r\nprimIdColor[3] = ((float)((primId & 0xff000000) >> 24)) / 255.0f;\r\n\r\nIn this method in RefEngine.h:\r\n\r\nstatic GfVec4f Unpack(ValueType primId) {\r\n            GfVec4f primIdColor;                                                     \r\n            // Convert the instance Id into an rbg color. We could potentially\r\n            // use alpha if we want to extend the range.\r\n            primIdColor[0] = ((float)((primId & 0x000000ff) >>  0)) / 255.0f;\r\n            primIdColor[1] = ((float)((primId & 0x0000ff00) >>  8)) / 255.0f;\r\n            primIdColor[2] = ((float)((primId & 0x00ff0000) >> 16)) / 255.0f;\r\n            primIdColor[3] = 1;\r\n\r\n            return primIdColor;\r\n        }\r\n\r\nAlso update relevant Pack method.\r\n\r\nChange occurrences of:\r\n\r\nglColorPointer(3, GL_FLOAT, 0, (GLvoid*)offset); to glColorPointer(4, GL_FLOAT, 0, (GLvoid*)offset);\r\n\r\nto:\r\n\r\nglColorPointer(4, GL_FLOAT, 0, (GLvoid*)offset); to glColorPointer(4, GL_FLOAT, 0, (GLvoid*)offset);\r\n\r\nin RefEngine.cpp\r\n\r\nI ran a test with these changes and it appeared to fix the issue. I can submit a pull request with this fix if no one else is working on it.\r\n\r\n### Steps to Reproduce\r\n1. Run usdview on macOS\r\n2: Observer picking behavior \r\n\r\n### System Information (OS, Hardware)\r\nmacOS High Sierra (10.13.6)\r\nMacbook Pro (15-inch, 2017)\r\n2.9 Ghz Intel Core i7, 16GB\r\nRadeon Pro 560 \r\n\r\n### Package Versions\r\nPython 2.7\r\n\r\n### Build Flags\r\nPython enabled\r\nOpenGL enabled\r\nImaging enabled"}}
{"actor":{"display_login":"nathanquirl"}}