[GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Threads related to Google Summer of Code
User avatar
ja0335
Gremlin
Posts: 154
Joined: Sun Jun 07, 2009 9:04 pm
Location: Bogotá, Colombia
x 4
Contact:

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by ja0335 »

Hi Robert

I have downloaded the new repo and founded a lot of issues:

First one is the cmake generated project is adding to all the vcprojects the debug and the release version of boost libs

The second and most stressful is that all the projects compile except our primary one "RenderSystem_Direct3D11" it is giving me errors in the bellow code:

Code: Select all

                        OGRE_LOCK_MUTEX(mUniformBuffersMutex)
				UniformBufferList::iterator i, iend;
			iend = mUniformBuffers.end();
The errors are:

Code: Select all

1>..\..\..\ogre3d-directx11\RenderSystems\Direct3D11\src\OgreD3D11HardwareBufferManager.cpp(194): error C2065: 'i' : undeclared identifier
1>..\..\..\ogre3d-directx11\RenderSystems\Direct3D11\src\OgreD3D11HardwareBufferManager.cpp(194): error C2065: 'iend' : undeclared identifier
1>..\..\..\ogre3d-directx11\RenderSystems\Direct3D11\src\OgreD3D11HardwareBufferManager.cpp(194): error C2143: syntax error : missing ';' before 'std::set<_Kty,_Pr,_Alloc>::iterator'
The intellisense says me :

Code: Select all

IntelliSense: member "Ogre::HardwareBufferManagerBase::mUniformBuffersMutex" is not a type name	c:\dev-libs\ogre\directx11\ogre3d-directx11\rendersystems\direct3d11\src\ogred3d11hardwarebuffermanager.cpp	194

Juan Camilo Acosta Arango
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by robert_sasu »

I haven't add anything to the new repo yet, there are just your commits. Make sure you download the v1-9 branch. I am home now, I will be able to test this tomorrow at the office. I will do it in the first hours, and if the problems remain I will debug them.

Did you managed to stream out from the geometry shader ? :) (I have managed to do it, and explained it in an earlier post.)
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
ja0335
Gremlin
Posts: 154
Joined: Sun Jun 07, 2009 9:04 pm
Location: Bogotá, Colombia
x 4
Contact:

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by ja0335 »

Yes i'm sure i downloaded the branch v1-9 as you explained me, the problem persist. And i could still test the output stream because i can't compile... As soon i have solved this i will test the stream output as you said me
Juan Camilo Acosta Arango
User avatar
ja0335
Gremlin
Posts: 154
Joined: Sun Jun 07, 2009 9:04 pm
Location: Bogotá, Colombia
x 4
Contact:

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by ja0335 »

I've found the issue, solved it but not in a good way. It was relatet to the OGRE_LOCK_MUTEX. i looked the revision history and found it was previously defined as:
#define OGRE_LOCK_MUTEX(name) boost::recursive_mutex::scoped_lock ogrenameLock(name);
in the last version it is redefined as:
#define OGRE_LOCK_MUTEX(name) boost::recursive_mutex::scoped_lock OGRE_TOKEN_PASTE_EXTRA(ogrenameLock, __LINE__) (name)

I just revert to the old definition and Dx11 Render System now compiles (x64)
Last edited by ja0335 on Thu Jun 20, 2013 1:53 pm, edited 1 time in total.
Juan Camilo Acosta Arango
User avatar
jorrit5477
Gremlin
Posts: 181
Joined: Thu Feb 09, 2006 1:48 am
Location: The Netherlands

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by jorrit5477 »

The trailing ; was removed in commit 1321498. By adding a ; after OGRE_LOCK_MUTEX(*) the compile errors will disappear.
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by robert_sasu »

Can you please post a link of the commit you where talking about, as I can't find it ?
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
jorrit5477
Gremlin
Posts: 181
Joined: Thu Feb 09, 2006 1:48 am
Location: The Netherlands

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by jorrit5477 »

I am not sure if I am correct with commit (got it from bitbucket).
It was merged from pull request #118 (https://bitbucket.org/sinbad/ogre/pull- ... ng-warning)
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by robert_sasu »

If you build without boost everything works fine. I am working and building without boost for now.
I have committed changes which resolves bump mapping sample.
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
jorrit5477
Gremlin
Posts: 181
Joined: Thu Feb 09, 2006 1:48 am
Location: The Netherlands

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by jorrit5477 »

Could it be related to http://www.ogre3d.org/forums/viewtopic.php?f=4&t=78232? I get linker errors after having done a pull (v1-9) just about an hour ago...
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: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by Assaf Raman »

I fixed the mutex\boost issue, get the latest 1.9 and you will be fine.
Watch out for my OGRE related tweets here.
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by masterfalcon »

The link error has been fixed as well. Will merge to 2.0 tonight so you can sync your repo.
User avatar
ja0335
Gremlin
Posts: 154
Joined: Sun Jun 07, 2009 9:04 pm
Location: Bogotá, Colombia
x 4
Contact:

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by ja0335 »

