Reading from Blitz3D into DX9 (is this possible?)

Blitz3D Forums/Blitz3D Programming/Reading from Blitz3D into DX9 (is this possible?)

Kryzon(Posted 2008) [#1]
Is it too slow to have every frame passing vertex buffers and other rendering related information into a D3D9 DLL so as to have Shader support but still keeping our cosy command set inside our beloved version 7? And rendering from that DLL as well, before blitting that render into Blitz3D's backbuffer so as to not use the RenderWorld inside the code but rather a hipothetical one inside the DLL?


_33(Posted 2008) [#2]
That would be absurd. You'd better wait for Xors3D, which is a direct X 9 engine that supports Blitz3D, BlitzPlus, BlitzMax and C++.
http://www.rubux.net/


Kryzon(Posted 2008) [#3]
okee doke.

EDIT: Dude! that engine looks sweet! even if only BMax get a 3D version, this will do the trick! and it uses .b3d natively! awesome. Hope it doesn't cost too much though.


t3K|Mac(Posted 2008) [#4]
stability is all! just wait and see how compatible this new engine is... i keep an eye on that too.


Kryzon(Posted 2008) [#5]
The nice thing are the samples of the engine. And the funny thing is that, whilst rendering, my CPU doesn't get to 100% usage like when I use blitz3D. I'm not saying it's faster, I'm saying it doesn't use up all the power of the CPU.

And has amazing shader application (a simple kinda like LoadShader function) - If only I knew how to program on HLSL :D
(the good thing about shader language is that it's much more logic than code. You need only 6 lines to do a hell of an effect).


Gabriel(Posted 2008) [#6]
And the funny thing is that, whilst rendering, my CPU doesn't get to 100% usage like when I use blitz3D. I'm not saying it's faster, I'm saying it doesn't use up all the power of the CPU.

That's because Blitz3D ( and indeed all Blitz products ) are inherently single-threaded and thus unable to make any use of additional CPU's or cores. Since most CPU's now have at least two cores, that means you're unlikely to see more than 50% CPU usage. It's generally considered a bad thing that your language is unable to use 50% of the CPU though. After all, if it *could* use 100%, you still wouldn't have to unless you needed to. You could still use 50% as you are now if you didn't need the performance.


Kryzon(Posted 2008) [#7]
Well, but my P IV isn't multi-threaded.
It's just that everytime I hit a loop with Render\Update World inside, the CPU goes to 100% (whereas this doesn't happen with Xors3D).


_33(Posted 2008) [#8]
rafael_blitz: Your P4 isn't multi-threading if you have set your HTT off from your motherboard bios.

http://en.wikipedia.org/wiki/Hyper_threading


Gabriel(Posted 2008) [#9]
It's just that everytime I hit a loop with Render\Update World inside, the CPU goes to 100% (whereas this doesn't happen with Xors3D).

That has nothing to do with Blitz3D or Xors3D. That just means that they have coded their main loop better than you have coded yours. You can do exactly the same thing in B3D if you want. Just let the system have some time if you don't need the CPU cycles.

EG: If your FPS are over a certain threshold execute a Delay 1 or Delay 2 in the main loop. There are other ways too, but this is the simplest.


Kryzon(Posted 2008) [#10]
No, gabriel, you didn't get it.
Typing:
While not keyhit(1)
   UpdateWorld()
   Renderworld()
   Flip
Wend

In blitz generates 100% CPU usage, whilst
While not keyhit(1)
   xUpdateWorld
   xRenderWorld
   xFlip
Wend

Does not. It stays on 20% ~ 40%.


_33(Posted 2008) [#11]
Maybe one defaults to Flip 1 and the other defaults to Flip 0, which would explain.


Gabriel(Posted 2008) [#12]
No, gabriel, you didn't get it.

Regardless of what they default to, you can still get the same effect in Blitz3D. If anything, I would say that Blitz3D has the advantage because I would want to decide what happens with my spare CPU time.