Page 2 of 5

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

Posted: Wed Jun 19, 2013 9:08 pm
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


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

Posted: Wed Jun 19, 2013 9:23 pm
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.)

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

Posted: Wed Jun 19, 2013 9:34 pm
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

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

Posted: Wed Jun 19, 2013 10:25 pm
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)

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

Posted: Thu Jun 20, 2013 9:32 am
by jorrit5477
The trailing ; was removed in commit 1321498. By adding a ; after OGRE_LOCK_MUTEX(*) the compile errors will disappear.

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

Posted: Thu Jun 20, 2013 11:12 am
by robert_sasu
Can you please post a link of the commit you where talking about, as I can't find it ?

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

Posted: Thu Jun 20, 2013 11:40 am
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)

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

Posted: Thu Jun 20, 2013 5:28 pm
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.

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

Posted: Thu Jun 20, 2013 8:23 pm
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...

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

Posted: Thu Jun 20, 2013 9:58 pm
by Assaf Raman
I fixed the mutex\boost issue, get the latest 1.9 and you will be fine.

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

Posted: Thu Jun 20, 2013 10:27 pm
by masterfalcon
The link error has been fixed as well. Will merge to 2.0 tonight so you can sync your repo.

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

Posted: Tue Jun 25, 2013 4:32 pm
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.

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

Posted: Tue Jun 25, 2013 4:46 pm
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 ?

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

Posted: Tue Jun 25, 2013 4:51 pm
by ja0335
The mutexes.....
OGRE_MUTEX, OGRE_LOCK_MUTEX identifier not found

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

Posted: Tue Jun 25, 2013 5:09 pm
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.

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

Posted: Wed Jun 26, 2013 4:28 pm
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 ?

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

Posted: Wed Jun 26, 2013 5:14 pm
by Assaf Raman
What do you mean by "texture unit"?

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

Posted: Wed Jun 26, 2013 5:17 pm
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)

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

Posted: Wed Jun 26, 2013 6:00 pm
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

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

Posted: Wed Jun 26, 2013 11:28 pm
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

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

Posted: Thu Jun 27, 2013 3:06 pm
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 ?

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

Posted: Fri Jun 28, 2013 1:23 am
by ja0335
A more improved result in the rendering...

Image

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

Posted: Fri Jun 28, 2013 4:06 pm
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.

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

Posted: Sat Jun 29, 2013 12:14 am
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.

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

Posted: Mon Jul 01, 2013 9:50 pm
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. :)