ND2Dx Update: SWC + Dynamic Mesh (Updated: fixed index batching bug)

1 Flares Twitter 0 Facebook 0 Google+ 1 Email -- Filament.io 1 Flares ×

**

Update

Fixed out of bound index bug in batching classes.

**

As promised, here is the new update with:

2 new SWCs

ND2Dx_fastmem.swc

this one is the most powerful. It uses the fastmem opcodes (ByteArray fast domain memory access) to batch and upload mesh data to the GPU. This is the one you want to use if you need that special boost in performance and if you’re not using the fastmem opcodes elsewhere in your project (or it will break ND2Dx)

ND2Dx.swc

this one is the “less” powerful (but by a slight margin) as it batches and upload meshes to the GPU using a vector. This is the one you want to use if you’re using the fastmem opcodes for your own needs.

Why those SWCs ?

because ND2Dx contains a couple of compile time constants that make it difficult to quickly setup a project. Now with these two SWCs, you can choose the one you’d like to work with and it will work out of the box !

In case you need to compile ND2Dx from the sources, here are the compile time constants you will need to setup:

WGM::IS_EDITOR,false
WGM::IS_RELEASE,true
ND2DX::USE_DOMAIN_MEMORY_BATCHING,true (set this one to true if you want to use the fastmem opcode, or else set it to false)
ND2DX::USE_VECTOR_BATCHING,false (set this one to true if you want to use the vector batching approach, or else set it to false)

It is very important that USE_DOMAIN_MEMORY_BATCHING and USE_VECTOR_BATCHING have different values. Either you chose one or the other, not both or it will break the whole thing (and you might not even notice it straight away)

Dynamic Mesh system

now the TexturedMeshRendererComponent also accept a Mesh2D object and renders it while still preserving the batch (taking into account that you don’t do anything to break it: different texture, different shader, scissor rect, etc…)

Everything you need is on GitHub !

It’s here.

And if you need direct access to the SWCs, here they are:
ND2Dx_fastmem.swc
ND2Dx.swc

And an example of what you can do with the new Dynamic Mesh system

(sources of all the examples is available on GitHub)

Of course this is just an example. You could do many more things with a dynamic mesh (or shall we simply call it a “mesh” ?) and produce any shape that you need.

Get Adobe Flash player

1 Flares Twitter 0 Facebook 0 Google+ 1 Email -- Filament.io 1 Flares ×

3 Comments

Leave a Comment