As good as ID3DXSprite??

BlitzMax Forums/BlitzMax Beginners Area/As good as ID3DXSprite??

cbmeeks(Posted 2006) [#1]
Hey guys! Been a long time since I've been on.

I've got an engine in C++/DirectX and it uses the ID3DXSprite class.

My engine is for 2D only (using 3D hardware) and is quite fast.

My problem is that while I love C++, I also love BB (been a fan since the Amiga days). I want RAPID development of my projects. Life is too short to be spending time on some of this stuff. :-)

Anyway, my goal for a system is this:

1) 2D sprites with FAST, HARDWARE GPU support of rotation, alpha-blending, scaling, color tinting

2) Enough power to render a 320x240 screen with many many tiles. I am greedy. I want FOUR layers of tiles scrolling in 8-directions, 20-50 enemy sprites of good size and my main character. In other words, tons of sprites.

3) Good audio. I normally use FMOD so that shouldn't be a problem with BMAX.

Everything else should easily be handled but just about any engine. My C++ engine can do all those things now.

But once again, I am looking at something that saves time.

Using BlitzPlus a year ago, I did in two weeks what it took me three months to do in C++. Not because C++ is hard, but because of my time contraints.

I'm at work now to no playing but tonight I am going to download the demo and see what it can do. I would gladly shell out $80 for something that would do everything I need.

Thanks!
cbmeeks
http://metroidclassic.com


