Forum

DX11 DynamicBuffer Select


#2

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?


#3

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.


#4

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


#5

@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)


#6

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.


#7

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


#8

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


#9

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


#10

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


#11

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


#12

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


#13

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


#14

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.


#15

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…


#16

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


#17

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


#18

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>


#19

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


#20

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


closed #21

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.