Sign in to follow this  

Appending to an append buffer several times

This topic is 1052 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. Is it possible to append to an append buffer several times in one thread, say in a loop? All examples i have seen just consume and append or append a new item but once per thread.

For example, would something like this work:

 

Item newItem;

 

for( uint i=0; i< N; ++i)

{

     newItem.param = i;

     AppendBuffer.Append( newItem );

}

 

Thanks.

Share this post


Link to post
Share on other sites

Thank you for reply. I just did not want to take some unnecessary steps. If the answer was no, i would try some walkaround, if nobody answered, i would  try it and share the result. Luckily you had the answer. Thank you again.    

Share this post


Link to post
Share on other sites

No problem. Please share your results anyway. I just used it once as a "debug log", not for actual useful stuff. But it was a loop, even with [tt][allow_uav_condition][/tt]. Since append doesn't guarantee order - at least not across threads - I wonder about this for several appends from the same thread.

Share this post


Link to post
Share on other sites

OK, it can take up to couple of days though. It is a part of a a little bigger thing, so i am not testing now anything, just thinking what disigne pass to take. And i dont care about the order just want to add new items to the whole bunch, then they are all treated in the next dispatch on equal terms. 

Share this post


Link to post
Share on other sites

You can, but keep an eye on performance. The more you write to an UAV, the less scalable the performance will be across multithreading hardware, which means performance may be greatly affected with each additional use if the GPU can't hide the latency.

Share this post


Link to post
Share on other sites

OK, i have sort of finished it. The idea was to take one couple of append buffers and use them as a "fragment" buffers that can spawn particles to other append buffers based on a passed distance. The particals then are expanded to sprites. The sphere was completely expanded in a domain shader from a single vertex and i move its vertices with displacement map. So the whole process takes place on the gpu only. i dont like the way sprites interact though, case insted of blending to each other they blick and everything. http://youtu.be/ky1hmEFKOV4

Edited by newMe

Share this post


Link to post
Share on other sites

I'm guessing that your flickering is due to the non-deterministic ordering of particles in your append buffer. If you want to alpha blend the particles, then you'll need to sort them based on their distance from the camera.

Share this post


Link to post
Share on other sites

This problem started when i changed blending stage settings. But before that i had another problem. Transparent edges of my sprites where eating through other sprites like in this problem http://www.gamedev.net/topic/524664-transparent-png-on-texture/  Alphatocoverageenable worked fine but then i could not adjust transparency. I added some randomness to sprites and some rotation but when i use bandicam somehow this adjustments stop working i dont know why. With them it looks a bit better, can not record it though. Blickering is worse with bandicam too. Thats what i got so far.

 

I have sort of found a walkaround with this flickering. When fading, i render smoke to a tecture and render it with a sprite, i changed the smoke to spheres, insted of expanding them to sprite in the geometry shader expand them to spheres in the domain shader. It is strange though,how rendering to a texture is different from rendering to a back buffer. Looks like it is the same process, why does it flicker in the buffer then. 

 

http://www.youtube.com/watch?v=MEIDm-0sBAo

Edited by newMe

Share this post


Link to post
Share on other sites

This topic is 1052 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this