Nacheitor Posted February 6, 2018 Share Posted February 6, 2018 Hi, I have a doubt. Would it be possible to share information between fragment shaders? I would like to have a buffer to share information between the different fragment shaders that affect a pixel of the final rendering of the scene. And in the end of the rendering cycle, clean all that information for the next rendering cycle. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 6, 2018 Share Posted February 6, 2018 that is possible by second material in render target and use postprocess https://www.babylonjs-playground.com/#1HECPU#5 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 6, 2018 Share Posted February 6, 2018 Another example: http://www.babylonjs.com/demos/customrendertarget/ NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Nacheitor Posted February 6, 2018 Author Share Posted February 6, 2018 I'm trying to do something like this: https://www.youtube.com/watch?time_continue=19&v=yECDO_l00rs If I have a buffer between fragments shaders, I could have a record of what has been rendered in each pixel and thus be able to decide what should be painted or not. For example, taking the video as example. If the back part of the cylinder is rendered first, then the back part of the sphere, the front part of the cylinder should be discarded. I don't know if I explain. I don't know how I could implement that with the examples you have given me ... I'm sorry but it's the first time I've worked with shaders. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 7, 2018 Share Posted February 7, 2018 you read this article i try make more sample Quote Link to comment Share on other sites More sharing options...
Nacheitor Posted February 7, 2018 Author Share Posted February 7, 2018 Has someone worked with Shader Storage Buffer Object (SSBO) in Babylon? Maybe that could be the solution... 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.