tophat2d / tophat

:tophat: a 2d game library for Umka
https://tophat2d.dev
BSD 3-Clause "New" or "Revised" License
67 stars 5 forks source link

ske: One draw call renderer. #135

Open marekmaskarinec opened 5 months ago

marekmaskarinec commented 5 months ago

Original issue:

~mrms/tophat#41

Initial message:

The one draw call renderer should stop web version and desktop versions from lagging/overloading the computer, it should especially optimize the main problem tophat has, which is switching textures and scissor rects. Scissor rects will be implemented via shaders now, which reduces complexity of switching between draw calls. I might need some help. One important part of this technique is to pack images into one atlas image since you can't attach much more than a few textures per draw call.

marekmaskarinec commented 4 months ago

If I understand correctly, you want to implement scissor rects inside shaders now. Do we pass them as attributes (a lot of data, but few draw calls), or as uniforms (less data, more draw calls).