I have a question about the G-buffer. The concept of it is understood and I even got it to work on another project of mine. However, the book only covers one shader (excluding the composition), which creates the train in base color and its shadow. In my project I have a scene with multiple shaders. Some with base colors, others with textures, and some water reflection/refraction, each with their own render. There will be many more other renders later as well. But, for now lets say i have 3 renders that completes the scene.
How do I get the whole scene in one G-buffer? I was thinking about rendering a G-buffer for each render, so i end up with 3 G-buffers. Then before the composition stage i combine them somehow (if correct, how would be the best way to tackle this while preserving depth?), and the final accumulated G-buffer is then send to the composition shader. Am I in the right direction? I have a feeling im over-complicating this a bit. Please let me know. Thank you.
ps. As this is my first post: I want thank the whole team that made this book. This book has helped me a lot and even kickstarted an idea i had for years. Totally my money’s worth!