Hi, I'm still working on my Jabos project, currently on the rendering part to add lighting effects :
https://youtu.be/AzQpn7Ow65M?start=186At this point I'm drawing each frame bit by bit. Each kind of element to draw is a Vertex Array using UV coords to manage normals, drawn with its own shader to manage lights:
- stars
- atmosphere
- ocean background (necessary to mask the stars)
- ship parts
- ocean foreground (applied with a multiply blend mode)
- planet ground
I feel this is suboptimal as code managing lighting is duplicated in each shader and I'm facing few limitations for example in how light affects ocean. I'm thinking about switching to using a few render textures:
- base material colors
- normals
- environment kind (water, air, void)
And in one last step mix everything using a list of lights. Though I'm worried about the performance impact of drawing everything to 2 or 3 render textures each frame.
Is there a way to draw to several render textures in one shader call? Is that a standard way of doing things?