an old irrlichtv0.14 engine but with dazzler features... =)

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

an old irrlichtv0.14 engine but with dazzler features... =)

Post by sdi2000 »

For a long time ago ive released an irrlicht version with multihead support for dx9.
Now i developed a new version for multiple multihead adapters. U can render over 16 adapters which can have 16 heads per adapter.
The currend used irrlicht has the version 0.14 but i planned this patch for the newest version of irrlicht. (but The current version has no 32 bit indicies and so on. it is a little bit hard to adpated all the features)

U can download the irrlichtv014 multirenderer source at my project site
http://dev-delight.sourceforge.net

the engine enummerate all the adapters if u coose the multihead driver.
u can set the right adapter / head with with the viewport function.
updates follows =)
In some cases the dx device was not correctly reset after the app termination.

Tested on 4 monitors with 2 cards.
nvidia 7600gs pci express
nvidia 5200 FX pci without express =)

i hope the code was usefull...


here the helloworld tutorial for multihead support

Code: Select all


#include "./irrlicht/irrlicht/include/irrlicht.h"

using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#ifdef _DEBUG
	#pragma comment(lib, "./Irrlicht/Debug/Irrlicht.lib")
#else
	#pragma comment(lib, "./Irrlicht/Release/Irrlicht.lib")
#endif

volatile bool g_run = true;

class MyEventReceiver : public IEventReceiver
{
public:
	virtual bool OnEvent(SEvent event)
	{
		if (event.EventType == EET_KEY_INPUT_EVENT)
		{
			if(event.KeyInput.PressedDown)
			{
				if(event.KeyInput.Key == 27)
				{
					g_run = false;
				}
			}
		}

		return false;
	}
};

int main()
{
	MyEventReceiver evRec;
	u32 width = 800;
	u32 height = 600;
  
  u32 adapterCount = getMultiHeadAdapterCountDX9();
  core::array<core::rect<s32> > screenResolutions;

  //not that multihead devices must be set as fullscreen!!!  
	IrrlichtDevice *device =
		createDevice(EDT_DIRECT3D9_MULTIHEAD, dimension2d<s32>(width, height), 16,
			true, false, false, &evRec);


    u32 idx = 0;
	u32 l = 0;
	for(idx = 1; idx < adapterCount+1; ++idx)
	{
		screenResolutions.push_back(core::rect<s32>(l, 0, width*idx, height));
		l = width*idx;
	}

	
	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();


	IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
	IAnimatedMeshSceneNode* node;
	IAnimatedMeshSceneNode* node1;
	ISceneNode* nodeDummy = smgr->addEmptySceneNode();

	if(mesh != NULL)
	{
		node = smgr->addAnimatedMeshSceneNode( mesh);
		node1 = smgr->addAnimatedMeshSceneNode( mesh);
	}
	 

	ISceneNodeAnimator *anim = NULL;
	if (node && node1 && nodeDummy)
	{
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setFrameLoop(0, 0);
		node->setMaterialTexture( 0, driver->getTexture("../../media/sydney1.bmp") );
		node->setPosition(core::vector3df(50.0f, 0.0f, 0.0f));

		node1->setMaterialFlag(EMF_LIGHTING, false);
		node1->setFrameLoop(0, 0);
		node1->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
		node1->setPosition(core::vector3df(-50.0f, 0.0f, 0.0f));

		nodeDummy->addChild(node);
		nodeDummy->addChild(node1);

		nodeDummy->setPosition(core::vector3df(0,0,0));

		ISceneNodeAnimator *anim = smgr->createRotationAnimator(core::vector3df(0.0f,0.0f,0.1f));//, 20, 0.001f, core::vector3df(180,0,0));
		if(anim)
		{
			nodeDummy->addAnimator(anim);
			anim->drop();
		}
	}

	smgr->addCameraSceneNodeMaya();

	while(device->run() && g_run)
	{
		driver->beginScene(true, true, SColor(255,100,101,140));
    
		for(idx = 0; idx < adapterCount; ++idx)
		{
		driver->setViewPort(screenResolutions[idx]);
		smgr->drawAll();
		}

		driver->endScene();
	}

	device->drop();

	return 0;
}

hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Which patches did you apply to Irrlicht 0.14? There are major differences between plain 0.14 and you version which are totally unrelated to multihead or 32bit. Or do you have a patch against 0.14 which only adds this feature?
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

I have patched the irrlicht engine v014 with all available patches and build then a new directx9 driver.
currently i build a 32bit patch for the irrlicht 1.1...
only the shadow creation gives me an error...
noreg
Posts: 158
Joined: Fri Jun 23, 2006 6:01 pm
Location: continental europe

Post by noreg »

Nice, I'll try that. Thank you.
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

i have adaped the multihead driver to the 1.2 version.
the upload follows in few days
noreg
Posts: 158
Joined: Fri Jun 23, 2006 6:01 pm
Location: continental europe

Post by noreg »

for 1.2? Supercool!
Glad i did not try yet. :)
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

maybe i upload the patch tomorow at work...
:D
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

v1.2 patch for multihead rendering dx9 and some xtra feat

Post by sdi2000 »

Here is promised multihead patch for the irrlich v1.2.

This patch includes:

-matrix patch
-to make customized frustrums for multiwalls or sterescopic views

-32 bit Indicies patch (in next version will be removed)
-only used for high polynodes from max with my3d loader and terrains

-GuiPatch
-closeWindow event
-items can be checked in the Context menu
-textfield event for continuously event call

-SceneManager patch
-pre effect rendering for ISceneNodes. call them before call draw all

-Multihead driver patch for dx9
-render on all available adapters and heads which the driver can be determine.
-16 Adapters with 16 Heads supported

Note: WindowsXP supports 16 Adapters with 16 Heads but only with 10 monitors u can render without problems. a tipp from pny.. hmm not testet =)
Only testet with two diffrend cards GF 7600GS and GF FX 5200 with 4 monitors.

download the patch here
http://www.sdi-syndrom.de/dev-delight/i ... atch.patch

if u found a bug please reply me

have fun
sdi2000 :D
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

i have found a bug in the dx9 multihead driver.. :oops:
please replace the line

if (FAILED(pID3DDevice->SetRenderTarget(0, tex->getRenderTargetSurface())))

into

if (FAILED(pID3DDevice->SetRenderTarget(0, tex->getRenderTargetSurface(m_renderAdapter))))

now the render to target works fine
noreg
Posts: 158
Joined: Fri Jun 23, 2006 6:01 pm
Location: continental europe

Post by noreg »

Is the download on your site already updated?

Thx anyway.
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

Is the download on your site already updated?
no not yet. But i have found a bug in the "CD3D9HLSLMaterialRenderer.cpp" file.
description of the bug: only shader for the first device was created.

The whole new patch for the multihead device and an upload of the pached engine follows at monday, because my inet connection is to slow to upload the sources. sry :oops:

nice weekend to all...
sdi2000
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

okay.. all known bugs with the multihead driver was fixed...
now a patch and the patched irrlicht engine "irrlicht.zip" is available as download.

http://dev-delight.sourceforge.net (for da engine zip file)
http://www.sdi-syndrom.de/dev-delight/i ... atch.patch (for da patch file)

have fun. :D
pd
Posts: 1
Joined: Sun Feb 18, 2007 12:23 am

problems to compile

Post by pd »

Hello,

when I try to compile the sourcefiles (VS 2005) I get the following errors:

