{"action":"created","issue":{"url":"https://api.github.com/repos/GoranM/bdx/issues/436","labels_url":"https://api.github.com/repos/GoranM/bdx/issues/436/labels{/name}","comments_url":"https://api.github.com/repos/GoranM/bdx/issues/436/comments","events_url":"https://api.github.com/repos/GoranM/bdx/issues/436/events","html_url":"https://github.com/GoranM/bdx/issues/436","id":106141027,"number":436,"title":"Bdx.matShaders.put Object disappears from view.","user":{"login":"slightfx","id":1431648,"avatar_url":"https://avatars.githubusercontent.com/u/1431648?v=3","gravatar_id":"","url":"https://api.github.com/users/slightfx","html_url":"https://github.com/slightfx","followers_url":"https://api.github.com/users/slightfx/followers","following_url":"https://api.github.com/users/slightfx/following{/other_user}","gists_url":"https://api.github.com/users/slightfx/gists{/gist_id}","starred_url":"https://api.github.com/users/slightfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slightfx/subscriptions","organizations_url":"https://api.github.com/users/slightfx/orgs","repos_url":"https://api.github.com/users/slightfx/repos","events_url":"https://api.github.com/users/slightfx/events{/privacy}","received_events_url":"https://api.github.com/users/slightfx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-12T08:21:25Z","updated_at":"2015-09-12T09:14:14Z","closed_at":null,"body":"Hi \r\nWhen I use the shader on the scene it works.\r\nscene.filters.add(ShaderProgram.load(\"bdx/shaders/2d/default.vert\", \"bdx/shaders/2d/bloom.frag\"));\r\n\r\nBut when I apply this shader to a material, the object disappears from the scene.\r\nBdx.matShaders.put(\"Material1\", ShaderProgram.load(\"bdx/shaders/2d/default.vert\", \"bdx/shaders/2d/bloom.frag\"));\r\n\r\nI'm on a mac book air, so the opengl is a bit old :) could this be the problem?\r\nOr do I need to set the material to something special?"},"comment":{"url":"https://api.github.com/repos/GoranM/bdx/issues/comments/139742205","html_url":"https://github.com/GoranM/bdx/issues/436#issuecomment-139742205","issue_url":"https://api.github.com/repos/GoranM/bdx/issues/436","id":139742205,"user":{"login":"SolarLune","id":4733521,"avatar_url":"https://avatars.githubusercontent.com/u/4733521?v=3","gravatar_id":"","url":"https://api.github.com/users/SolarLune","html_url":"https://github.com/SolarLune","followers_url":"https://api.github.com/users/SolarLune/followers","following_url":"https://api.github.com/users/SolarLune/following{/other_user}","gists_url":"https://api.github.com/users/SolarLune/gists{/gist_id}","starred_url":"https://api.github.com/users/SolarLune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SolarLune/subscriptions","organizations_url":"https://api.github.com/users/SolarLune/orgs","repos_url":"https://api.github.com/users/SolarLune/repos","events_url":"https://api.github.com/users/SolarLune/events{/privacy}","received_events_url":"https://api.github.com/users/SolarLune/received_events","type":"User","site_admin":false},"created_at":"2015-09-12T09:14:14Z","updated_at":"2015-09-12T09:14:14Z","body":"The problem is that 2D filter shader files aren't made for materials (3D objects) - that's why they're in (or will be in) different folders (shaders/2D for screen shaders, shaders/3D for material shaders), and that's why they won't work for materials. \r\n\r\nThis is kind of an interesting problem, because running bloom probably means you want the light to bleed beyond the edges of the model, most likely, but running the shader just on the model itself wouldn't actually do that (because running a shader on the model's material would just make it run on the drawing of the model, so it wouldn't extend past the model's edges). \r\n\r\nIt seems like the best way to do this might be to do something with offscreen rendering (draw the model you want bloomed elsewhere offscreen, in \"space\" with nothing else around, and then take that \"screenshot\" and draw it on top of the screen with the desired bloom effect). That might be something we can look into at some point."}}