{"action":"created","issue":{"url":"https://api.github.com/repos/OSVR/OSVR-Unity/issues/99","labels_url":"https://api.github.com/repos/OSVR/OSVR-Unity/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/OSVR/OSVR-Unity/issues/99/comments","events_url":"https://api.github.com/repos/OSVR/OSVR-Unity/issues/99/events","html_url":"https://github.com/OSVR/OSVR-Unity/pull/99","id":123038450,"number":99,"title":"OnVRSurfaceCreated event for image effects","user":{"login":"DuFF14","id":10972018,"avatar_url":"https://avatars.githubusercontent.com/u/10972018?v=3","gravatar_id":"","url":"https://api.github.com/users/DuFF14","html_url":"https://github.com/DuFF14","followers_url":"https://api.github.com/users/DuFF14/followers","following_url":"https://api.github.com/users/DuFF14/following{/other_user}","gists_url":"https://api.github.com/users/DuFF14/gists{/gist_id}","starred_url":"https://api.github.com/users/DuFF14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DuFF14/subscriptions","organizations_url":"https://api.github.com/users/DuFF14/orgs","repos_url":"https://api.github.com/users/DuFF14/repos","events_url":"https://api.github.com/users/DuFF14/events{/privacy}","received_events_url":"https://api.github.com/users/DuFF14/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OSVR/OSVR-Unity/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-18T22:42:06Z","updated_at":"2015-12-19T05:15:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OSVR/OSVR-Unity/pulls/99","html_url":"https://github.com/OSVR/OSVR-Unity/pull/99","diff_url":"https://github.com/OSVR/OSVR-Unity/pull/99.diff","patch_url":"https://github.com/OSVR/OSVR-Unity/pull/99.patch"},"body":"One possible solution for: https://github.com/OSVR/OSVR-Unity/issues/75\r\n\r\nThis PR adds an event to VREye that fires when a VRSurface is created. Another object in the scene can subscribe to this event, and provide game-specific code in a callback function. This would be for adding image effects and other components that need to be copied to each camera in the scene. Example script and scene added, although there is not an included image effect demonstrated, just comments where that code would go."},"comment":{"url":"https://api.github.com/repos/OSVR/OSVR-Unity/issues/comments/165948750","html_url":"https://github.com/OSVR/OSVR-Unity/pull/99#issuecomment-165948750","issue_url":"https://api.github.com/repos/OSVR/OSVR-Unity/issues/99","id":165948750,"user":{"login":"ImperialPenguin","id":1819259,"avatar_url":"https://avatars.githubusercontent.com/u/1819259?v=3","gravatar_id":"","url":"https://api.github.com/users/ImperialPenguin","html_url":"https://github.com/ImperialPenguin","followers_url":"https://api.github.com/users/ImperialPenguin/followers","following_url":"https://api.github.com/users/ImperialPenguin/following{/other_user}","gists_url":"https://api.github.com/users/ImperialPenguin/gists{/gist_id}","starred_url":"https://api.github.com/users/ImperialPenguin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImperialPenguin/subscriptions","organizations_url":"https://api.github.com/users/ImperialPenguin/orgs","repos_url":"https://api.github.com/users/ImperialPenguin/repos","events_url":"https://api.github.com/users/ImperialPenguin/events{/privacy}","received_events_url":"https://api.github.com/users/ImperialPenguin/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T05:15:31Z","updated_at":"2015-12-19T05:15:31Z","body":"I've got image effects working using the instantiate method I mentioned above. It is slightly messy because by the time CreateSurface is called there have already been two gameobjects added as children to the tracker object that get duplicated as well (VRViewer and VREye). So those, along with the display controller need to be removed. I don't see a way around this since camera and its image effects need to be duplicated multiple times, so creating it before everything is setup would require passing that object through VRViewer to VREye, duplicating it, and then deleting that original after all the surfaces are created. That would be even messier. Another alternative would be to separate the display controller into its own gameobject and create the camera gameobject as a child of it. VRViewer and VREye would no longer be a child of the camera gameobject that needs to be duplicated. That would take a bit of reworking, would make the hierarchy view messier, and I'm not sure what other ramifications it may have.\r\n\r\nThere is a bit of a performance hit compared to TrinusVR when the image effects are added. That performance hit exists without them though, so I see no reason I shouldn't submit the changes once we decide the best way. It occurs because the image effects on the main camera are still processed. They don't take as much time as they normally would, but my project loses about 1ms to them. There are other areas where the time is lost rendering that camera as well. I'll have to do a deep profile to figure out what is going on. "}}