{"action":"opened","issue":{"url":"https://api.github.com/repos/defold/editor2-issues/issues/1979","repository_url":"https://api.github.com/repos/defold/editor2-issues","labels_url":"https://api.github.com/repos/defold/editor2-issues/issues/1979/labels{/name}","comments_url":"https://api.github.com/repos/defold/editor2-issues/issues/1979/comments","events_url":"https://api.github.com/repos/defold/editor2-issues/issues/1979/events","html_url":"https://github.com/defold/editor2-issues/issues/1979","id":334744923,"node_id":"MDU6SXNzdWUzMzQ3NDQ5MjM=","number":1979,"title":"Editor does not always use correct shader program alpha?","user":{"login":"subsoap","id":409170,"node_id":"MDQ6VXNlcjQwOTE3MA==","avatar_url":"https://avatars2.githubusercontent.com/u/409170?v=4","gravatar_id":"","url":"https://api.github.com/users/subsoap","html_url":"https://github.com/subsoap","followers_url":"https://api.github.com/users/subsoap/followers","following_url":"https://api.github.com/users/subsoap/following{/other_user}","gists_url":"https://api.github.com/users/subsoap/gists{/gist_id}","starred_url":"https://api.github.com/users/subsoap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subsoap/subscriptions","organizations_url":"https://api.github.com/users/subsoap/orgs","repos_url":"https://api.github.com/users/subsoap/repos","events_url":"https://api.github.com/users/subsoap/events{/privacy}","received_events_url":"https://api.github.com/users/subsoap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-22T04:53:36Z","updated_at":"2018-06-22T04:53:36Z","closed_at":null,"author_association":"NONE","body":"Engine is right, editor is not\r\n\r\n![2018-06-21 21_52_30-window](https://user-images.githubusercontent.com/409170/41758440-81bbdf22-759d-11e8-8bbf-9a9486b68883.png)\r\n\r\n![2018-06-21 21_52_17-newshadertests](https://user-images.githubusercontent.com/409170/41758441-81d2550e-759d-11e8-8851-38372739f5f3.png)\r\n\r\n```\r\nvarying mediump vec2 var_texcoord0;\r\n\r\nuniform lowp sampler2D DIFFUSE_TEXTURE;\r\nuniform lowp sampler2D MASK;\r\nuniform lowp sampler2D COLOR;\r\nuniform lowp vec4 tint;\r\nuniform lowp vec4 time;\r\n\r\nvoid main()\r\n{\r\n    // Pre-multiply alpha since all runtime textures already are\r\n    lowp vec4 tint_pm = vec4(tint.xyz * tint.w, tint.w);\r\n    mediump vec2 mask_uv = vec2(var_texcoord0.x, var_texcoord0.y );\r\n    mediump vec2 var_texcoord1 = vec2(var_texcoord0.x * 0.5, (var_texcoord0.y + 200.0) * 0.5  + time.x * 1.4 );\r\n    mediump vec2 var_texcoord2 = vec2(var_texcoord0.x * 2.0, (var_texcoord0.y + 200.0) * 2.0  + time.x * 1.4 );\r\n    mediump vec2 var_texcoord3 = vec2(var_texcoord0.x, (var_texcoord0.y + time.x));\r\n    vec4 alpha = texture2D(MASK, mask_uv);\r\n    vec4 mask = (alpha * (texture2D(DIFFUSE_TEXTURE, var_texcoord3.xy) * texture2D(DIFFUSE_TEXTURE, var_texcoord1.xy) * 2.0) * texture2D(DIFFUSE_TEXTURE, var_texcoord2.xy) * 2.0 * texture2D(MASK, mask_uv.xy)).xxxx;\r\n\r\n    gl_FragColor = texture2D(COLOR, var_texcoord1) * mask;\r\n\r\n}\r\n\r\n```"}}
{"actor":{"display_login":"subsoap"}}