Mojang Hardware Stats

I could do quite a lot more stuff with that extra CPU (not to mention another 10% sprite count).

Cas :slight_smile:

Just to play devils advocate for a moment, but wouldn’t this mean you’d only be able to render sprites? (ie. rectangles with a width/height/angle). Sure, some things (like nine patches) could be converted to sprites, but you’d loose the ability to have things like ribbons, curves, rings, circles, etc. You’d have to draw them in separate batches, which might mean further chopping up your geometry shader sprite batches heavily.

I’m not sure if the tradeoffs would overall be worth it. I suspect it might be highly scene dependent - I tend to have lots of non-sprite drawing, what about other people? Cas, are you faking things like your spotlights with rotated sprites?

For that case, you could simple disable the geometry shader, and render everything without any limitations…

Yes, that’s what I said by ‘you’d have to draw them in separate batches’.

oh… okey, I think that comes from libGDX, right? … Couldn’t now that. Have never used libGDX :slight_smile:

Spotlights n that are just rotated sprites. Special effects such as radar circles, lasers, strobes, targeting reticule animations, that’s done outside of the normal sprite rendering in a cunning sort of interleaving. It wouldn’t quite work the same way as is currently in the library (which uses a the same VBOs for sprite vertices as for the effects geometry) - I’d probably have to use a completely separate VBO to avoid all sorts of confusion.
Anyway, all moot, as not enough machine support geometry shaders yet.

Cas :slight_smile:

I’m sorry but I genuinely can’t parse that sentence. ??? ??? ???

@Orangy Tang
I think he refers to your “separate batches” thing. As in libgdx you can have multiple instances of SpriteBatch to draw on screen, which each one holds its own properties. Based on my 2 hours experience on lwjgl, you can’t do that except by popping and pushing property of GL.

[spoiler]Behold my post, prince is coming! ;D[/spoiler]

[quote]As in libgdx you can have multiple instances of SpriteBatch to draw on screen, which each one holds its own properties.
[/quote]
In this case a “batch” refers to sending geometry data to the GPU (e.g. VBO, vertex array, or glEnd). You need to flush the renderer and any currently accumulated sprites before you can change shaders. SpriteBatch may do this internally, just like it does whenever you give it a new texture. Having multiple SpriteBatch instances will not solve your problem.

There’s no need for you to flush anything - OpenGL drivers batch up the requests internally in a queue and execute them asynchronously. There’s still a pipeline stall server-side but that’s just because there has to be.

Cas :slight_smile: