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

Post by Assaf Raman »

get it from the 1.6 SVN...
Watch out for my OGRE related tweets here.
Van
Hobgoblin
Posts: 512
Joined: Fri Nov 19, 2004 3:56 am
Contact:

Post by Van »

I know DX10 render isn't officially support under 1.6.0 but we are trying to "prepare" for it. We are getting this error when using DX10. Works fine under DX9. (btw, we are using the latest from SVN 1.6.0).
Ogre.log wrote: 06:42:05: Finished parsing scripts for resource group Internal
06:42:05: D3D10 : RenderSystem Option: Floating-point mode = Consistent
06:42:06: OGRE EXCEPTION(3:RenderingAPIException): Error creating texture
Error Description:infoQ exceptions are turned off in D3D10Texture::_create2DTex at ..\src\OgreD3D10Texture.cpp (line 375)
06:42:19: Unregistering ResourceManager for type BspLevel
06:42:19: ResourceBackgroundQueue - thread stopped.
06:42:19: *-*-* OGRE Shutdown

and more detail here:
Ogre.log wrote: ...
06:41:43: Loading library PlugIns\RenderSystem_Direct3D9
06:41:43: Installing plugin: D3D9 RenderSystem
06:41:43: D3D9 : Direct3D9 Rendering Subsystem created.
06:41:43: D3D9: Driver Detection Starts
06:41:43: D3D9: Driver Detection Ends
06:41:43: Plugin successfully installed
06:41:43: Loading library PlugIns\RenderSystem_Direct3D10
06:41:43: Installing plugin: D3D10 RenderSystem
06:41:43: D3D10 : Direct3D10 Rendering Subsystem created.
06:41:44: D3D10: Driver Detection Starts
06:41:44: D3D10: Driver Detection Ends
06:41:44: Plugin successfully installed
...

