interesting observation

Blitz3D Forums/Blitz3D Programming/interesting observation

jfk EO-11110(Posted 2010) [#1]
I just made a test. I was wondering if DX7,8 and 9 processes can run parallely on the same machine. While two DX7 processes can run without any problems, DX8 used to write into the texture of a running DX7 EXE. A simple test: a windowed blitz3d app with a spinning textured cube. Then DXDIAG.EXE is started and a Direct3D test is performed. After the DX8 test, the texture in the blitz window is altered (without to crash the blitz app).

Now, what's so special about that? If a DX8 app can write to the texture buffer of a blitz app, then in theory the blitz app may also write to the texture of a DX8 app. Now, how about some shaders that are perfomed by DX8 on a texture buffer that Blitz3D has access to? And if DX8 can do it, maybe DX9 too.

Not sure if this is possible on an OS with Ram protection and User prvilegs, such as XP and later. Any cpp cracks around?


D4NM4N(Posted 2010) [#2]
Possibly possible but i would not like to go there... at all :D


jfk EO-11110(Posted 2010) [#3]
I'm afraid someone has to "boldly go where noone has gone before". A Shader Extension for Blitz3D would be really amazing. And since a rewrite of Blitz3D is unlikely to happen, and DX7 has no shaders at all - why not?


Zethrax(Posted 2010) [#4]
Sounds like it's time to move on to another 3D engine, JFK.

Even if you did manage to get this working in Blitz3D, I can see this being a compatibility nightmare when programs using it are released into the wild and are being used on different systems with all manner of funky hardware and driver combos.


Kryzon(Posted 2010) [#5]
I think it would be wasted effort - I don't doubt it's possible, but I think isn't worth it.
You would get much better results if you took that time to write a Blitz3D-perfect framework for an existing DX9\OpenGL engine.

Last edited 2010


Yasha(Posted 2010) [#6]
Not sure if this is possible on an OS with Ram protection and User prvilegs, such as XP and later.


1) What OS did you test this on?

2) What do we do to reproduce your results?

I'm mainly just curious.


jfk EO-11110(Posted 2010) [#7]
1) Test was made on 98se and XP sp2.

2) run a blitz3d textured spinning cube window (texture with 256 flag), then start DXDiag.exe

On 98se the texture is altered after the Dxdiag D3d8 test (parts of texture contain strange blocks). On XP it's altered already after the Dxdiag D3d7 test (entire texture becomes kind of blue, with strokes as if UVs are messed up).

On none of them the blitzapp however crashed, although the 256-texture was affected on both.

I don't know much about DirectX, is there any information about the legality of such coexisting version processes? And are DX7 texture buffers and DX8 texture buffers the same?

Last edited 2010


SLotman(Posted 2010) [#8]
Don't.

Even if it works on widowed mode, it won't on fullscreen - which is usually the 'exclusive mode' (a flag set upon initializing direct-X) - a dedicated mode that makes all resources availbable to your program, using just a bare minimum for windows to keep running on background. That's why fullscreen is usually faster than windowed mode.

Also, this will very likely cause memory leaks - imagine releasing a texture on B3D and not on the 'external program'; memory will be splitted by the two programs (at least memory for backbuffer, which is reserved on initializing DX)... too many problems, for too little gain: you also won't be able to run all shaders, shaders will be slower since there are other DX instances running, etc.

An no, DX7 "texture buffers' (more like DDSURFACE) isn't the same as DX8 - completly different data structures. You would have to pass some pointer to the actual data on DX7, create a new texture on DX8, copy it to this new texture, do whatever you want, and then transfer it back again to that pointer area. And somehow let B3D know you're done with it :P


jfk EO-11110(Posted 2010) [#9]
Ok, I see, you're right.


Xaron(Posted 2011) [#10]
I think Xors3D is worth to look at. It's almost BB3D with DX9 with some minor glitches.


jfk EO-11110(Posted 2011) [#11]
Thanks. As far as I remember I was highly convinced when I watched the features last time, but then dropped it because it wouldn't allow me to port my FPS engine to it due to license restrictions (no game construction kits allowed).

I am still looking around, and I was thinking about a thread "live after blitz" or so, discussing the engines that could be used to migrate as seamless as possible from b3d, but that probably would be respectless on this forum. As far as I know there is a Bltz3d Wrapper for OGRE, but for some reason it used to freeze my machine repeatedly. I see people talking about Unity, Shiva and more. I had a look on dbpro, but the poor docs make it a pain to some degree. I wonder how to RenderWorld or Flip in DBPro, but I would really prefere not to register at the forums and ask there :).


Xaron(Posted 2011) [#12]
jfk, actually I work on a cross platform engine with the full b3d command set. I use Irrlicht as rendering engine (so OpenGL, DX9 and software renderer are supported) and plan to use OpenAL for sound. But that's still in the beginning.

My main goal is to create something like BB3D 2.0 where you can use BB3D, BMax and C++ as programming language for the engine.

I asked about the need for that engine and the answers were quite disappointing as there's already Xors3D and Leadwerks. Anyway I think I'll do it even though it will take some time.

I just like the BB3D command set, it's the easiest to use I've ever seen.

Regarding Xors3D you're right. They don't allow the usage for game construction kits.

edit: Oh well my thread is located here: http://blitzbasic.com/Community/posts.php?topic=93107

Last edited 2011


SLotman(Posted 2011) [#13]
Try also miniB3D... it's great!


jfk EO-11110(Posted 2011) [#14]
Hi Xaron. Sounds good. I tried the Freebasic Wrapper for Irrlicht. At the time I tried it, it supported only OGL, but for some reason I'd like to continue with DX. I've also seen a DX-Irrlicht wrapper for Purebasic, but Purebasic is not giving free updates and the version I purchased some time ago doesn't support the wrapper (and I won't buy lots of updates).

Depending on my current situation I would spend some money for something like that, as long as purchasing is easy, eg. with Paypal.

When I tried Irrlicht, I noticed the stencil shadows were rather slow, a small BSP map with 1 NPC with 2 lights and shadows made the rate go down to 15 or so. It seemed to me it didn't make use of hardware stencils, but this could be caused by OGL 1.1 that is installed in windows (xp?) by default and does use software solutions for most of its capabilities, AFAIK.

When I am reflecting this issue honestly then I must confess it isn't so much the need for an other engine, but rather my addiction to search for a thing that I haven't got and that promises to solve some things, eg. speed problems with shadows and with missing features. But in fact plain vanilla Blitz3D is still extremly powerful and there are only a few things that I cannot do with it. The term "live after Blitz" was implying that Blitz3D is dead, but that's definitely not true. Even with the lack of shaders it is still one of the best choices IMHO.

So when you can manage to wrap the entire Command set to Irrlicht and hold the stability that B3D has, then this would be a great product in my opinion.

SLotman - That's for BMax, isn't it? Not sure if I want to change from Blitz3D to BMax. I know it's a good compiler, but I also heared some people found it a bit hard to learn - and I am somebody who doesn't have the nerves even for cpp . BTW. somewhere I used to read Max3D became open source, is that true?


SLotman(Posted 2011) [#15]
Yes, miniB3D is for Max. But it's dead simple: as I posted on another thread, this is a simple miniB3D program:

SuperStrict

Import sidesign.minib3d

Graphics3D 800,600

Local camera:TCamera=CreateCamera()
Local cube:TMesh=CreateCube()
Local light:TLight=CreateLight()

AmbientLight 128,128,128
MoveEntity camera,0,0,-10

while not keyhit(KEY_ESCAPE)
   cls
   TurnEntity cube,0,1,1
   RenderWorld
   UpdateWorld
   Flip
wend

ClearWorld
end


Not very different from Blitz3D, except from variable declaration, which can be omitted - but will cause problems in the long run. Also, no Terrains, "CreateMirror" or CopyRect - but you have "backbufferToTex" which will copy the backbuffer to any texture you create.

Other than that, miniB3D works pretty much as Blitz3D, and has the plus of being multi-platform. I myself test it both on Windows and Linux and it works as expected.

And yeah, Max3D is open source.


jfk EO-11110(Posted 2011) [#16]
Wait a minute, I just read about Extended MiniB3D featuring shaders, as well as iMiniB3D for Iphone and IPad, with Blitz3D/MiniB3D command set. Does that mean I can port my Blitz3D games (or 99% of it) to the iPhone?

edit

I see Klepto2 made the extended Version, but development was stopped in 2008 with version 0.41, tho there's a version 0.51, labeled as physics demo. Is this in a useable state? What is it anyway, shareware or something? (Seems like I missed a lot)

BTW is the standard MiniB3D based on OpenGL too (I guess it is) ? If so, isn't it suffering of poor OGL default support in windows systems (as mentioned OGL 1.1 default, any later version must be provided by the Graphics card manufactor) ?

Lots of questions, please excuse me for being maniac :) but this sounds too good to be true...


Yasha(Posted 2011) [#17]
wrap the entire Command set to Irrlicht


Can't vouch for stability (as in, I haven't used it), but GMan has actually done this for BlitzMax (I don't know whether it can be ported to other systems). Search the BlitzMax boards and you should find it pretty easily. He also made a standard Irrlicht version for non-B3D users.

What is it anyway, shareware or something?


Regular miniB3D is public domain, according to the forums (the lack of clarity on this issue actually put me off using it for a while). And yes, it's OpenGL, although according to Simon, porting it to DirectX wouldn't actually be hard - for someone who knows DirectX.

I keep wondering whether it would be in incredibly poor taste to write a C99 port of it, so it can be used with any language on any platform... it would certainly be a fun exercise. The FreeBasic version seems to have been met with general approval...

somewhere I used to read Max3D became open source, is that true?


Yes but it isn't completely finished. Unless you're an expert in 3D engine internals (in which case... why are you here? Hehe) it may not be of much use to you.

but this sounds too good to be true...


Yeah, Simon (and BRL)'s generosity is absolutely astounding sometimes.


jfk EO-11110(Posted 2011) [#18]
The extended version makes it really very interesting for me. I 've got 2 machines with XP, whereof one is dedicated for game design, but I hate this OS so much (this wobbling, delayed, paralyzed something), that I usually unplug the machine and then use the old Win98 box, where the OS is ligthning fast even with a 1.5 GHz CPU. (Oh well, remember the 8 MHz Times).So, what I'm trying to say is: even if I understand that 9x is pretty much dead, it hurts a little bit when I read that BMax needs at least Win2000. Also because the EXE's won't run on 9x (?).

No matter what, it was an important addition to my collection of engines and I think one day I'll have to make a decision and Bmax with MiniB3D sure has top priority.