Is CreateSprite() slow?

Blitz3D Forums/Blitz3D Programming/Is CreateSprite() slow?

Boiled Sweets(Posted 2003) [#1]
Is it too slow for game text?


HNPhan(Posted 2003) [#2]
yes, i suggest u use single surfaces created from quads or tris for this.


Boiled Sweets(Posted 2003) [#3]
erm but how?


Ross C(Posted 2003) [#4]
How do you use quads or how is it slow?


Boiled Sweets(Posted 2003) [#5]
Well, I am confused!

I have seen people say using DrawImage() is fine...

Is it? Its 2d right and some people say thats to be avoided.

CreateSprite creates a 3d entity, so is it not fast enought for a 3d FPS game?

Why are quads faster?

And how do I actually go about creating a quad and loading text into it?

These may seem like simple questions but its quite confusing getting varying suggestions. Basically I want to know whats the most effecient / preferred way of drawing text in a 3d world. I have a moving camera so I guess I parent them to the camera but placing them in a 3d world so that they are always top left say is a bit hit and miss is it not...

Thanks for all your help and guidance...


Ken Lynch(Posted 2003) [#6]
Dweezil, sprites are fine for FPS games. Some people like to use a "single surface" particle system because they believe it to be faster, though I personally have not seen any evidence of it on my system.

Calling them "Quads" is confusing because a quad mesh (that is a single flat square) is actually slower than a sprite.

Personally, if you are a beginner - stick to sprites, they are fine. They are more flexible than "single surface" systems and easier to use.


Gabriel(Posted 2003) [#7]
Dweezil, sprites are fine for FPS games. Some people like to use a "single surface" particle system because they believe it to be faster, though I personally have not seen any evidence of it on my system.


There are lots of demos around. Try one, and you'll soon see the difference. Tigerz, for example, has a demo of 10,000 particles. Think you could do that with Blitz sprites?

Calling them "Quads" is confusing because a quad mesh (that is a single flat square) is actually slower than a sprite.


No it isn't.

Personally, if you are a beginner - stick to sprites, they are fine. They are more flexible than "single surface" systems and easier to use.


They're not more flexible for the purpose Dweezil is asking about. They're slightly easier to use.



I highly recommend using a library for 3d Text. MasterBeaker's FonText is my library of choice. It's cheap, very fast and very flexible. It uses single surfaces for maximum speed, and you don't need to understand how single surfaces work to use it.

CyberSeth has a free lib floating around somewhere. I'm not certain if it's single surface, but plenty of people who've used it seem to love it.


Ross C(Posted 2003) [#8]
Well yeah, placing them is, but it should take you more than a couple of minutes to position them correctly. If you do decide to not use fonText then use createsprite once, then use copyentity on it to get as many sprites as you need. Bit faster.

You'll need to make all the numbers on the one texture, and use loadanimtexture, then just choose your frame of your number/letter.


Neo Genesis10(Posted 2003) [#9]
I dont get this... essentially all a sprite is IS a quad which has the option of always facing the camera. Why would using a sprite be any worse than quads??


Techlord(Posted 2003) [#10]
How do you create a quad in Blitz? I assume this is geometric unit consisting of 4 vertices unlike a triangle of 3 vertices.

I have only seen Blitz commands to create Triangles using vertices. I have seen demos, but, they too use two triangles to create whats refered to as 'quad'. A Blitz Sprite cosists of only two triangles as well.

I would like to use quads as well as I would expect some performance improvement considering only 1 quad/4 vertices resides in memory vs 2 triangles/6 vertices.

Single Surface Systems are great and can really shine when other processes are hogging memory resources.


Ross C(Posted 2003) [#11]
I'm pretty sure anyone who refers to making a quad in blitz is 4 vertexs/2 triangles.


Boiled Sweets(Posted 2003) [#12]
So...

I appear to have summoned the gurus to this thread but I'm now more confused than ever :-(

Before the conversation declines further into quads, tris and vertices can I just remind the gods of the original post?

What is my best (bearing in mind that I'm a beginner to B3D but still want good performance) option for displaying text on the screen in a FPS game? AND, how the hell do I go about doing it? Al I require is a couple of text fields i.e. "level x", "score xyz" and a health meter (perhaps I'll use a cube for that).

Many people have suggested FONText and similar libraries, yes they can create nice bitmaps of the font but then how do I use them and how do I know they are fastet then the 2d image stuff and / or the createsprite type functions.

Maybe I should email Mark?

Thanks once again.


Ross C(Posted 2003) [#13]
They will be faster than the 2d stuff, because some graphics cards don't like mixing 2d and 3d, so it's best for all if you use 3d. I'd use fontext. Keeps everything single surface and you don't need to understand completely how it works.

In my test, regarding quads versus sprites, the speed difference only started to show when they were ALOT of sprites on screen. I mean like 250-350 ish. So sprites vs Quads won't show a noticable difference unless there is alot of them.

Exaclty how you use them, i can't really answer cause i don't have FonText. But it won't be difficult.

But as i said, if you don't want to get FonText, then create an amiated texture with all your number on it then create a sprite and copy it for as many digits you want in your number. Then compare each digit of the number for the score and use the equivalent frame of the texture to texture the sprite.


Rob(Posted 2003) [#14]
I 100% endorse http://www.playerfactory.co.uk

Download and try FonTEXT on that site... it's written with Blitz source in mind, and is *THE* best 3D/sprite text solution I've ever used.


Ross C(Posted 2003) [#15]
dweezil, try this. I've written this in like 30 mins. It's just so you get the idea, but you can use it if you wish :o)

use the 1 and 2 keys to change the score :)

www.rosscrooks.pwp.blueyonder.co.uk/spritetext.zip


HNPhan(Posted 2003) [#16]
sorry to have been so fast on my post without going into detail. But the other member have answered the questions for it anyway, i use cyberseth's Text system for text which is very similar to FonText. it can be found at www.Blitzcoder.com in the showcase