06:41:44: *-*-* OGRE Initialising
06:41:44: *-*-* Version 1.6.0 (Shoggoth)
06:41:44: D3D10 : RenderSystem Option: Allow NVPerfHUD = No
06:41:44: D3D10 : RenderSystem Option: Anti aliasing = None
06:41:44: D3D10 : RenderSystem Option: Floating-point mode = Consistent
06:41:44: D3D10 : RenderSystem Option: Full Screen = Yes
06:41:44: D3D10 : RenderSystem Option: Information Queue Exceptions Bottom Level = No information queue exceptions
06:41:44: D3D10 : RenderSystem Option: Rendering Device = NVIDIA Quadro FX 570
06:41:44: D3D10 : RenderSystem Option: VSync = No
06:41:44: D3D10 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
06:41:44: D3D10 : RenderSystem Option: sRGB Gamma Conversion = No
06:41:44: D3D9 : RenderSystem Option: Allow NVPerfHUD = No
06:41:44: D3D9 : RenderSystem Option: Anti aliasing = None
06:41:44: D3D9 : RenderSystem Option: Floating-point mode = Consistent
06:41:44: D3D9 : RenderSystem Option: Full Screen = No
06:41:44: D3D9 : RenderSystem Option: Rendering Device = NVIDIA Quadro FX 570
06:41:44: D3D9 : RenderSystem Option: VSync = No
06:41:44: D3D9 : RenderSystem Option: Video Mode = 1024 x 768 @ 32-bit colour
06:41:44: D3D9 : RenderSystem Option: sRGB Gamma Conversion = No
06:41:52: D3D10 : RenderSystem Option: Full Screen = No
06:41:56: D3D10 : RenderSystem Option: Video Mode = 1024 x 768 @ 32-bit colour
06:42:01: D3D9 : Shutting down cleanly.
...
06:42:01: D3D10 : Subsystem Initialising
06:42:01: D3D10RenderSystem::_createRenderWindow "Origins of Humanity - Evil MasterMinds, Inc. Version: 1.0 Build 111", 1024x768 windowed miscParams: FSAA=1 FSAAQuality=0 colourDepth=16 gamma=false useNVPerfHUD=false vsync=false
06:42:01: D3D10 : Created D3D10 Rendering Window 'Origins of Humanity - Evil MasterMinds, Inc. Version: 1.0 Build 111' : 1024x768, 16bpp
06:42:01: D3D10 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
06:42:01: Registering ResourceManager for type Texture
06:42:01: Registering ResourceManager for type GpuProgram
06:42:01: RenderSystem capabilities
06:42:01: -------------------------
06:42:01: RenderSystem Name: Direct3D10 Rendering Subsystem
06:42:01: GPU Vendor: nvidia
06:42:01: Device Name: NVIDIA Quadro FX 570
06:42:01: Driver Version: 0.0.0.0
06:42:01: * Fixed function pipeline: no
06:42:01: * Hardware generation of mipmaps: yes
06:42:01: * Texture blending: yes
06:42:01: * Anisotropic texture filtering: yes
06:42:01: * Dot product texture operation: yes
06:42:01: * Cube mapping: yes
06:42:01: * Hardware stencil buffer: yes
06:42:01: - Stencil depth: 8
06:42:01: - Two sided stencil support: yes
06:42:01: - Wrap stencil values: yes
06:42:01: * Hardware vertex / index buffers: yes
06:42:01: * Vertex programs: yes
06:42:01: * Fragment programs: yes
06:42:01: * Geometry programs: no
06:42:01: * Supported Shader Profiles: hlsl ps_4_0 vs_4_0
06:42:01: * Texture Compression: yes
06:42:01: - DXT: yes
06:42:01: - VTC: no
06:42:01: * Scissor Rectangle: yes
06:42:01: * Hardware Occlusion Query: yes
06:42:01: * User clip planes: yes
06:42:01: * VET_UBYTE4 vertex element type: yes
06:42:01: * Infinite far plane projection: yes
06:42:01: * Hardware render-to-texture: yes
06:42:01: * Floating point textures: yes
06:42:01: * Non-power-of-two textures: yes
06:42:01: * Volume textures: yes
06:42:01: * Multiple Render Targets: 8
06:42:01: - With different bit depths: yes
06:42:01: * Point Sprites: yes
06:42:01: * Extended point parameters: yes
06:42:01: * Max Point Size: 256
06:42:01: * Vertex texture fetch: yes
06:42:01: - Max vertex textures: 4
06:42:01: - Vertex textures shared: no
06:42:01: * Render to Vertex Buffer : no
06:42:01: ***************************************
06:42:01: *** D3D10 : Subsystem Initialised OK ***
06:42:01: ***************************************
06:42:02: ResourceBackgroundQueue - threading enabled, starting own thread
06:42:02: ResourceBackgroundQueue - thread starting.
...
06:42:05: Finished parsing scripts for resource group General
06:42:05: Parsing scripts for resource group Internal
06:42:05: Finished parsing scripts for resource group Internal
06:42:05: D3D10 : RenderSystem Option: Floating-point mode = Consistent
06:42:06: OGRE EXCEPTION(3:RenderingAPIException): Error creating texture
Error Description:infoQ exceptions are turned off in D3D10Texture::_create2DTex at ..\src\OgreD3D10Texture.cpp (line 375)
06:42:19: Unregistering ResourceManager for type BspLevel
06:42:19: ResourceBackgroundQueue - thread stopped.
06:42:19: *-*-* OGRE Shutdown
Stop Global Whining.
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

Post by Assaf Raman »

How can I recreate this problem on my computer?
Watch out for my OGRE related tweets here.
Van
Hobgoblin
Posts: 512
Joined: Fri Nov 19, 2004 3:56 am
Contact:

Post by Van »

Assaf Raman wrote:How can I recreate this problem on my computer?
It errors out when we attempt to create a skybox:

Code: Select all

	// Load the skybox
	mGlobalResource->OgreDefaultSceneMgr->setSkyBox( true, "Celestial/Space/Default", 1250.0f );


Here is the code that sets up Ogre and the SceneManager:

Code: Select all


...
	// Create the Ogre Environment
	mGlobalResource->OgreRoot = new Ogre::Root();
	Ogre::LogManager::getSingleton().setLogDetail( Ogre::LL_BOREME );

	// Create the SceneManager, in this case a generic one
	mGlobalResource->OgreDefaultSceneMgr = mGlobalResource->OgreRoot->createSceneManager( Ogre::ST_GENERIC, "DEFAULT");

	// Create the camera
	mGlobalResource->OgreDefaultCamera =  mGlobalResource->OgreDefaultSceneMgr->createCamera( "DefaultCamera" );
	mGlobalResource->OgreDefaultCamera->setPosition( Ogre::Vector3::ZERO );
	mGlobalResource->OgreDefaultCamera->lookAt( Ogre::Vector3::NEGATIVE_UNIT_Z );
	mGlobalResource->OgreDefaultCamera->setNearClipDistance( 1.0f );
	mGlobalResource->OgreDefaultCamera->setFarClipDistance( 400000.0f );

	// Create  viewport, entire window
	mGlobalResource->OgreDefaultViewPort = clsGlobalResource::getSingleton().OgreDefaultRenderWindow->addViewport( mGlobalResource->OgreDefaultCamera );
	mGlobalResource->OgreDefaultViewPort->setBackgroundColour( Ogre::ColourValue( 0, 0, 0 ) );

