» DDS Ring Buffer
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

DDS Ring Buffer

plugin
Credits: elliotwoods

about

Currently hardcoded for DXT5

Introduction

I know a few of you are streaming DDS's off the HDD to playback video. Here's a ring buffer to do that.

Notes

  • All file loading is performed in off-mainloop threads
  • Pushing to GPU is performed on main thread (as required in DX9)
  • TextureUtils provides a mechanism to create textures from files (e.g. DDS), we use this mechanism for the first frame
  • Remaining frames with same resolution will be copied to GPU with an UpdateTexture function*
  • Keeps persistent memory buffers between frames if the file sizes are the same (i.e. true of DDS)

(*) I've manually coded the UpdateTexture function to parse the DDS file header and contents, and push the contents to the GPU without recreating the texture

DXT5 lookups are slow?

We didn't end up using this plugin, as we found that texture lookups became slower on DXT5 compared to X8R8G8B8 textures (hits the render stage).

I think in general this effect is negligible, but for the amount of texture lookups we're using (7 * HD in PS 3.0 on Radeon 6970's) it became a noticeable hit (dropped to 40fps min framerate vs 60-synced before). This effect continued after the texture was loaded (i.e. the slowdown was purely at render time).

The hypothesis that a texture lookup on DXT5 takes more GPU time than from an X8R8G8B8 makes theoretical sense, but might turn out to be incorrect. However, it is in line with our tests here.

download

EX9.TextureDDSBuffer.dll_.zip
22.08.12 [13:46 UTC] by catweasel | 829 downloads
DDS Ring Buffer v0.1

flux 22/08/2012 - 15:54

Nice, unfortunately it doesn't work on my machine. (Renderer stays black, node gets red when changing the value on the index pin)... any idea why?

elliotwoods 22/08/2012 - 15:59

@flux

thanks for the feedback
this is tested on b27. works across 3 machines here.
do you get anything in Renderer TTY?
which vvvv you on?

circuitb 22/08/2012 - 16:33

works here under beta28 with the
\vvvv_45beta28\lib\assets\images\meso_cubemap.dds = DXT format
but not with
\vvvv_45beta28\lib\assets\images\color_cubemap.dds which is a X8R8G8B8 texture

00:05:04 ERR : Exception occured in TMPluginWrapperNode.Evaluate: File format not supported by DDSFile

elliotwoods 22/08/2012 - 17:07

aha yes.
it's hardcoded for DXT5's right now! :)
will add that to the description

flux 22/08/2012 - 17:12

@elliot

sorry i forgot, i tested it on beta28. And i think it was the same issue circuitb mentioned. A8R8G8B8 dds textures don't seem to work. i got it running with dxt5 compressed ones on b27 and 28.

circuitb 24/08/2012 - 18:29

a spreadable version sounds possible?

elliotwoods 25/08/2012 - 15:58

yes.
certainly possible.
it's not going to be very tidy for changing spread-count
accidentally feeding in a large spread is going to either:
a) be capped (i.e. hard cap on number of slices)
b) crash (you'll allocate too much cpu and gpu ram)

is this something immediately useful?
i haven't got the source here anymore

circuitb 25/08/2012 - 18:15

no not really in a hurry just testing best ways to read image sequences
for something like 5 sequences of 200 frames ...
i duplicate the dds ring buffer node
everything is fine with a smooth playback!

but be careful with the buffercount value
vvvv dedicated memory get bigger and bigger each time you change this value (increase or decrease)... when it reaches the memory limit DDS nodes turns red and you need to restart vvvv to clear the allocated memory.

elliotwoods 26/08/2012 - 14:00

interesting.
i'm using byte arrays for storage which you can't actively flush (the .NET garbage collector is supposed to clean that up when it feels like).
I can provoke the garbage collector to get on with its job whenever you ask as well, so I can do that when the pin's changed
(flushing GC manually results in a temporary pause of the whole app, something like 50ms)

circuitb 26/08/2012 - 15:06

yep could be cool to manually flush the memory without restarting vvvv!

also the plugin doesn't work with the sharedtexture /dx9ex switch

anonymous user login

Shoutbox

~1d ago

joreg: 12 session online vvvv beginner course postponed to start November 4th: https://thenodeinstitute.org/courses/ws24-5-vvvv-beginners-class/

~12d ago

~21d ago

joreg: Webinar on October 2nd: Rhino meets Realtime with vvvv https://visualprogramming.net/blog/2024/webinar-rhino-meets-realtime-with-vvvv/

~21d ago

joreg: 12-session online vvvv beginner course starting October 7th: https://thenodeinstitute.org/courses/ws24-5-vvvv-beginners-class/

~26d ago

joreg: Introducing: Support for latest Ultraleap hand-tracking devices: https://visualprogramming.net/blog/2024/introducing-support-for-new-ultraleap-devices/

~30d ago

joreg: 2 day vvvv/fuse workshop in Vienna as part of NOISE festival on Sept. 13 and 14: https://www.noise.ist/vienna

~1mth ago

joreg: New beginner video tutorial: World Cities https://youtu.be/ymzrK7tZLBI

~1mth ago

catweasel: https://colour-burst.com/2023/01/26/macroscopic/ yeah, ' is there anyone who cares about slides anymore...' Well me for a start! :D

~2mth ago

ventolinmono: The ELMO TRV-35 slides into your video feed > https://youtu.be/pcIM9mh1c9k?si=iB4FOfI2D6y0iETy

~2mth ago

joreg: The summer season of vvvv workshops is now complete, but you can still get access to all the recordings: https://thenodeinstitute.org/ss24-vvvv-intermediates/