DirectX 11 render system - work-in-progress

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

What is your product?
Watch out for my OGRE related tweets here.
debdatta_basu
Kobold
Posts: 31
Joined: Thu Jun 10, 2010 4:32 am

Re: DirectX 11 render system - work-in-progress

Post by debdatta_basu »

Product? What do you mean?
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

Do you have a product\project that uses OGRE or your goal is to improve OGRE d3d11 support?
Watch out for my OGRE related tweets here.
debdatta_basu
Kobold
Posts: 31
Joined: Thu Jun 10, 2010 4:32 am

Re: DirectX 11 render system - work-in-progress

Post by debdatta_basu »

Well.. My goal is to improve support. Obviously, since in a project, hacky, code goes unnoticed,and I can think of plenty of ways to hack multi threading into the current rs.. :P

Will require some thinking to make it more general purpose and applicable to maximum number of people, and thats what interests me.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

Sounds good, this is the open source spirit.
I recommend reading this long thread before starting any work.
Watch out for my OGRE related tweets here.
debdatta_basu
Kobold
Posts: 31
Joined: Thu Jun 10, 2010 4:32 am

Re: DirectX 11 render system - work-in-progress

Post by debdatta_basu »

Not so fast :P

Just kidding.... I right now have no idea what your visions are on the project, and since you have done a significant portion of it, a fresh perspective might not be a good idea.
However, if there is any way you want me to help out within the framework of the progress youve already made, just let me know....
neubsi
Gnoblar
Posts: 15
Joined: Mon Mar 13, 2006 10:45 pm
Location: Vienna/Austria
Contact:

Re: DirectX 11 render system - work-in-progress

Post by neubsi »

hi folks,
i´ve just downloaded the unstable source from your rep and compiled all the samples.
opengl and dx9 are working perfectly, but dx11 seems to have a problem.