...

// Initialize CEGUI

...

	// Load the skybox
	mGlobalResource->OgreDefaultSceneMgr->setSkyBox(true, "Celestial/Space/Default", 1250.0f);


Here is the skybox material script:
Note that the cubic texture files are in a (zip) pack file.

Code: Select all

material Celestial/Space/Default
{
	technique
	{
		pass
		{
			lighting off
			depth_write off
			ambient 1 1 1 1
			diffuse 0 0 0 1.000000

			texture_unit
			{
				filtering none
				// skybox textures go:  front back left right up down
 				cubic_texture OrgSky1_FR.dds OrgSky1_BK.dds OrgSky1_LF.dds OrgSky1_RT.dds OrgSky1_UP.dds OrgSky1_DN.dds separateUV
				 tex_address_mode wrap
			}
		}
	}
}

Stop Global Whining.
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

Post by Assaf Raman »

My laptop stopped working and is in the workshop – it has my only d3d10 supported card on it – so I won't be able to help until it comes back (I guess 2 weeks).
Watch out for my OGRE related tweets here.
Van
Hobgoblin
Posts: 512
Joined: Fri Nov 19, 2004 3:56 am
Contact:

Post by Van »

Assaf Raman wrote:My laptop stopped working and is in the workshop – it has my only d3d10 supported card on it – so I won't be able to help until it comes back (I guess 2 weeks).
Bumber about your laptop!

Here is some addition information:

Code: Select all

IDE: MVS 9.0 
Ogre Version 1.6.0 SVN as 11/05/2008
Boost: 1.0.37

>>>> OgreConfig.h
#define OGRE_DOUBLE_PRECISION 1
#define OGRE_THREAD_SUPPORT 1
#define OGRE_USE_NEW_COMPILERS 1
We ran the ogre supplied unmodified Demo_SkyBox in DEBUG mode and we did received a crash. The stack traces back to Line 197 in HlslFixedFuncEmuShaderGenerator::getShaderSource()
Error wrote: Unhandled exception at 0x77718dd3 in Demo_SkyBox.exe: 0xC0000005: Access violation reading location 0xfffffff8.
The error doesn't occur until mRoot->startRendering(); is called in Demo_SkyBox.
Stop Global Whining.
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

Post by Assaf Raman »

We have a problem with the latest “Microsoft DirectX SDK (November 2008)â€
Last edited by Assaf Raman on Tue Nov 25, 2008 5:28 am, edited 2 times in total.
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

Post by Assaf Raman »

Bottom line: D3DReflect is not documented and I couldn’t get it to work.

Solution for now - don’t use the latest “Microsoft DirectX SDK (November 2008)â€
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

Post by Assaf Raman »

I was able to solve the issue.
Turns out that D3DX10ReflectShader was renamed to D3D10ReflectShader and not to D3DReflect.

Now the render system works also with the latest “Microsoft DirectX SDK (November 2008)â€
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

Post by Assaf Raman »

http://msdn.microsoft.com/en-us/library/bb205101.aspx

Turns out that D3D10ReflectShader is the deprecated version of D3DX10ReflectShader, so I guess I did need to use D3DReflect.

But - as I wrote - I wasn't able to use it - so I used D3D10ReflectShader.

Microsoft did a big mess here.

(Everything is working so I guess we are still ok for now :? )
Watch out for my OGRE related tweets here.
Van
Hobgoblin
Posts: 512
Joined: Fri Nov 19, 2004 3:56 am
Contact:

Post by Van »

Did you commit your changes to SVN? v1-6 branch?
Stop Global Whining.
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

Post by Assaf Raman »

to the trunk.
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

Post by Assaf Raman »

I asked for help in the Direct3D 10 XNA forum.
You can see my post here: http://forums.xna.com/forums/t/21239.aspx
Watch out for my OGRE related tweets here.
ZHing
Gnoblar
Posts: 18
Joined: Tue Feb 15, 2005 8:49 am

Post by ZHing »

I have changed:

Code: Select all