ImaginaryHuman(Posted 2006) [#2]
Just buy BlitzMax if you haven't already. All graphics are hardware accelerated 2D using the GPU. You probably wouldn't have much problem drawing four layers of tiles and 50 enemy sprites at a much higher resolution than 320x240 at 60Hz framerate .... with a reasonably popular low-mid range graphics card. It already supports rotation, alpha blending, scaling, realtime color tinting, and smooth-filtering.

Development in Max is pretty quick, it does even more for you than the old BlitzBasic used to do, ie is even higher level.


cbmeeks(Posted 2006) [#3]
thanks...can't wait to give it a try tonight.

now, if I use DirectX mode on Wintel, how does BM draw 2D objects? Textured quads?


Robert Cummings(Posted 2006) [#4]
Yup.


cbmeeks(Posted 2006) [#5]
hmm...I guess I will just have to see tonight...can't wait!

:-)


ImaginaryHuman(Posted 2006) [#6]
All images that it draws are textured quads as he said. They could just as easily be rotated in 3D as well.


cbmeeks(Posted 2006) [#7]
But I assume bmx does not use the ID3DXSprite interface?

If not, can that be added via a module or c++ dll????

That would rock so much...

cbmeeks


Kuron(Posted 2006) [#8]
Just a reminder, BMax doesn't support 2D. Everything is emulated 2D. You have your choice of using D3D7 or OpenGL.

To see the exact interface BMax is using for D3D, you should be able to tell that by looking at the source for the DX module.


cbmeeks(Posted 2006) [#9]
D3D7? Really? Oh man...that kinda sucks.

I mean, it will probably be "good enough" but I guess I am just spoiled with the ID3DXSprites...hmmm..

Well, the biggest advantage of the ID3DXSprite is that they are highly optimized and take advantage of batching, etc.


Kuron(Posted 2006) [#10]
Just a warning that the DX is much slower than OpenGL.


TomToad(Posted 2006) [#11]
I'm not exactly sure what ID3DXSprite is, but a cursory look through some web pages, it looks like it offers no more than BMax except that it's DX9 instead of DX7. "Good enough," is of course subjective. Generally you want to use the lesser interface that your application needs. If your app doesn't need anything more than what DX7 already provides, then there's no sense on using DX9, it'll only limit who can run your app. Believe it or not, B+ uses DX1, and since you seem happy with that except for alpha blending and rotation, then you should be just fine with BMax. DX7 handles alpha and rotation just fine through hardware.
Also, if you just HAVE to have DX9, it is possible to add it to BMax. BMax could be just as capable of running a D3D9Max2DDriver() as it is running a D3D7Max2DDriver(), the only thing is that BMax currently doesn't ship with one, so you'd have to write one, or find someone to write one for you. It shouldn't be too difficult to look through the D3D7 modules and convert them to work on D3D9.
Another thing to look at is sswift's sprite system. I don't own it, but it does look very impressive and the ones who have bought it seem very pleased.


cbmeeks(Posted 2006) [#12]
Kuron:

Where do you base that? I mean, I'm not challenging you or anything but just curious. Keep in mind I've never actually TRIED to see if DX is faster or not. :-/

TomToad:
ID3DXSprite is Microsoft's answer to textured quads. In the beginning, they were really slow. Now, they are extremely fast. So fast, that for 2D work, it would be extremely difficult to beat it. I pretty much takes a quad, batches it with few texture changes, etc. Now, HOW much faster it is than DX7 and textured quads? I don't know.

You are right about DX7 vs DX9 though. I mean, "good enough" for me would be DX7. My big problem is that I get diluted with having the latest-greatest that I sometimes miss the point. Oh, and you are also right about DX1, B+, and the common computer. If B+ had the 3D hardware support, I would have finished my project.

But, I am going to stop worrying about who runs what. I'm just going to simply see if bmx can do what *I* want.

Level A (Minimum specs):
Metroid-like game. One layer tile-screen, 320x240, 2-way scrolling, music, sounds, main character, 5-10 enemies.

Level B:
Super Metroid-like game. 1-3 layers including fog layer, transparent layers, 320x240, 8-way scrolling, 5-20 enemies, music, sounds, main character with special effects

Level C:
Metroid Zero Mission-like game or more. 1-4 layers including fog and transparent layers (for acid, lava, etc), 320x240, 8-way scrolling, 5-50 enemies, music, sounds main character with special effects

B+ can easily handle Level A. I assume bmx can too.
bmx can more than likely handle Level B but I will soon find out.

My C++ engine can do all three levels and more. BUT, I am shooting for Level B for Metroid Classic and if it really takes off, then we shall see about Level C

That was long-winded!
cbmeeks


Kuron(Posted 2006) [#13]
Where do you base that? I mean, I'm not challenging you or anything but just curious. Keep in mind I've never actually TRIED to see if DX is faster or not. :-/
With BMax, it isn't an opinion, its an established fact. OpenGL is much faster in BMax on the majority of cards. I don't know anybody in the community who would honestly dispute this.

ID3DXSprite is Microsoft's answer to textured quads.
I am going to guess that the main speed bost would come from id3dxsprite using immediate mode, where BMaxs D3D routines use retained mode?

If B+ had the 3D hardware support, I would have finished my project.
It does. B+ has 2D via 3D using OpenGL built in. ;c) It works perfect for canvases, but not graphics windows. However, it doesn't have any of the "3D" effects :c/


Dreamora(Posted 2006) [#14]
Weren't ID3DXSprite MS's answer to OpenGLs (or better NVidias) PointSprite extension?

I really would like to see a D3D9 driver for Max2D ... but my experience is somewhat to low to create one that would be faster than the current DX7 one. But as you have all sources and some DX9 stuff is already present in the modules ... it would perhaps be doable ...


cbmeeks(Posted 2006) [#15]
Ah...good answers. :-)

Not sure about the immediate vs retained mode. I just know ID3DXSprites are EASY in DX. Probably why I went that route.

I am definately going to see if bmx will work this weekend. I can't wait!


Nelvin(Posted 2006) [#16]
D3DXSprites are just a more easy way to draw textured quads using screencoords. There are modules allowing you to draw textured polys/quads (using your own UV coords so you can use subrects on a texture). So no connection to point sprites there.

If in some cases OpenGL is faster than DX then it might just be because it's better batching the single draw calls which is what BMax does pretty bad in terms of driver calls (batching your quads using one of the texture mods should be a no brainer).

But to be honest - the game you want to do in such a low resolution would be easy to do using softwarerendering on a >= 200-300Mhz CPU I'm sure you won't be limited by whatever language/way to draw/engine you use so I guess you'll be happy coding your game after that the weekend ;-)


cbmeeks(Posted 2006) [#17]

But to be honest - the game you want to do in such a low resolution would be easy to do using softwarerendering on a >= 200-300Mhz CPU I'm sure you won't be limited by whatever language/way to draw/engine you use so I guess you'll be happy coding your game after that the weekend ;-)



That's the conclusion I have come to. Sometimes I can't see the forest for the trees...or something like that. :-)

-cb


ImaginaryHuman(Posted 2006) [#18]
I think you should try doing something in BlitzMax first to see for yourself what the speed is like. It seems like you're suffering from being `new to it` and instead of finding out, are asking questions of other people. I don't mean to be harsh by saying that - just that you need to see for yourself or you wont be convinced anyway.

In my opinion you will find that max can easily give you 4 layers of texturing plus 100's of enemies with sound and music no problem, so long as you have a sort of mid-range gfx card. I have an NVidea GeForce4 and would say that it could easily manage that kind of a game, in terms of the graphics throughput, and especially at such a low resolution. It could probably do it at 800x600.