Bowarc / chess_game

A multiplayer chess game made with ggez
1 stars 1 forks source link

About shaders with the current renderer #13

Open Bowarc opened 10 months ago

Bowarc commented 10 months ago

I belive that ggez shaders are per-canvas things so im gona base my idea of that fact.

What if, to keep current idea of layers but add shaders to specific render request bits we keep a mut ref of the current canvas, draw everything on it from far to near to preserve layers and when you hit a drawparam with a shader different than the one on the current canvas, you .finish current canvas and make the current canvas a new one with the given spcific shader.

Bowarc commented 10 months ago

To make it even more optimised we could group render request bits per shaders in the same layer

Bowarc commented 10 months ago

But what to do with shaders that require other canvases, like shadows?

Bowarc commented 7 months ago

The layered renderer is a good idea but

Ggez already does a lot of work similar to that (which isn't rly usable sadly), so maybe rewrite using a lower level rendrer.

The idea is good tho