yankeeg Posted July 28, 2015 Share Posted July 28, 2015 Hello, I'm just starting with babylon and I was wondering if someone could enlighten me on the engine's flow. What I'm trying to achieve is: render the scene in half resolution on a rendertargettexture, using programs that output packed depth and color(in 2 channels YCoCg). This texture would then be used to extract bloom and ssao and produce a combined texture with these. Finally the scene will be rendered again in the back buffer in full resolution, switching programs to ones that make use of the ssao-bloom texture. My question is how should I go about doing that using the postprocessing pipeline? By peeking at scene render() I thought of overriding the babylon.depthrenderer but I think that would be too hacky. Any help would be appreciated Quote Link to comment Share on other sites More sharing options...
jahow Posted July 28, 2015 Share Posted July 28, 2015 Hey! Welcome on this forum. I made a small playground that will hopefully help you understand how BJS does things on this topic: http://www.babylonjs-playground.com/#DUCK2 What happens there is:I'm setting up a render target texture with POT dimensions, which is a downscaled version of the main buffer (reduced 8 times for clearer result)Also setting up a depth texture using the DepthRenderer (very useful)Wrapping all this in a custom post process, for which I had to write a fragment shader in an awkward series of concatenated strings because that's how we have to do it in the playground So, the upper tier of the screen is the main buffer, middle tier is downscaled buffer and lower tier is depth value. Some other things that may help:- BJS already has an SSAO implementation (stating the obvious just in case), as well as a blur post process- My example does not use the PostProcessRenderPipeline class from BJS, which can help you with more advanced PP effects; source here and documentation here PS: guys... please, take note of this playground ID. iiceman, NasimiAsl and jerome 3 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 28, 2015 Share Posted July 28, 2015 In the URL random string generator sometimes the "D" wins the toss, sometimes the "F" does...You just had a good luck Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 29, 2015 Share Posted July 29, 2015 @jahow: Best URL so far!!! Quote Link to comment Share on other sites More sharing options...
jahow Posted July 29, 2015 Share Posted July 29, 2015 Yeah, I think I'll do all my future PGs on this ID!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.