DX11 DynamicBuffer Select

Hi all,
i would like to filter dynamically some elements in a buffer as “select” node does.
Any idea?

thanks

Depends on how exactly you want to do this, there are two ways:
Build new append buffer with only selected elements.
Add some kind of bool or int to your struct and mark them as selected.

Is your buffer is float3 or something?

Hi antokio,
yes this is exactly what i need, i have already the bool list as value buffer, and i have to filter a float3 buffer list,
but i don´t know how to deal with the append buffer.

yea append is a bit tricky, gimme min, i’ll try to hack it, not sure how to do duplicate slices tho

1 Like

@lasal, ok not sure if it’s totally correct, but look kinda ok ;]

there is also an example in dx11/girlpower/sm5/directcompute/dispatchinderect

CS_Select.zip (4.7 KB)

Hey almost!, thanks
i just have a constant count boolean list but not the count of enable elements, and i think this is the triky part,

Is there any way to get this count as buffer? just readback it to feed ElementCount in the renderer.

this is the only way yo get buffer of exact slice count you want, otherwise you have to do a bigger buffer, then you can use copyCounter and read it inside of the next shader to know how much elements you actually have…

you may optimize by making another compute that will read your bool buffer and output an int with count, so you don’t have to read back whole buffer but one slice… but this bit is more complex than that sadly

Thank you,
i´ll give a try, with GetDimensions and some logic it should work.

Also the sorting seems to be wrong, the output Index should be mapped to the passing elements count.
ummm not easy

ok there is no easy way to get append in order basically, also varying size of the buffer is bad, so i guess only way to do that properly is to make bigger buffer use this copycounter and so on

more of it, it’s basically really bad idea to connect anything to Element Count

uff, a bit out of my knowledge,
it shouldn’t´t be too complicated, in cpu is so easy
thanks anyway

I’ll check in the morning, just went for dinner.

1 Like

ok this is totally not easy to do that like select ;[
much more easier if you know index
CS_Select.zip (4.1 KB)

2 Likes

Wow i see, thanks man.
i´ll try to get the indexes in other way, but it doesn´t look easy since there is again other select involved.

Hey lasal i did few tests more, this one seems working, but adding binsizes brakes the order, because thread finishes with offset…
CS_Select2.zip (7.1 KB)

anyways will prolly have to dig a bit more…

Hey Thanks, actually i have already a working version but i have to clean it up, i´ll upload it soon.

Hey, here it is.
use it with particles pack.
TextureEmitter.zip (35.3 KB)

1 Like

cool! :)

lasal, in your bSprite_Indexed shader you used a relative path to the InstanceNoodles.fxh
it is better to include the fxh like that:
#include <packs\InstanceNoodles\nodes\modules\Common\InstanceNoodles.fxh>

ahh my mistake,
here the updated one.
TextureEmitter.zip (38.4 KB)

@tmp, feel free to add it to the particles pack if you find it useful

1 Like