DirectX 11 render system - work-in-progress
- ahmedismaiel
- OGRE Contributor
- Posts: 217
- Joined: Wed Jan 25, 2006 11:16 pm
- Location: Redmond,WA
-
- Halfling
- Posts: 94
- Joined: Sun Dec 19, 2004 7:12 pm
- Location: Finland
- x 3
- Contact:
I am getting the following error when trying to compile the DX 10 render system:
Error 4 error C2259: 'Ogre::D3D10HardwareBufferManager' : cannot instantiate abstract class c:\libs\ogre\rendersystems\direct3d10\src\ogred3d10rendersystem.cpp 818
I have redownloaded the source from SVN to make sure it is intact. I am compiling using Visual Studio 2008.
Error 4 error C2259: 'Ogre::D3D10HardwareBufferManager' : cannot instantiate abstract class c:\libs\ogre\rendersystems\direct3d10\src\ogred3d10rendersystem.cpp 818
I have redownloaded the source from SVN to make sure it is intact. I am compiling using Visual Studio 2008.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
I added an empty implementation for createRenderToVertexBuffer to solve the compile error.
You can get the code from the SVN and it will compile.
You can get the code from the SVN and it will compile.
Watch out for my OGRE related tweets here.
-
- Halfling
- Posts: 94
- Joined: Sun Dec 19, 2004 7:12 pm
- Location: Finland
- x 3
- Contact:
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
-
- Halfling
- Posts: 94
- Joined: Sun Dec 19, 2004 7:12 pm
- Location: Finland
- x 3
- Contact:
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
- ahmedismaiel
- OGRE Contributor
- Posts: 217
- Joined: Wed Jan 25, 2006 11:16 pm
- Location: Redmond,WA
it was sometime since last post, got some progress with compositors,render targets and cube mapping.here is a screen of what i have so far
I'm currently not setting the render operation state D3D10RenderOperationState in the renderable so the frame rate shown here is not what it should be(should be 70-90% faster).the reason i had to disable it is the fact that the object is rendered differently in terms of shaders ,sampler when
1-rendering to shadow texture
2- rendering to a normal scene
the current render operation state captures the first one and reuse it for all of the subsequent operations,so i would like to get your ideas on this design issue .i'll try to come up with one and propose it here
i promise i'll document the list of fixes in a later post along with the patch as soon as i catch my flight to Redmond tommorow and have my first day as a Microsoft Employee
hopefully i'll get back soon to continue my trials with shadows
I'm currently not setting the render operation state D3D10RenderOperationState in the renderable so the frame rate shown here is not what it should be(should be 70-90% faster).the reason i had to disable it is the fact that the object is rendered differently in terms of shaders ,sampler when
1-rendering to shadow texture
2- rendering to a normal scene
the current render operation state captures the first one and reuse it for all of the subsequent operations,so i would like to get your ideas on this design issue .i'll try to come up with one and propose it here
i promise i'll document the list of fixes in a later post along with the patch as soon as i catch my flight to Redmond tommorow and have my first day as a Microsoft Employee
hopefully i'll get back soon to continue my trials with shadows
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Nice work!.
Good luck with the new job, I am sure you will have fun there at Redmond.
Good luck with the new job, I am sure you will have fun there at Redmond.
Watch out for my OGRE related tweets here.
- overburn
- Greenskin
- Posts: 120
- Joined: Thu Mar 15, 2007 10:37 am
- Location: Romania, Ploiesti
- x 1
- ahmedismaiel
- OGRE Contributor
- Posts: 217
- Joined: Wed Jan 25, 2006 11:16 pm
- Location: Redmond,WA
@overburn :from what i seen in the last couple of weeks the plugin is pretty much done.if you have your shaders running o DX9 already with very few changes you can get your scene running on DX10 and if you are facing problem report to this thread
here is a screen from PSSM shadows on DX10,there is a small bug in depth stencil texture that i haven't figured out yet making the color red is the preview
here is a screen from PSSM shadows on DX10,there is a small bug in depth stencil texture that i haven't figured out yet making the color red is the preview
- ahmedismaiel
- OGRE Contributor
- Posts: 217
- Joined: Wed Jan 25, 2006 11:16 pm
- Location: Redmond,WA
i got a few minutes to create the patch and document the changes
http://cid-a4e091b279e12391.skydrive.li ... ixes.patch
the changes are
1.fix in rendersystem setSceneBlending to diable blending if sourceFactor == SBF_ONE && destFactor == SBF_ZERO
2.small fix for 1D texture loading and mipmaps
3.fixed a crash in render texture destruction (D3D10HardwarePixelBuffer::~D3D10HardwarePixelBuffer)
4.-fixed cube mapping in fixed function generator
5.added global ambient lighting to fixed function generator
6.fixed colour blending
7.enabled debug shaders with source in pix (available in debug mode only)
8.got perfHUD debugging to work
9.added ShaderSource variable available in debug mode only to view source code of generated Fixed Functions
10.infrastructure for geometry programs (creation ,loading) and stream out buffers (didn't implement the update function yet ,as soon as it's done i'll be able to run the particlesGS example on Dx10)
11.enahanced error reporting in D3D10VertexDeclaration::getILayoutByShader
12.added a few hlsl10 materials like pssm ,post process blur as an example of some stuff working (works in playpen or in compositor)
there is an optional part that i needed for my work (i strongly suggest it)
13.textures when missing fallback to load a texture named Missing.png (just checkers) ,if i didn't do this shader resource view bindings will crash
what doesn't work yet is
1-creation of 3d textures (example in halftonevolume in Compositor sample).the problem i couldn't understand how a static write only texture when locked return 0?!
i know you have done a great job working with textures ,it's probably better if you had a look at this one
2-caching the render data is disabled ,still havn't came up with a valid solution
i'll be coming back with more fixes as soon as i settle in my new city
http://cid-a4e091b279e12391.skydrive.li ... ixes.patch
the changes are
1.fix in rendersystem setSceneBlending to diable blending if sourceFactor == SBF_ONE && destFactor == SBF_ZERO
2.small fix for 1D texture loading and mipmaps
3.fixed a crash in render texture destruction (D3D10HardwarePixelBuffer::~D3D10HardwarePixelBuffer)
4.-fixed cube mapping in fixed function generator
5.added global ambient lighting to fixed function generator
6.fixed colour blending
7.enabled debug shaders with source in pix (available in debug mode only)
8.got perfHUD debugging to work
9.added ShaderSource variable available in debug mode only to view source code of generated Fixed Functions
10.infrastructure for geometry programs (creation ,loading) and stream out buffers (didn't implement the update function yet ,as soon as it's done i'll be able to run the particlesGS example on Dx10)
11.enahanced error reporting in D3D10VertexDeclaration::getILayoutByShader
12.added a few hlsl10 materials like pssm ,post process blur as an example of some stuff working (works in playpen or in compositor)
there is an optional part that i needed for my work (i strongly suggest it)
13.textures when missing fallback to load a texture named Missing.png (just checkers) ,if i didn't do this shader resource view bindings will crash
what doesn't work yet is
1-creation of 3d textures (example in halftonevolume in Compositor sample).the problem i couldn't understand how a static write only texture when locked return 0?!
i know you have done a great job working with textures ,it's probably better if you had a look at this one
2-caching the render data is disabled ,still havn't came up with a valid solution
i'll be coming back with more fixes as soon as i settle in my new city
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Thank you very much for your contribution. Such a long list of changes, you are the first to help me with this render system and I Welcome the help – keep it coming.
Did you sign the “OGRE Contributor License Agreementâ€
Did you sign the “OGRE Contributor License Agreementâ€
Watch out for my OGRE related tweets here.
- ahmedismaiel
- OGRE Contributor
- Posts: 217
- Joined: Wed Jan 25, 2006 11:16 pm
- Location: Redmond,WA
as i said earlier i contributed with the initial version of the plugin just didn't find time completing because of my previous job,look at the second post of this forum from sindbad
i already signed that back then ,if you want me to sign it again that would be fine too ,i hope microsoft doesn't keep me busy from working on this plugin again!
that was meThanks Assaf - someone else emailed me some work-in-progress too so I shall attempt to unify & finish everything It's a spare-time activity though so it might be a while.
i already signed that back then ,if you want me to sign it again that would be fine too ,i hope microsoft doesn't keep me busy from working on this plugin again!
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
No need, I did not know.ahmedismaiel wrote:...I already signed that back then ,if you want me to sign it again that would be fine too...
I will have a look and commit as fast as I can.
Great great work.
BTW: Can you ask the guys in Microsoft when the d3d11 is going to be released? Is it going to be the November release?
Watch out for my OGRE related tweets here.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
@ahmedismaiel: Your code is committed to the SVN.
I am proud to give you the contributor forum badge on behalf of the OGRE team for the big work that is included in your last patch.
I am proud to give you the contributor forum badge on behalf of the OGRE team for the big work that is included in your last patch.
Watch out for my OGRE related tweets here.
- ahmedismaiel
- OGRE Contributor
- Posts: 217
- Joined: Wed Jan 25, 2006 11:16 pm
- Location: Redmond,WA
- Noman
- OGRE Retired Team Member
- Posts: 714
- Joined: Mon Jan 31, 2005 7:21 pm
- Location: Israel
- x 2
- Contact:
Nice job ahmedismael!
About steam out implementation in DX10. I haven't looked at what you've done so far, but the implementation will be slightly harder than GL.
Since DX doesn't feed you back the number of vertices generated, you don't have enough information to feed to the Draw() call. For this they introduced DrawAuto(), which needs to be used instead when rendering the R2VB's.
I think Assaf introduced the concept of rendersystem-specific data for a render operation (or was it a renderable?). A boolean 'isStreamOutBuffer' will need to be added to it, and be filled appropriately in the R2VB implementation.
Then, when the render system is about to render a RenderOperation, it will check the flag and use Draw or DrawAuto where appropriate.
(Rain in the middle of the vacation sucks, btw)
About steam out implementation in DX10. I haven't looked at what you've done so far, but the implementation will be slightly harder than GL.
Since DX doesn't feed you back the number of vertices generated, you don't have enough information to feed to the Draw() call. For this they introduced DrawAuto(), which needs to be used instead when rendering the R2VB's.
I think Assaf introduced the concept of rendersystem-specific data for a render operation (or was it a renderable?). A boolean 'isStreamOutBuffer' will need to be added to it, and be filled appropriately in the R2VB implementation.
Then, when the render system is about to render a RenderOperation, it will check the flag and use Draw or DrawAuto where appropriate.
(Rain in the middle of the vacation sucks, btw)
-
- Kobold
- Posts: 36
- Joined: Mon Apr 21, 2008 10:03 pm
I have a few questions about this DX10 renderer. I'm just getting into DX10 because I've read such good things about how much more it can squeeze out of shaders, but so far it has been very troubling and I haven't seen much in return. I've gotten your plugin from the trunk on SVN and I have gotten a syntax error for SceneBlendOperation. It's not defined anywhere, did I get the right version? In any case, I commented out the errors and I was able to get it to build. Running some of the demos that I could didn't impress me very much. When I run the smoke demo, for instance, in DX9 I get roughly 1700 frames, but when I run it in DX10 I get about 250. Is this due to the renderer? The shaders not written properly for DX10? Or the actual project? I'm just feeling a little discouraged because I was expecting great things, but so far I've only seen sub par results and been left with much confusion.
- ahmedismaiel
- OGRE Contributor
- Posts: 217
- Joined: Wed Jan 25, 2006 11:16 pm
- Location: Redmond,WA
i'm glad that DX10 renderer captured your attention ,
the issue of the frame rate is known (it due some objects needed to be cached correctly across Multiple rendered perframe ex.shadows) if your scene doesn't plan to use shadows i can get u the 1700 FPS back with a single line uncommented in _render ,but i don't think that should stop you from early adobting the plugin ,one this is fixed you get the FPS boost in your application for free!
i cann't comment on the syntax error because i haven't pulled the latest trunk for a while
the shaders are fine ,don't get discouraged it'll all get better soon.people like you help alot increasing the plugin quality
the issue of the frame rate is known (it due some objects needed to be cached correctly across Multiple rendered perframe ex.shadows) if your scene doesn't plan to use shadows i can get u the 1700 FPS back with a single line uncommented in _render ,but i don't think that should stop you from early adobting the plugin ,one this is fixed you get the FPS boost in your application for free!
i cann't comment on the syntax error because i haven't pulled the latest trunk for a while
the shaders are fine ,don't get discouraged it'll all get better soon.people like you help alot increasing the plugin quality
-
- Kobold
- Posts: 36
- Joined: Mon Apr 21, 2008 10:03 pm
Awesome, thanks for the quick reply. I am not currently using shadows in my project so I think I'd benefit from the extra frames for now. I guess I'm also interested in why some of the samples work and some don't. The ocean demo in particular. I understand the shader language is different, but how different are these shaders? Do you think I'd be better off re-writing the shader from scratch or is it portable? Thanks again for the help.
- Assaf Raman
- OGRE Team Member
- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
@jonmiller: this render system is not finished. Regarding your problem - I guess the render system and the ogre version you have don't match. Where did you get the code from (for ogre and the render system)
Watch out for my OGRE related tweets here.
-
- Kobold
- Posts: 36
- Joined: Mon Apr 21, 2008 10:03 pm
I understand that it's not finished, so I didn't mean to come off as rude asking why it doesn't work perfectly. I just saw that you were able to run some of the demos right off the bat but then others it seemed like you had to do some extra work to get them to run with the new renderer. I'm trying to understand what the differences are between them and what I can do to get them to run also. I'm mainly interested in the ocean demo as I'm trying to convert a modified version of that to DX10 to see what kind of performance gains i can get vs DX9. I was just confused when I saw the frame difference between the DX9 and DX10 renderer.
I'm using Ogre 1.6 from the website and I got the DX10 render plugin from the SVN trunk. Is that the correct version, or is there another one that I should work with?
I'm using Ogre 1.6 from the website and I got the DX10 render plugin from the SVN trunk. Is that the correct version, or is there another one that I should work with?