{"action":"created","issue":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/10126","repository_url":"https://api.github.com/repos/highfidelity/hifi","labels_url":"https://api.github.com/repos/highfidelity/hifi/issues/10126/labels{/name}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/10126/comments","events_url":"https://api.github.com/repos/highfidelity/hifi/issues/10126/events","html_url":"https://github.com/highfidelity/hifi/pull/10126","id":219367361,"number":10126,"title":"Fixing the rendering of Image3D overlay when drawn in the scene","user":{"login":"samcake","id":2230265,"avatar_url":"https://avatars1.githubusercontent.com/u/2230265?v=3","gravatar_id":"","url":"https://api.github.com/users/samcake","html_url":"https://github.com/samcake","followers_url":"https://api.github.com/users/samcake/followers","following_url":"https://api.github.com/users/samcake/following{/other_user}","gists_url":"https://api.github.com/users/samcake/gists{/gist_id}","starred_url":"https://api.github.com/users/samcake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samcake/subscriptions","organizations_url":"https://api.github.com/users/samcake/orgs","repos_url":"https://api.github.com/users/samcake/repos","events_url":"https://api.github.com/users/samcake/events{/privacy}","received_events_url":"https://api.github.com/users/samcake/received_events","type":"User","site_admin":false},"labels":[{"id":314155368,"url":"https://api.github.com/repos/highfidelity/hifi/labels/Development%20Approved","name":"Development Approved","color":"009800","default":false},{"id":313595519,"url":"https://api.github.com/repos/highfidelity/hifi/labels/QA%20Ready","name":"QA Ready","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-04-04T20:07:10Z","updated_at":"2017-04-05T19:21:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/10126","html_url":"https://github.com/highfidelity/hifi/pull/10126","diff_url":"https://github.com/highfidelity/hifi/pull/10126.diff","patch_url":"https://github.com/highfidelity/hifi/pull/10126.patch"},"body":"This PR addresses this bug:\r\nhttps://highfidelity.fogbugz.com/f/cases/3471/image3d-overlays-show-up-as-a-solid-color-unless-using-drawInFront-true\r\n\r\nTHe image 3D overlay were not rendered correctly when drawn in the scene depth (not in front).\r\nwe fixed and introduced specific shaders for these particular RenderItem::ShapeKey (non material, unlit or not, translucent or not) to address these in the main rendering pipeline (opaque and transparent)\r\n\r\nTHis code may have side effects to be tested for for any object that use the same pipeline (triggered form the same REnderItem:ShapeKey). As of now, I don't know which could they be...\r\n\r\n## TEST PLAN\r\nTHis PR can be tested by triggering the following script in master and in this PR and compare\r\nHere is the script code to test (which can be copy pasted in the js console):\r\n```\r\n(function() { // BEGIN LOCAL_SCOPE\r\n    var pos1 = MyAvatar.position;\r\n    pos1.z = pos1.z - 1.0;\r\n    pos1.x = pos1.x + 1.0;\r\n    var pos2 = MyAvatar.position;\r\n    pos2.z = pos2.z - 1.0;\r\n    pos2.x = pos2.x - 1.0;\r\n    var pos3 = MyAvatar.position;\r\n    pos3.z = pos3.z - 1.0;\r\n    pos3.x = pos3.x - 3.0;\r\n    var pos4 = MyAvatar.position;\r\n    pos4.z = pos4.z - 1.0;\r\n    pos4.x = pos4.x - 5.0;\r\n\r\n    var pos1o = MyAvatar.position;\r\n    pos1o.z = pos1o.z - 3.0;\r\n    pos1o.x = pos1o.x + 1.0;\r\n\r\n    var pos2o = MyAvatar.position;\r\n    pos2o.z = pos2o.z - 3.0;\r\n    pos2o.x = pos2o.x - 1.0;\r\n\r\n    var pos3o = MyAvatar.position;\r\n    pos3o.z = pos3o.z - 3.0;\r\n    pos3o.x = pos3o.x - 3.0;\r\n\r\n    var pos4o = MyAvatar.position;\r\n    pos4o.z = pos4o.z - 3.0;\r\n    pos4o.x = pos4o.x - 5.0;\r\n\r\n\tOverlays.addOverlay(\"image3d\", { url: \"https://img.clipartfest.com/cdfbafa8c9607f1cfd243bc0f1ae98ca_leftarrow-arrow_500-375.jpeg\", position: pos1 });\r\n\r\n\tOverlays.addOverlay(\"image3d\", { url: \"https://img.clipartfest.com/cdfbafa8c9607f1cfd243bc0f1ae98ca_leftarrow-arrow_500-375.jpeg\", position: pos2, emissive: true });\r\n\r\n\tOverlays.addOverlay(\"image3d\", { url: \"https://img.clipartfest.com/cdfbafa8c9607f1cfd243bc0f1ae98ca_leftarrow-arrow_500-375.jpeg\", position: pos3, alpha: \"1.0\" });\r\n\r\n\tOverlays.addOverlay(\"image3d\", { url: \"https://img.clipartfest.com/cdfbafa8c9607f1cfd243bc0f1ae98ca_leftarrow-arrow_500-375.jpeg\", position: pos4, emissive: true, alpha: \"1.0\" });\r\n\r\n\r\n\tOverlays.addOverlay(\"image3d\", { url: \"https://img.clipartfest.com/cdfbafa8c9607f1cfd243bc0f1ae98ca_leftarrow-arrow_500-375.jpeg\", position: pos1o, drawInFront: true });\r\n\r\n\tOverlays.addOverlay(\"image3d\", { url: \"https://img.clipartfest.com/cdfbafa8c9607f1cfd243bc0f1ae98ca_leftarrow-arrow_500-375.jpeg\", position: pos2o, drawInFront: true, emissive: true });\r\n    \r\n\tOverlays.addOverlay(\"image3d\", { url: \"https://img.clipartfest.com/cdfbafa8c9607f1cfd243bc0f1ae98ca_leftarrow-arrow_500-375.jpeg\", position: pos3o, drawInFront: true, alpha: \"1.0\" });\r\n\r\n\tOverlays.addOverlay(\"image3d\", { url: \"https://img.clipartfest.com/cdfbafa8c9607f1cfd243bc0f1ae98ca_leftarrow-arrow_500-375.jpeg\", position: pos4o, drawInFront: true, emissive: true, alpha: \"1.0\" });\r\n \r\n   // Entities.addEntity( \r\n}());\r\n```\r\n\r\nTHis should show 2 rows of 4 image3d Overlays showing an horizontal arrow.\r\nThe front row are 4 overlays drawn in the scene depth (what we fixed).\r\nTHe back row are 4 overlays drawn in front (these are working correclty). \r\n\r\nIT should look correct in this pr\r\n![image](https://cloud.githubusercontent.com/assets/2230265/24676518/1d60c08c-1938-11e7-97e8-2566aee35808.png)\r\n\r\nthe front row is not rendering the texture correctly in current master\r\n![image](https://cloud.githubusercontent.com/assets/2230265/24676447/daaf9a92-1937-11e7-80b0-2af004ef7e4f.png)\r\n\r\nWe want to make sure that this pr doesn't break any other overlay (or something else that i may not know about) that is potentially using the same pipelines.\r\nThis should apply to typically overlays Not model, not drawn in front.\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/comments/291968269","html_url":"https://github.com/highfidelity/hifi/pull/10126#issuecomment-291968269","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/10126","id":291968269,"user":{"login":"Nex-Pro","id":7314019,"avatar_url":"https://avatars1.githubusercontent.com/u/7314019?v=3","gravatar_id":"","url":"https://api.github.com/users/Nex-Pro","html_url":"https://github.com/Nex-Pro","followers_url":"https://api.github.com/users/Nex-Pro/followers","following_url":"https://api.github.com/users/Nex-Pro/following{/other_user}","gists_url":"https://api.github.com/users/Nex-Pro/gists{/gist_id}","starred_url":"https://api.github.com/users/Nex-Pro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nex-Pro/subscriptions","organizations_url":"https://api.github.com/users/Nex-Pro/orgs","repos_url":"https://api.github.com/users/Nex-Pro/repos","events_url":"https://api.github.com/users/Nex-Pro/events{/privacy}","received_events_url":"https://api.github.com/users/Nex-Pro/received_events","type":"User","site_admin":false},"created_at":"2017-04-05T19:21:12Z","updated_at":"2017-04-05T19:21:12Z","body":"Testing this now."}}
{"actor":{"display_login":"Nex-Pro"}}