Is single surface 2D really faster than normal 2D?

Blitz3D Forums/Blitz3D Programming/Is single surface 2D really faster than normal 2D?

Fry Crayola(Posted 2005) [#1]
I ask because I did a quick test. I tested my code using my single surface system, and I tested it using normal 2D drawing commands and the 2D commands resulted in a faster framerate.

Would it be my single surface code, or is there a certain point you can reach when adding vertices that can make the system run much slower?


TartanTangerine (was Indiepath)(Posted 2005) [#2]
I have done similar tests and 3d accelerated always comes out top - by a very long way.


Fry Crayola(Posted 2005) [#3]
So the problem seems to stem from my single surface code?

Which confuses me greatly as I don't see where I can optimise it. But then I'm not fantastic at this sort of thing.




Stevie G(Posted 2005) [#4]
Use a {codebox} mate!!

I'm pretty sure that for single surface when you get to around 3000 polys per surface it is more efficient to create another surface. For particle effects this is where emitters come in handy .. for me at least.


Fry Crayola(Posted 2005) [#5]
Ah, that'll be it then. I'll have to see if I end up creating that amount at some point (my tests were based on high numbers of objects on screen - more than I'd ever need).

Didn't know about codeboxes...


Bouncer(Posted 2005) [#6]
Are you rebuilding the surface every frame? it seems like it. It's faster to just move the vertices offscreen when deleting an object and move them back when creating a new one. Most of the time building the surface every frame is slower than just rendering the maximum amount of particles (where most of them are offscreen and not wasting fillrate anyway) every frame.


Fry Crayola(Posted 2005) [#7]
Well, the current project I'm working on is a GUI, so everything's always on-screen. However, I do think it could use optimisation in that I don't have to rebuild it unless something happens, because it always looks the same.

Can you remove triangles from a surface entirely?


TartanTangerine (was Indiepath)(Posted 2005) [#8]
The ClearSurface command allows you to remove either verts, tris or both.


Ross C(Posted 2005) [#9]
i wouldn't bother removing tris from your surface, unless your sure they ain't getting used, of you've added a large amount and don't need them again for a while. As bouncer says, just set their alpha to 0 so they aren't rendered.


jfk EO-11110(Posted 2005) [#10]
Comparing the speed of pseudo 2D and real 2d doesn't make much sense because speed isn't the reason why you would use pseudo 2D. The reasons may be: fast rotation, scaling, alpha-transparency and antialiasing.

Also, if you have multiple overlapping alphatransparent objects or Polies, it may become pretty slow even on fast cards.


Fry Crayola(Posted 2005) [#11]
Speed is the reason why I'm using it. My current GUI is dog slow on most machines when trying to DrawImage, so I'm switching to a 2D-in-3D system. It's not even graphically intensive, it's just a problem with drawing images on those machines.

The extra features are a nice plus, mind you...