Flexible Vertex Format - special SVN branch is ready!!!

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Granyte »

I also added an array to the meshbuffer for instancing or anything that require multiple stream but that part is still broken
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Nadro »

I'll back to develop this branch as soon as possible, so after v1.9 will be mostly done (stable mobile devices support). Anyway I'll try to find some free time to implement multiple vertex buffers support + fix issue related to D3D9 vertex descriptor.
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: Flexible Vertex Format - special SVN branch is ready!!!

Post by Granyte »

I have multiple vertex buffer and dx9 vertex descriptor so far the only issue I have is dx9 hardware buffer behaving oddly

Edit this has been fixed and I have a proper instancing patch that goes on top of this for now it's only dx9 but ill work on dx11 and some one could get OGL working

if you have time to take a look I can upload a preview of the state it currently is
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Nadro »

You can upload preview patch, I'll look at it.
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: Flexible Vertex Format - special SVN branch is ready!!!

Post by Granyte »

https://www.dropbox.com/s/d6xb47auy4u8e ... view.patch

so far every thing seem to work fine

most of the modification are to the mesh loaders

EDIT: this patch as a few known issue :
-quake3 map loader does not have it's mesh buffer created properly
-Octreescenenode does not have it's mesh buffer created properly
-obj mesh loader has a pointer redeclared
-sometime the last vertex attribute of an element is not compiled properly under dx9(this break instancing)


these issue are fixed on my side but I haven't uploaded the patch yet


EDIT 2: found a bug in dx9 driver the FVF dx9 driver does not set vertex texture transform

EDIT 3: added EVAS_POINT_SIZE to expose dx9 feature
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Granyte »

I got instancing to work with the last FVF patch

and it would seem the sethardwaremappinghint function does not properly works I have to bypass the gethardwaremappinghint in the decision to upload buffers to get anything to render even if I set the hardwaremappinghint for every buffer

also we will need to calculate the offset per buffer int

and the set offset function was not exposed in IVertexdeclaration
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Nadro »

Thanks for a report, I'll fix it as soon as possible. In last days I didn't have too much time for FVF. Offset should be automatic calculate by an engine, thats why this method isn't expose (calculation should run after each addAttribute call). Today I'll change my dev platform (switch to A10-7850K), so I will have a problems with time for programming, but tomorrow I'll try to check this patch and implement it to core if possible.
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: Flexible Vertex Format - special SVN branch is ready!!!

Post by Granyte »

alright ill finish it up and upload it later today
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Granyte »

https://www.dropbox.com/s/b6zmzg4n3tqyc ... gdx9.patch


here we go I implemented it only for dx9

EDIT the code contain a lot of debug logging I forgot to put it into a debug define
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by zerochen »

hi,

it would be nice to have an example for this. do you have one? so it can be tested.

regards
zerochen

edit:
in deleteHardwareBuffer line

Code: Select all

HWBuffer->vertexBuffer.erase(1);
should crash if vertexBuffer size != 0.
maybe something like this:

Code: Select all

    for (s32 i = HwBuffer->vertexBuffer.size() - 1; i >= 0; --i)
    {
        if (hwBuffer->vertexBuffer[i])
        {
            hwBuffer->vertexBuffer[i]->Release();
            hwBuffer->vertexBuffer[i] = NULL;
        }
        hwBuffer->vertexBuffer.erase(i);
    }
Last edited by zerochen on Fri Jan 24, 2014 3:25 pm, edited 1 time in total.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Nadro »

@Granyte
I should integrate this patch before saturday.

I agree with zerochen that it'll be nice to have example for this new feature :)
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: Flexible Vertex Format - special SVN branch is ready!!!

Post by Granyte »

I have one but it's broken atm it still use the old version of the multi VB patch.

I will finish rebuilding it and put the fixes for the code that should only be enabeled in debug mode then ill upload a new version later tonight
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Granyte »

line 656 of CD3D9Driver
should be

Code: Select all

    MaxTextureUnits = MATERIAL_MAX_TEXTURES;
instead of

Code: Select all

    MaxTextureUnits = core::min_((u32)Caps.MaxSimultaneousTextures, MATERIAL_MAX_TEXTURES);
the caps viewer feature called support only the fixed pipeline so currently the dx driver is artificially limited to fixed pipeline capabilities I recall reporting this same bug for the trunk so it might just be the shader branch did not get the patch
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by zerochen »

hi,

in bool CD3D9Driver::updateHardwareBuffer(SHWBufferLink *hwBuffer)

should be

Code: Select all

    if (hwBuffer->Mapped_Vertex!=scene::EHM_NEVER)
    {
 
 
        if (!updateVertexHardwareBuffer((SHWBufferLink_d3d9*)hwBuffer))
        {
            os::Printer::log("Failed Update Vertex Hardware Buffer");
            return false;
        }
    }
instead of with

Code: Select all

if (hwBuffer->ChangedID_Vertex[0] != hwBuffer->MeshBuffer->getChangedID_Vertex()
          || !((SHWBufferLink_d3d9*)hwBuffer)->vertexBuffer[0] || hwBuffer->ChangedID_Vertex[1] != hwBuffer->MeshBuffer->getChangedID_Vertex(1))...

the check is done by updateVertexHardwareBuffer now and with it would crash if the meshbuffer == 1

regards
zerochen

edit: it might be also good to set MinVertexCountForVBO to 0 otherwise small vertex meshes cant be instanced?
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Granyte »

yes the min vertex for vbo need to go down

and yes in theory the function should be this way but the vertex buffer hardware mapping flag was doing some very spooky stuff and it degenerated to this befor I found the issue
Post Reply