Finally, a DirectX 10 video driver for Irrlicht

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Nadro »

Hi,

In my last commits I changed small part of DX11 driver related to register IVertexDescriptor. I also added support for multiple vertex buffers, but some methods still support just one vertex buffer and skip others. If you can please provide some feedback about last changes, dx11 need some features etc? Stream variables from vertex descriptor are removed just temporarily.

Cheers,
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Granyte »

I'm afraid to update to this version is it similar to my patch?

EDIT after taking a look at it i'm not sure I really like the fact that vertex descriptor have to be identical in a vertex buffer to be accepted in a mesh buffer

mine was using a descriptor for each stream and fusing them at run time to create the final descriptor

also how do we obtain the size of each component as it is required to upload the Meshbuffer if we don't have a descriptor for each stream?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Nadro »

Vertex descriptor should be the same for each vertex buffer. I don't see any advantages of mixing descriptors at run time, it will cause just many troubles.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Granyte »

Well the first advantage is the user is able to create a standardized per instance component he can just slap any where at any time.

the second advantage is it allows the reuse of the same instance data to redraw multiple component of something while these components might not use the same base vertex type.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Nadro »

Data which may change at runtime shouldn't be included in vertex descriptor, vertex descriptor should offer just pointer to a value where this data is available, thats how we can easy solve problems related to instancing. In this way user will be able to use the same vertex descriptor for both standard and instanced buffers. I'll commit those changes soon. Users whose defined vertex descriptor well, shoudn't need mixing vertex descriptors at run time. From eg. API point of view (OpenGL, but IIRC D3D9 works in similar way) current solution looks like this:
VAO - Vertex Descriptor (one VAO is available per draw call)
VBO - Vertex Buffer (multiple VBOs are available per draw call)
IBO - Index Buffer (one IBO is available per draw call)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Granyte »

Ill admit I don't understand where you are going but ill just wait and see and re write instancing again for dx9/11
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by zerochen »

Hi
Granyte wrote:One last thing the blending on example 10 is not working properly any one knows how to get it working? it seem like transparent material are zwritting
i think it is more a problem if you have more than one shader. that example uses a base shader (EMT_SOLID) but this is ignored for now because you cant set more than one shader to one draw call. i guess if you will add the shader of example 10 to the fixed function shader it would work (isnt it?).
thats also the reason why in example 11 parallax and bump mapping doesnt have fog...
robmar wrote:How about making a slight mod to take the core (old asm) shaders out of the source headers, and have them loaded from separate files?
maybe a new define like SHADER_DEBUG and if it is defined it tries to load the shaders from a file? we also need a function to change/set the fixed function shader.
robmar wrote: Also maybe drop having opengl and hsls and just use cg shader, or make that optional. I could convert some of them to C and also to Cg.
cg is from nvidia. it has poor performance on other hardware. so dropping is not good. maybe later someone can add this. but for now i dont see advantages.
Granyte wrote:the driver already kind of optimise if it uploads to the shader or not....but it does not upload to the non pixel shader stages
oh yes you are right. i can change that if nobody is working on it now...

regards
zerochen

edit: example 12 outputs now "Too many vertices for 16bit index type, render artifacts may occur." is this related to the lastest changes? (all drivers)...
edit2:
in CVertexBuffer.h

Code: Select all

        
virtual void set_used(u32 used)
        {
            Vertices.reallocate(used);
            
            for (u32 i = 0; i < used; ++i)
            {
                T element;
                Vertices.push_back(element);
            }
        }
this code will add elements if already are elements in the array... maybe a Vertices.clear(); before reallocate?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Nadro »

@zerochen
Thanks for a report. Fixed in the latest rev :)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Granyte »

i'm not touching anything until nadro is done with the meshbuffers
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Nadro »

Granyte wrote:i'm not touching anything until nadro is done with the meshbuffers
All should be done to the next week.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by zerochen »

hi nadro

i have a new patch. can you apply it?
here we go
http://www.file-upload.net/download-850 ... patch.html

most changes are made in CD3D11MaterialRenderer and CD3D11CallBridge.

changes:
- fix crash with resetting shaders
- changed behaviour if shaders are in one file or not
- moved printVersion to the right place
- shader resources are applied to every shader stage (if needed), also update it only if they has changed
- fix bug in CVertexBuffer: getVertexType() returns -1 if you use it with your own vertexdescriptor
- shaders are compiled with macros (at the moment only with MAX_TEXTURES - it has the same value as MATERIAL_MAX_TEXTURES)
- clean up

regards
zerochen
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Nadro »

Patch applied :) I just add check for null pointer in getVertexType().
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Darktib
Posts: 167
Joined: Sun Mar 23, 2008 8:25 pm
Location: France

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Darktib »

Hi there, I found a little bug in CVertexBuffer: the set_used method directly reallocate the buffer (which it should not). This can lead to weird behavior (have seen it with SPARK). But more importantly, this can be a huge performance problem.

So, this function:

Code: Select all

 
      virtual void set_used(u32 used)
      {
         Vertices.reallocate(used); // <-- this is the line to change
 
         while (Vertices.size() < used)
         {
            T element;
            Vertices.push_back(element);
         }
      }
 
Should be:

Code: Select all

 
      virtual void set_used(u32 used)
      {
         Vertices.set_used(used);
      }
 
Also, I maybe repeat an already known bug (I don't know), but setting the material via driver->setMaterial result in incorrect material (color & depth write ignored, at least).

Anyway, thanks for the amazing work that was put in this !
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Granyte »

the depth write for transparent object is broken in dx11 it can be seen in the example 10
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Finally, a DirectX 10 video driver for Irrlicht

Post by Nadro »

@Darktib
set_used is good just for plain types (missing constructor calls), thats why it was changed in last commit. Anyway maybe we should have two methods in CVertexBuffer:
1. set_used (missing constructor calls, anyway good for performance).
2. set_used_safe (reallocate + push_back, performance is worse than in method no. 1).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply