DX9 Dynamic Cube Environment Mapping

BlitzMax Forums/BlitzMax Programming/DX9 Dynamic Cube Environment Mapping

col(Posted 2011) [#1]
Hi all,

Download Here

Would some kind people run this dynamic cube environment mapping code please. Just testing out my interface into Direct3D9 and Direct3DX9.

I'd like to know just that it does work as expected.

Requirements are at least DirectX9.0c and Windows.
If you have trouble please make sure you do have DirectX9.0c!! In your 'windows/system32' directory make sure have d3dx9_43.dll.

I've created a 'Max3D' Graphics and GraphicsDriver so in theory you can derive from this and create an OpenGL interface for it - the same that happens for Max2D. This way you can simply choose a renderer and off you go :P

This is written entirely in BMax.
Its the birth of a full DX render engine in BMax.

EDIT :- Mouse almost working but being able to move the scene shows the effect better
Many thanks

Last edited 2011


Doc Holliday(Posted 2011) [#2]
Hello Dave,

it works without any problem on my machine:

Windows 7 x64, 4G RAM, iCore7 Processor
NVIDIA Geforce 460 GTX with 1G RAM
DirectX 9 + 11 installed

It would be interesting to have a look at the
code for this. Do you plan to release it for
the community?

Doc Holiday


col(Posted 2011) [#3]
Hi Doc Holiday,

Thanks for trying it. I'm relieved its working!
I'm in 2 minds if I charge for the interface, but I'm creating a render engine with it that I will definitely want some fruits for. You can imagine the amount of hours i've spent on getting this to work properly, just some fruits for my labour ;-)

This code is RAW Direct3D9 code in Bmax, in the same way as you can use raw OpenGL.

Not that the code will not work for you without the Max3D framework but here it is :-



Last edited 2011


GW(Posted 2011) [#4]
Works for me.

winXPpro gforce gtx280


Doc Holliday(Posted 2011) [#5]
Hello Dave,

again and again it's nice to see what people like you make possible with the good old bmax.

I can really understand that you want some fruits for this. Do you plan a complete 3D-Engine with this to release? If so, I can tell you that I would be ready to pay a fair amount of money for this.

It would be nice if you keep the community here up do date about the progress you make with this.

thx

Doc Holliday


col(Posted 2011) [#6]
Hi Doc
I'll definately make a 3D engine with this, I would sell it too with technical support etc.
I guess I could start a thread and keep it up to date :P

It would be nice if some ATI card owners would leave some feedback at this stage.


6(Posted 2011) [#7]
Works fine on an ATI Sapphire 5770 card.


col(Posted 2011) [#8]
thanks guys,
next stage it is then :-)

considering its been downloaded about 40 times now, i can assume 40 different systems, and no complaints, so i can assume it works ok for everyone...

but then you know what they say about 'assume' !


col(Posted 2011) [#9]
I wonder if it would work on intel macs with windows installed ?
The same would apply in that need DirectX9.0c installed.

I'm not sure how those systems are setup but if someone could try it and let me know?

Thanks.


Happy Sammy(Posted 2011) [#10]
It works fine for nidvia gts 250


AdamRedwoods(Posted 2011) [#11]
Failed on an IntelG41, Win7x64, DX11.
I also did not find the "d3dx9_43.dll" file, but "d3dx9_32.dll", along with dx10, dx11 files.


col(Posted 2011) [#12]
Hi Adam, I know you have DX11 installed already, but have you downloaded the latest version of DirectX from MS? That should fix that issue.

Make sure you download the End User Runtime version, not the SDK version.
(June 2010)

EDIT - Would you let me know if it works ok - Thanks

Last edited 2011


kfprimm(Posted 2011) [#13]
Hey col,

https://github.com/kfprimm/maxb3d

You may find something in here of interest. This is my current shot at a D3D9/GL B3D-like rendering engine. I haven't worked on it in a few months due to work but I plan on resuming work soon.

Unfortunately, I had it at a much more advanced stage at one point but lost the source by accident.

The D3D9 driver is behind as I have to remember how I was able to unify the math code. Simon's original code won't work out of the box with DX.

Anyway, hopefully you may find something neat in there.


col(Posted 2011) [#14]
Hey kfprimm,

Thanks for the code. That was nice of you to share that. I'll take a look and if I use anything I'll give due credit appropriately.

I've ported all of the original Direct3D9 and Direct3DX9 code into BMax now, so you can use just the DX commands as in the DirectX documentations.
Now its time to make a Max3D interface the simple commands for others to use.
You could also make a port to Dx10 and Dx11 too, or any version of OpenGL that people have ported to BMax.

Using what I've done you'd simply write out the equivalent functions for the API.

Of course I use the word 'simply' rather loosely ;)

Last edited 2011


Kryzon(Posted 2011) [#15]
I take it that you are planning to use a driver-based interface like Max2D has for the DirectX9 and OpenGL APIs?

Like you said, it would just be necessary to change to the equivalent functions and setups to make an OpenGL driver.
I think it'd be a great idea to make an engine that changes APIs based on the way Max2D currently does, by choosing a driver (which ends up changing the extended classes the engine uses).

Do you have any experience with coding game engines?


AdamRedwoods(Posted 2011) [#16]
After downloading the DX update (although it should work if I have DX11.... *ahem Microsft*), it works just fine. IntelG41.


col(Posted 2011) [#17]
@Adam
I knew it would work. Good ole MS eh ;0)

@Kryzon
Yep, A driver based 3D engine is my intention, Although I'm actually writing my own engine at the moment using my driver based setup to get it integrated into BMax properly. I will port it over into the BMax driver setup.
DirectX has the D3DX libraries which has so many helper function - its incredible. Things that are usually really complicated are simple 1 liners, for eg mesh simplification and optimization. There's also intersection functions too to make building a coliision engine 'easier', and a wide variety of texture formats can be used without any extra programming what-so-ever. Even though I'm not a keen MS fan, it is fair to say that they do use robust algos.

I did start making this engine in OpenGL, but decided to make it driver based and moved over to Dx instead mainly because of D3DX.

I have about 25 years ( oooh that makes me feel old !! ) as a programmer in my spare time, practically all of my spare time - so I should be ok with it, although I always have welcomed advice and ideas with wide open arms :-)

Last edited 2011


kfprimm(Posted 2011) [#18]
I would recommend against using D3DX. It's cool and impressive, no doubt about that, but you can easily implement all of those functions and make it cross platform in your own code. You just need to dig around the internet a bit. By the way, the Mesa GLU source is a great reference for some of the math code.

I've been down this path before, it's no fun! Bite the bullet and just do it.

But hey, that's just my opinion.


col(Posted 2011) [#19]
Thanks for the advice kfprimm :-)