Quantcast
Viewing latest article 21
Browse Latest Browse All 4929

Resize video for use in VBO (or resize vbo)

Hi,
I am using a compute shader to constantly load the texture of a video onto the color buffer of a VBO. I know that you can change the size of a video during drawing, but I’d like to resize the video prior to loading it into the vbo. My current process is this:
setup:
-load the video
-create a vector of particles, where a particle is a struct with a position and color
-loop over the dimensions of the video, set the position of each particle
-allocate an ofBufferObject buf with the particles vector, create a vbo with buf as its color and position buffer
-bind the texture of the video and buf to the GPU
update:
-update the video
-in a compute shader, apply some effects to the colors of the video and then store the
new colors in buf
-in the compute shder, apply some effects to the positions of the particles in buf
draw:
-draw the VBO
This process works fine except that I can only render it to the size of the original video. So is there a way to either resize the VBO or resize the video?
My guess is something involving FBOs, or drawing the video at a new size and using the draw() method to pass it as a uniform texture to the compute shader, but I’d like some guidance as I proceed. Thanks!

4 posts - 2 participants

Read full topic


Viewing latest article 21
Browse Latest Browse All 4929

Trending Articles