1>Irrlicht.obj : warning LNK4224: /COMMENT wird nicht mehr unterstützt; wird ignoriert.
1> Bibliothek "..\..\lib\Win32-visualstudio\Irrlicht.lib" und Objekt "..\..\lib\Win32-visualstudio\Irrlicht.exp" werden erstellt.
1>CD3D9Driver.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall irr::video::CD3D9EffectMaterialRenderer::CD3D9EffectMaterialRenderer(class irr::core::array<struct IDirect3DDevice9 *,class irr::core::irrAllocator<struct IDirect3DDevice9 *> >,class irr::video::IVideoDriver *,int &,char const *,bool,class irr::video::IEffectSetCallBack *,int)" (??0CD3D9EffectMaterialRenderer@video@irr@@QAE@V?$array@PAUIDirect3DDevice9@@V?$irrAllocator@PAUIDirect3DDevice9@@@core@irr@@@core@2@PAVIVideoDriver@12@AAHPBD_NPAVIEffectSetCallBack@12@H@Z)".
1>CD3D9Texture.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_D3DXFilterTexture@16".
1>CIrrDeviceWin32.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""int __cdecl irr::video::getDirectX9MultiheadAdapterCount(void)" (?getDirectX9MultiheadAdapterCount@video@irr@@YAHXZ)".
1>CIrrDeviceWin32.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""class irr::video::IVideoDriver * __cdecl irr::video::createDirectX9DriverMultihead(class irr::core::array<class irr::core::dimension2d<int>,class irr::core::irrAllocator<class irr::core::dimension2d<int> > > const &,class irr::core::array<struct HWND__ *,class irr::core::irrAllocator<struct HWND__ *> >,unsigned int,bool,bool,class irr::io::IFileSystem *,bool,bool,bool,bool)" (?createDirectX9DriverMultihead@video@irr@@YAPAVIVideoDriver@12@ABV?$array@V?$dimension2d@H@core@irr@@V?$irrAllocator@V?$dimension2d@H@core@irr@@@23@@core@2@V?$array@PAUHWND__@@V?$irrAllocator@PAUHWND__@@@core@irr@@@52@I_N2PAVIFileSystem@io@2@2222@Z)".
1>..\..\bin\Win32-visualstudio\Irrlicht.dll : fatal error LNK1120: 4 nicht aufgelöste externe Verweise.

I can compile the normal version without a problem. Could anyone please help me?

Thanks in advance.
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

hi pd,

this error occurs because i didnt update the vs2005 projectfile. =)
add the missing files with the interfaces to the irrlicht project in vs2005 and clear the project and rebuild.
I have only vs2003...

NOTE: pls use the newest version because ive update some animator
settings to sync the animators over a network.
and an automatic load of textures from effect file. (not fully impl)
u can load dds but it was currently not shared with the texturecache. i
work on it. an dds loader for irrlicht follow
with the newest version u can capture a bigger sized rttexture than the
engine resolution
if u have some other questions about my version of irrlicht u can
send me a pm also in german =)

have fun...
Kuehrli
Posts: 6
Joined: Thu May 10, 2007 8:32 am
Location: Linz, AT

Post by Kuehrli »

hi,
i also have some problems with the build (vs2003). release version works fine, but with the debug build i receive the following error:

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xtree(1133) : error C2061: syntax error : identifier '_Wherenode'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xtree(1130) : while compiling class-template member function 'std::_Tree<_Traits>::_Nodeptr std::_Tree<_Traits>::_Buynode(std::_Tree<_Traits>::_Nodeptr,std::_Tree<_Traits>::_Nodeptr,std::_Tree<_Traits>::_Nodeptr,const std::_Tree<_Traits>::value_type &,char)'
with
[
_Traits=std::_Tmap_traits<irr::core::stringc,D3DFORMAT,std::less<irr::core::stringc>,std::allocator<std::pair<const irr::core::stringc,D3DFORMAT>>,false>
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\map(77) : see reference to class template instantiation 'std::_Tree<_Traits>' being compiled
with
[
_Traits=std::_Tmap_traits<irr::core::stringc,D3DFORMAT,std::less<irr::core::stringc>,std::allocator<std::pair<const irr::core::stringc,D3DFORMAT>>,false>
]
d:\Irrlicht\irrlicht-dualhead\CD3D9EffectHelper.h(1005) : see reference to class template instantiation 'std::map<_Kty,_Ty>' being compiled
with
[
_Kty=irr::core::stringc,
_Ty=D3DFORMAT
]


i had to change the project's properties (c/c++ code generation: enable c++ exceptions: yes) in release configuration to get rid of some warnings in the same area.
any ideas how to solve this?

by the way: great work! i tried to do something similar to support multiple monitors until i found sdi2000's solution.
Post Reply