gpu.js icon indicating copy to clipboard operation
gpu.js copied to clipboard

Trying to make a frame buffer

Open ford442 opened this issue 5 years ago • 12 comments

Hey, I keep trying to pass a frame of video out from my GPU kernel, but I have been running into the fact that the kernel variables are seperate from the rest of my scripting in various ways.

I see that pipelining is what I want to accomplish. In order to pass the kernel(frame) into an array, arrayBuffer and back later.

I am somewhat beginner programmer. What is my best avenue to hand each frame into a javascript arrayBuffer? Is it to create another kernel instance? GPU instance? Use additional functions? Or, could I be getting the frames into the array in the first kernel, instead of rendering to the canvas?

I have been trying like

... pipeline: true, ...

then

var blank = kernel(); or var blank = kernel(array); or var blank = kernel(videoElement); or var array; var frm = kernel(array); var frmm = frm[0]; fbuffer.set([frm], 0);

after the kernel invocation to try to grab the frame into a variable however possible. I get 0 or undefined so far. Should i be doing this inside the kernel or is it better suited in the render() part of the javascript later?

My project is to splice clips together in real time to make seamless transitions using a 5 - 10 second buffer.

You can see what I've been doing here - https://b3hd.1ink.us

spliced clips - https://b3hd.1ink.us/behanced2/beta13.php

arrayBuffer attempt - https://b3hd.1ink.us/behanced2/exp1.php

ford442 avatar Jun 02 '20 07:06 ford442