here´s my log:
23:26:05: Creating resource group General
23:26:05: Creating resource group Internal
23:26:05: Creating resource group Autodetect
23:26:05: SceneManagerFactory for type 'DefaultSceneManager' registered.
23:26:05: Registering ResourceManager for type Material
23:26:05: Registering ResourceManager for type Mesh
23:26:05: Registering ResourceManager for type Skeleton
23:26:05: MovableObjectFactory for type 'ParticleSystem' registered.
23:26:05: OverlayElementFactory for type Panel registered.
23:26:05: OverlayElementFactory for type BorderPanel registered.
23:26:05: OverlayElementFactory for type TextArea registered.
23:26:05: Registering ResourceManager for type Font
23:26:05: ArchiveFactory for archive type FileSystem registered.
23:26:05: ArchiveFactory for archive type Zip registered.
23:26:05: DDS codec registering
23:26:05: FreeImage version: 3.13.1
23:26:05: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
23:26:05: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,drf,dsc,ptx,cap,iiq,rwz
23:26:05: Registering ResourceManager for type HighLevelGpuProgram
23:26:05: Registering ResourceManager for type Compositor
23:26:05: MovableObjectFactory for type 'Entity' registered.
23:26:05: MovableObjectFactory for type 'Light' registered.
23:26:05: MovableObjectFactory for type 'BillboardSet' registered.
23:26:05: MovableObjectFactory for type 'ManualObject' registered.
23:26:05: MovableObjectFactory for type 'BillboardChain' registered.
23:26:05: MovableObjectFactory for type 'RibbonTrail' registered.
23:26:05: *-*-* OGRE Initialising
23:26:05: *-*-* Version 1.8.0unstable (Byatis)
23:26:05: Installing plugin: GL RenderSystem
23:26:05: OpenGL Rendering Subsystem created.
23:26:05: Plugin successfully installed
23:26:05: Installing plugin: D3D9 RenderSystem
23:26:05: D3D9 : Direct3D9 Rendering Subsystem created.
23:26:05: D3D9: Driver Detection Starts
23:26:05: D3D9: Driver Detection Ends
23:26:05: Plugin successfully installed
23:26:05: Installing plugin: D3D11 RenderSystem
23:26:05: D3D11 : Direct3D11 Rendering Subsystem created.
23:26:05: D3D11: Driver Detection Starts
23:26:05: D3D11: Driver Detection Ends
23:26:05: Plugin successfully installed
23:26:05: Installing plugin: Cg Program Manager
23:26:05: Plugin successfully installed
23:26:05: Installing plugin: Octree Scene Manager
23:26:05: Plugin successfully installed
23:26:05: Installing plugin: ParticleFX
23:26:05: Particle Emitter Type 'Point' registered
23:26:05: Particle Emitter Type 'Box' registered
23:26:05: Particle Emitter Type 'Ellipsoid' registered
23:26:05: Particle Emitter Type 'Cylinder' registered
23:26:05: Particle Emitter Type 'Ring' registered
23:26:05: Particle Emitter Type 'HollowEllipsoid' registered
23:26:05: Particle Affector Type 'LinearForce' registered
23:26:05: Particle Affector Type 'ColourFader' registered
23:26:05: Particle Affector Type 'ColourFader2' registered
23:26:05: Particle Affector Type 'ColourImage' registered
23:26:05: Particle Affector Type 'ColourInterpolator' registered
23:26:05: Particle Affector Type 'Scaler' registered
23:26:05: Particle Affector Type 'Rotator' registered
23:26:05: Particle Affector Type 'DirectionRandomiser' registered
23:26:05: Particle Affector Type 'DeflectorPlane' registered
23:26:05: Plugin successfully installed
23:26:05: Installing plugin: BSP Scene Manager
23:26:05: Plugin successfully installed
23:26:05: D3D11 : RenderSystem Option: Allow NVPerfHUD = No
23:26:05: D3D11 : RenderSystem Option: Driver type = Hardware
23:26:05: D3D11 : RenderSystem Option: FSAA = 0
23:26:05: D3D11 : RenderSystem Option: Floating-point mode = Consistent
23:26:05: D3D11 : RenderSystem Option: Full Screen = No
23:26:05: D3D11 : RenderSystem Option: Information Queue Exceptions Bottom Level = Info (exception on any message)
23:26:05: D3D11 : RenderSystem Option: Rendering Device = ATI Radeon HD 5800 Series
23:26:05: D3D11 : RenderSystem Option: VSync = No
23:26:05: D3D11 : RenderSystem Option: VSync Interval = 1
23:26:05: D3D11 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
23:26:05: D3D11 : RenderSystem Option: sRGB Gamma Conversion = No
23:26:05: D3D9 : RenderSystem Option: Allow NVPerfHUD = No
23:26:05: D3D9 : RenderSystem Option: FSAA = 0
23:26:05: D3D9 : RenderSystem Option: Floating-point mode = Consistent
23:26:05: D3D9 : RenderSystem Option: Full Screen = Yes
23:26:05: D3D9 : RenderSystem Option: Multi device memory hint = Use minimum system memory
23:26:05: D3D9 : RenderSystem Option: Rendering Device = Monitor-1-ATI Radeon HD 5800 Series
23:26:05: D3D9 : RenderSystem Option: Resource Creation Policy = Create on all devices
23:26:05: D3D9 : RenderSystem Option: VSync = No
23:26:05: D3D9 : RenderSystem Option: VSync Interval = 1
23:26:05: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
23:26:05: D3D9 : RenderSystem Option: sRGB Gamma Conversion = No
23:26:05: CPU Identifier & Features
23:26:05: -------------------------
23:26:05: * CPU ID: GenuineIntel: Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz
23:26:05: * SSE: yes
23:26:05: * SSE2: yes
23:26:05: * SSE3: yes
23:26:05: * MMX: yes
23:26:05: * MMXEXT: yes
23:26:05: * 3DNOW: no
23:26:05: * 3DNOWEXT: no
23:26:05: * CMOV: yes
23:26:05: * TSC: yes
23:26:05: * FPU: yes
23:26:05: * PRO: yes
23:26:05: * HT: no
23:26:05: -------------------------
23:26:05: D3D11 : Subsystem Initialising
23:26:05: OGRE EXCEPTION(7:InternalErrorException): Failed to create Direct3D11 object in D3D11RenderSystem::D3D11RenderSystem at src\OgreD3D11RenderSystem.cpp (line 687)

i´m using Windows 7 X64, AMD 5850 with lastest drivers, latest directx runtime and sdk

thx for the good work!
neubsi
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

I have been taking my summer vacation for the last few weeks, I will have a look when I will come back to Israel.
BTW: Currently I am in Zanzibar.
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

On my 32 bit windows 7 it works...
No clue.
Does the directx sdk d3d11 samples work on your computer?
Watch out for my OGRE related tweets here.
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: DirectX 11 render system - work-in-progress

Post by so0os »

Is this thing still alive?
Sos Sosowski :)
http://www.sos.gd
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

What do you mean?
Watch out for my OGRE related tweets here.
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Re: DirectX 11 render system - work-in-progress

Post by Lee04 »

I don't know what he means....maybe his looking fpr stream out is it in yet in 1.8?
According to 1.7 road map it should get in no later than 1.8 because it was planned for 1.7.
Ph.D. student in game development
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: DirectX 11 render system - work-in-progress

Post by so0os »

I mean can we expect it in a usable form in a finite time.
I read on the wiki, that you might need a hand for that.
Sos Sosowski :)
http://www.sos.gd
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

It is usable, no one really needs it for now - so no one got to finish it.
We will be happy for any patch on the topic.
Post here if you do any work on it.
I plan to add multi-monitor support in the near future.
Watch out for my OGRE related tweets here.
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: DirectX 11 render system - work-in-progress

Post by so0os »

Wow, cool!
Sorry for babbling without invetigation. I'll take a look at it, maybe there's something I can be a use for.
Sos Sosowski :)
http://www.sos.gd
rride
Kobold
Posts: 30
Joined: Thu May 13, 2010 1:14 pm
Location: Minsk, Belarus
x 1