hr = D3DX10ReflectShader( (void*) mpMicroCode->GetBufferPointer(), BytecodeLength, &mpIShaderReflection );
to:

Code: Select all

hr = D3DReflect( (void*) mpMicroCode->GetBufferPointer(), BytecodeLength, IID_ID3D11ShaderReflection, (void**)&mpIShaderReflection );
ID3D10ShaderReflection1 to ID3D11ShaderReflection
D3D10_SHADER_DESC to D3D11_SHADER_DESC
D3D10_SHADER_BUFFER_DESC to D3D11_SHADER_BUFFER_DESC
ID3D10ShaderReflectionConstantBuffer to ID3D11ShaderReflectionConstantBuffer
ID3D10ShaderReflectionType to ID3D11ShaderReflectionType
D3D10_SHADER_TYPE_DESC to D3D11_SHADER_TYPE_DESC

It works for 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

Post by Assaf Raman »

I also did the same change a few days ago and decided that I don’t want to integrate this code just yet.

The use of D3D10ReflectShader works with the current DX SDK version and is a much minimal change then the one needed in order to use D3DReflect.

D3DReflect is undocumented and requires the adding D3D11 headers as dependent.

Bottom line – there are more disadvantages then advantages to do the change to D3DReflect.

Thanks for the help. I am sorry I didn't post about my experience with D3DReflect, I was hesitating if to commit the code or not for the last few days and I guess that I will go with my initial instinct on this.

I hope that the next DX SDK release will have hardware support for D3D11 – then I will do the switch between versions and use D3DReflect and any other D3D11 classes. (You will have to wait 3 months or less).
Watch out for my OGRE related tweets here.
User avatar
_tommo_
Gnoll
Posts: 677
Joined: Tue Sep 19, 2006 6:09 pm
x 5
Contact:

Post by _tommo_ »

So... Ogre will skip dx10, or I didn't understand? :?

Anyway it makes sense, I don't believe that will be released many full dx10 games... for now, the only one is Alan Wake... maybe.
OverMindGames Blog
IndieVault.it: Il nuovo portale italiano su Game Dev & Indie Games
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

Post by Assaf Raman »

d3d11 is the same as d3d10 - so this is not a big skip...
Watch out for my OGRE related tweets here.
User avatar
_tommo_
Gnoll
Posts: 677
Joined: Tue Sep 19, 2006 6:09 pm
x 5
Contact:

Post by _tommo_ »

I'm really not getting the MS marketing then :lol:

I thought there was a big improvement in the shader model (OO shaders, tesselate, hull, compute)... this doesn't break the dx10 API?
OverMindGames Blog
IndieVault.it: Il nuovo portale italiano su Game Dev & Indie Games
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

Post by Assaf Raman »

No, they only added to what they had in d3d10.
Watch out for my OGRE related tweets here.
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
x 2
Contact:

Post by Noman »

This is all getting me a bit mixed up. If I want to compile the render system and run it properly, which version of the DirectX SDK should I get?
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

Post by Assaf Raman »

Get any of them that have d3d10. (Including the latest one).
Watch out for my OGRE related tweets here.
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
x 2
Contact:

Post by Noman »

The 1-6 branch of DX10 RS does not compile with latest SDK, because of the reflect issue. Do you plan to update the sources or should we change the calls manually for now?
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

Post by Assaf Raman »

I'll do it later today.
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

Post by Assaf Raman »

1.6 SVN should work with the nov 08 DX SDK now.
Watch out for my OGRE related tweets here.
Van
Hobgoblin
Posts: 512
Joined: Fri Nov 19, 2004 3:56 am
Contact:

Post by Van »

Assaf Raman wrote:1.6 SVN should work with the nov 08 DX SDK now.
I'm using the Nov 2008 DirectX SDK.
Ogre: 1.6.0 SVN (updated as of this post).

Just performed and SVN update from 1.6 and tried to compile and received the following error:

Code: Select all

1>OgreD3D10HLSLProgram.cpp
1>OgreD3D10HLSLProgram.cpp(186) : error C2664: 'D3D10ReflectShader' : cannot convert parameter 3 from 'ID3D10ShaderReflection1 **__w64 ' to 'ID3D10ShaderReflection **'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
this is the line the compiler is choking on:

Code: Select all

hr = D3DX10ReflectShader( (void*) mpMicroCode->GetBufferPointer(), BytecodeLength, &mpIShaderReflection );
Stop Global Whining.
Post Reply