Again there is a lot of problems in the project.... :(

The Direct3D9 Render System doesn't compile. And the shadows in Directx11 have a triangular aspect.
Juan Camilo Acosta Arango
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by robert_sasu »

I know there are problems. There is a mipmapgeneration problem now on D3D11, and that's why you have those strange shadows. But I will commit the correction in an hour.

As far as the D3D9 RS is concerned I haven't tried to compile it. What's the problem ?
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
ja0335
Gremlin
Posts: 154
Joined: Sun Jun 07, 2009 9:04 pm
Location: Bogotá, Colombia
x 4
Contact:

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by ja0335 »

The mutexes.....
OGRE_MUTEX, OGRE_LOCK_MUTEX identifier not found
Juan Camilo Acosta Arango
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by robert_sasu »

Today I have corrected MipMapGeneration flag error, that section needs some other if clauses work correctly on each system. Corrected some of the NewInstancing sample problems. Basic Hardware Instancing is working right now, there is some work needed for the other ways of instancing - corecting shader linkage (error appears probably because of preprocessor_defines). I have added new shaders compatible with d3d11.

I will look at the D3D9 Render System compilation errors tonight. Bugfixing each of the samples is really time consuming. I will switch my focus on implementing the core features to D3D11 Render System and creating new samples which demonstrates tessellation. After that I will come back and resolve the samples.
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by robert_sasu »

I have corrected some more shaders and added shaders for DualQuaternion sample. All the basic shaders are now converted to SM 4.0 model at least. There is a problem on creating Shader Model 4.0 or higher shaders from RT shader system,
as the created shaders are not always compatible with D3D11. Added support for texture codecs BC6/BC7 and started working on adding support for texture unit support for geometry, hull, domain and compute shaders.

Question: Does the current system have texture unit support for vertex shader, becuase I got a little bit confused while searching through the source code ?
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
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: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by Assaf Raman »

What do you mean by "texture unit"?
Watch out for my OGRE related tweets here.
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by robert_sasu »

Setting binding_type to vertex | hull | domain | geometry | compute and being able to load the texture to these shaders, for displacement mapping and other stuffs. (texture binding)
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
ja0335
Gremlin
Posts: 154
Joined: Sun Jun 07, 2009 9:04 pm
Location: Bogotá, Colombia
x 4
Contact:

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by ja0335 »

Yes, it has ...

In OgreRenderSystem.cpp look at line 314 for method void RenderSystem::_setTextureUnitSettings(size_t texUnit, TextureUnitState& tl) Here is the main logic to set the texture binding to pixel or vertex shader
Juan Camilo Acosta Arango
Owen
Google Summer of Code Student
Google Summer of Code Student
Posts: 91
Joined: Mon May 01, 2006 11:36 am
x 21

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by Owen »

The D3D9 errors appear to be mainline errors, likely introduced when masterfalcon cleaned up the threading headers landing OGRE-211.

Edit: Pull request submitted
Last edited by Owen on Thu Jun 27, 2013 3:12 pm, edited 1 time in total.
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by robert_sasu »

More work on texture unit support for geometry, compute, tesselation hull and tesselation domain shaders. Only thing remaining to do is to bound a shader only when it param_type is setted to that shader. I want to find a method to get the binding type inside the render system from the ogrematerialserializer. But I do not find any method I can use to get the binding type from the texture unit. I searched through the source code around 2-3 hours, but nothing.

OgreMaterialSerializer has method with getBindingType. The method can be called from an object type TextureUnitState. My problem is that I cannot access it. I need the information about the binding type in OgreD3D11RenderSystem::_render(const RenderOperation &op), on lines 2422, 2535, 2565, 2595. I do not want to use Ogre::Pass and parse through all the passes and find the bindingtype as it is time consuming, and now I haven't found any other method.

Can anyone help me with this ?
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
ja0335
Gremlin
Posts: 154
Joined: Sun Jun 07, 2009 9:04 pm
Location: Bogotá, Colombia
x 4
Contact:

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by ja0335 »

A more improved result in the rendering...

Image
Juan Camilo Acosta Arango
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by robert_sasu »

Can you post more information about this improved result ? :)

Today I tried different methods to access if binding_type is set to a certain shader, but I was able to do it only from Ogre::Pass (and searching through all the passes - I do not want to use it because of performance issues). If anyone have any suggestion please write it here. More details are described in an above post. I have started to work also on reading back depth stencil as a texture. I tested few option and runs in NVidia's SoftParticles sample. My implementation is not complete yet and the source code is giving some errors as the implementation is not yet finsihed. No code is pushed yet to my repo as I am working on this optimization.
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
ja0335
Gremlin
Posts: 154
Joined: Sun Jun 07, 2009 9:04 pm
Location: Bogotá, Colombia
x 4
Contact:

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by ja0335 »

Stream Output.

In the last days i have been reading the current stream output, and finally i have a conclusion i like you confirm me.

The RenderToVertexBuffer object make use just of two shaders Vertex and Geometry, it actual usage is create geometry from nothing ( no base mesh ) and then stream out the created geometry to a vertex buffer in a ManualObject.

Currently to do a god rendering using tessellation multiple render passes are needed and tessellate on each pass is not a good option. The main logic to do it is the shown bellow.

Image

As you see it simply tessellate in the first pass and then stream out to to second pass to just shade with the pixel shader. This job as i saw in the code is not implemented, and i just want to know if i'm wrong. if yes a point to it may be beneficall, if not i am planing to implement it because it is a crucial need in the rendering pipeline.
Juan Camilo Acosta Arango
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: [GSoC 2013 - accepted] DirectX 11,Tessellation Samples

Post by holocronweaver »

I thought I should point out that OgreD3D11EngineDLL.cpp is not using OGRE_NEW and OGRE_DELETE. Not a big deal, but you never know when it might cause trouble.

By the way, to ensure our work does not conflict, I am not touching the D3D9 and 11 code in my GSoC repo. If I ever need to for some reason, I will let you know. Otherwise I will report any DirectX problems I encounter here for your bug smashing pleasure. :)
Post Reply