Plugin development with D3D_Driver

Started by Besh, Fri 12/12/2008 11:58:36

Previous topic - Next topic

Besh

Ciaoooooooooooo

Finally, after a pretty long time, my life reachs a RSP (relative stability point)... now I'm free to come back to my hobbies: play guitar and (of course) use AGS.

I'm very happy to see that in these past months (...mmmhhh... years !?!) the community grown up, the number near our favourite editor become a 3 and also that you made a lot of great games  ;D so... let me say:

THANKS CJ AND THANKS TO ALL OF YOU TO KEEP THE AGS DREAM ALIVE... YOU ALL ALWAYS MADE AND AMAZING WORK !!!


I write this post to introduce my new plugin:

                       Charater_D3D

The main idea behind this new work is to extend the functionalities of the old Character_3D using the D3D driver capabilities since now AGS directly supports it.

The glorious Allegro lib has been replaced with the powerfull Irrlich Engine.
What I'm trying to do is something really useful in 3D avdenture development.

Unfortunately I have a problem, I cannot render 3D object in the right way because there something wrong with the ZBuffer (I think...).
Hey CJ could you tell me if AGS (with D3D Driver) enables the ZBUFFER? ???
And if no, is it possible to enable it?

Thanks in advance
"Spread our codes to the stars,
You can rescue us all"
- Muse

Pumaman

Hey Besh, good to see you again :)

AGS does not enable the z-buffer.

Can you not do this yourself in the plugin code by calling something like:

direct3ddevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);

or does that not work?

Anteater

You're using Irrlicht? Sweet! I love that engine. I made an dungeon crawling action RPG with it (unfortunately, I think I lost the source/media files) as well as a number of test games and tech demos. It truly is a wonderful engine. I'm looking forward to seeing your plugin.

Besh

Quote from: Pumaman on Fri 12/12/2008 15:47:56
Can you not do this yourself in the plugin code by calling something like:

direct3ddevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);

or does that not work?

No, that doesn't work!

I'm not sure ( I don't know Direct3D very well  :( ) but I think that in D3DPRESENT_PARAMETERS the following members should be set:
   EnableAutoDepthStencil (= TRUE ? )
   AutoDepthStencilFormat (= D3DFMT_D16 or D3DFMT_D32 ? )

and also that the Z-buffer should be clean every new frame using the flag D3DCLEAR_ZBUFFER in function Clear(...).

"Spread our codes to the stars,
You can rescue us all"
- Muse

Pumaman

Hmm, well enabling the Z-buffer could potentially slow down the engine so I wouldn't want to just change AGS to always enable it. Perhaps some sort of option could be provided to allow the plugin to enable this.

Besh

#5
OK. It would be great...  ;D
"Spread our codes to the stars,
You can rescue us all"
- Muse

Pumaman

A new event AGS_EngineInitGfx has been added to enable to you modify the D3DPRESENT_PARAMETERS that AGS passes to D3D. I haven't had much time to test this myself so please let me know if you have any problems.

See the plugin API page for details.

Besh

#7
 ;D thanks so much... I'll test it as soon as possible.

EDIT:

I use the new event AGS_EngineInitGfx in the same way as the event AGS_EngineStartup.
Build the game with new RC2 version, start it and... :(

In file agsplugin.h there isn't the line:
Code: ags
 DLLEXPORT void AGS_EngineInitGfx(const char* driverID, void *data); 


I try to put it and rebuild but the result is the same, the event isn't called by the engine.

"Spread our codes to the stars,
You can rescue us all"
- Muse

Pumaman

Heh oops, I forgot to put that in the header file, I've now uploaded a fixed Plugin API ZIP with that in there.

However I've tested it with that in there, and the event function definitely does get called for me. Can you upload the DLL that isn't working?

Besh

It works also for me...  :-[
I messed up the code.

Ok, now I'm able to use the AutoStencilBuffer and to render Irrlicht object on AGS.

See you in the next days for some Character_D3D news :)
Thank you
"Spread our codes to the stars,
You can rescue us all"
- Muse

SMF spam blocked by CleanTalk