Re: DirectX 11 render system - work-in-progress

Post by rride »

Assaf Raman wrote:It is usable, no one really needs it for now - so no one got to finish it.
We will be happy for any patch on the topic.
Post here if you do any work on it.
I plan to add multi-monitor support in the near future.
If the support for DirectX11 were complete we would use it. BTW, what features of DX11 are already working?
For example, are DX11 device states used in a proper way?
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

I tested and didn't find any preformance benefit from using states the "right" way.
Watch out for my OGRE related tweets here.
rride
Kobold
Posts: 30
Joined: Thu May 13, 2010 1:14 pm
Location: Minsk, Belarus
x 1

Re: DirectX 11 render system - work-in-progress

Post by rride »

Assaf Raman wrote:I tested and didn't find any preformance benefit from using states the "right" way.
It's very strange. I have heard from presentations that developers have really seen reduction of cost of draw calls. How have you tested that? Was it an application with a heavy state switching? I haven't used the DX11 myself so that' very interesting to me. :)
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

Well - if you want to give it a try - here is a fork for testing better state handling: read this thread:
http://www.ogre3d.org/forums/viewtopic.php?f=4&t=61590
Watch out for my OGRE related tweets here.
rride
Kobold
Posts: 30
Joined: Thu May 13, 2010 1:14 pm
Location: Minsk, Belarus
x 1

Re: DirectX 11 render system - work-in-progress

Post by rride »

Assaf Raman wrote:Well - if you want to give it a try - here is a fork for testing better state handling: read this thread:
http://www.ogre3d.org/forums/viewtopic.php?f=4&t=61590
As far as I understood from the topic you have tested StateBlocks only in DX9 and OpenGL, but DX11 proposes a new way of using the states. States are validated on creation of respective state block(input assembler's, rasterizer's or any other's one) while AFAIK in DX9 validation happens each time when DrawPrimitive is called. So StateBlocks in DX9 are not even supposed to improve performace - they are just setting all the states and not validating them!

I'll try to do a benchmark tonight or, at least, find one if it's available somewhere.
Fedyakin
Halfling
Posts: 43
Joined: Thu Jul 14, 2005 6:48 pm
Contact:

Re: DirectX 11 render system - work-in-progress

Post by Fedyakin »

Both the dx10 and dx11 renderers were crashing as a result of the first call to copyData in TerrainQuadTreeNode::createGpuVertexData() (This is in the new terrain component). After some debugging I believe I have discovered the cause. The terrain system explicitly creates a DefaultHardwareVertexBuffer and passes that as the source buffer to copyData. The D3D10HardwareVertexBuffer::copyData virtual override makes the assumption that the source buffer argument is a D3D10HardwareVertexBuffer. It uses a static cast to convert the instance to a type it isn't and a crash soon follows.

I modified both the dx10 and dx11 implementation by adding an if check. This fixed the crash; however, I don't know enough about the renderer implementations to know if this is the right way to fix it.

Code: Select all

	//---------------------------------------------------------------------
        // "Fixed" version 
	void D3D10HardwareVertexBuffer::copyData(HardwareBuffer& srcBuffer, size_t srcOffset, 
		size_t dstOffset, size_t length, bool discardWholeBuffer)
	{
		if( srcBuffer.isSystemMemory() )
		{
			HardwareBuffer::copyData(srcBuffer, srcOffset, dstOffset, length, discardWholeBuffer);
		}
		else
		{
			D3D10HardwareVertexBuffer& d3dBuf = static_cast<D3D10HardwareVertexBuffer&>(srcBuffer);
			mBufferImpl->copyData(*(d3dBuf.mBufferImpl), srcOffset, dstOffset, length, discardWholeBuffer);
		}
	}
User avatar
so0os
Bugbear
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: DirectX 11 render system - work-in-progress

Post by so0os »

Do you mean 1.7 or trunk? Trunk is far more usable afaik, also DX10 RS was dropped in favour of DX11
Sos Sosowski :)
http://www.sos.gd
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: DirectX 11 render system - work-in-progress

Post by Assaf Raman »

I am going to start working on the dx11 render system (trunk) from next week to try to finish it for the 1.8 release.
Watch out for my OGRE related tweets here.
Fedyakin
Halfling
Posts: 43
Joined: Thu Jul 14, 2005 6:48 pm
Contact:

Re: DirectX 11 render system - work-in-progress

Post by Fedyakin »

This was using the 1.7.2 release of Ogre. I'll give things a try with the version in trunk.
micheallarkin
Halfling
Posts: 40
Joined: Tue Apr 15, 2008 2:49 pm
x 3

Re: DirectX 11 render system - work-in-progress

Post by micheallarkin »

I've been using the DirectX 11 render system from Trunk and noticed that D3D11RenderSystem::blitToMemory was not implemented (which we really needed), so I implemented it and a patch has been submitted..
Post Reply