BlackMojito Posted February 6, 2018 Share Posted February 6, 2018 With MRT support, we should be able to render directly color buffer, depth buffer, normal buffer in one pass. Is there a way to implement it? With ShaderMaterial, I can write whatever I want but how can I customize Babylonjs (scene, camera etc.) so that I can write to a MultiRenderTarget just as GeometryBufferRenderer? I really want to gain every millisecond in my app. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 6, 2018 Share Posted February 6, 2018 Yes no problem but it will only works on Webgl2 You can see how we deal with it here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Rendering/babylon.geometryBufferRenderer.ts Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted March 1, 2018 Author Share Posted March 1, 2018 On 2018/2/7 at 3:13 AM, Deltakosh said: Yes no problem but it will only works on Webgl2 You can see how we deal with it here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Rendering/babylon.geometryBufferRenderer.ts Hi @Deltakosh, I understand the mechanism. My question is actually how I can set the "default" output color buffer of the active scene camera to a MultiRenderTarget? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 1, 2018 Share Posted March 1, 2018 The geometryBufferRender can output position: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/geometry.fragment.fx Here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Rendering/babylon.geometryBufferRenderer.ts#L32 Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted March 3, 2018 Author Share Posted March 3, 2018 On 2018/3/2 at 12:35 AM, Deltakosh said: The geometryBufferRender can output position: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/geometry.fragment.fx Here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Rendering/babylon.geometryBufferRenderer.ts#L32 https://github.com/BabylonJS/Babylon.js/blob/afed8f2afe7226add444b6da0056a759f31ef82f/src/Rendering/babylon.geometryBufferRenderer.ts#L251 I meant...where can set a MRT attached to the active camera? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 5, 2018 Share Posted March 5, 2018 You should just need to enable geometryBuffer like here: https://github.com/BabylonJS/Babylon.js/blob/master/src/PostProcess/RenderPipeline/Pipelines/babylon.standardRenderingPipeline.ts#L184 Then you can get the gBuffer like here: https://github.com/BabylonJS/Babylon.js/blob/master/src/PostProcess/RenderPipeline/Pipelines/babylon.standardRenderingPipeline.ts#L444 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.