Forums > Jitter

Texture 3D buffer to videoplane

November 5, 2007 | 1:00 am

Hello all,

Im trying to store video data into a 3D buffer using jit.gl.texture so that the third dimension of the texture corresponds to a specific frame of the video. If this is possible two questions.

How do you map a specific video frame to the third dimension of a the 3D texture?

How can you refer to this third dimension inorder to render the corresponding frame as a 2D texture using jit.gl.videoplane?

I’ve created a solution that uses jit.matrixset but it is not that efficient. Anywho any help would greatly be appreciated.

t


November 5, 2007 | 1:07 am

andrew b posted a patch in the recent past that used 3d textures and a
shader to do some time warping stuff. Currently in Jitter it is not
possible to modify a specific 2D slice of a 3D texture, so this is not
a good strategy for streaming footage until that functionality is
present as uploading all the data of a 3D texture can cause frame
drops. For more see his patch which is under the email title
"[sharingmakesmesleepy]time warp"

wes

On 11/4/07, Tyler Nitsch wrote:
>
> Hello all,
>
> Im trying to store video data into a 3D buffer using jit.gl.texture so that the third dimension of the texture corresponds to a specific frame of the video. If this is possible two questions.
>
> How do you map a specific video frame to the third dimension of a the 3D texture?
>
> How can you refer to this third dimension inorder to render the corresponding frame as a 2D texture using jit.gl.videoplane?
>
> I’ve created a solution that uses jit.matrixset but it is not that efficient. Anywho any help would greatly be appreciated.
>
> t
>
>
>


November 5, 2007 | 3:49 pm

Thanks…. I already checked out Andrews patch awhile ago must of forgot his comment on updating 3D textures. Very cool patch though!

My work around for now involves creating a bank of textures t0, t1, t2….. and then making a circular buffer through indexing each texture and sending video content.

I tried to use just one texture and changing the @name before assigning a new matrix but as soon as you change the name it seems the old texture ‘@name old’ is no longer available. Is there someway of overriding this?


November 5, 2007 | 3:56 pm

No. You have to keep all instances around. I beleive I posted a
javascript that makes a circular buffer out of 2D textures.

wes

On 11/5/07, Tyler Nitsch wrote:
>
> Thanks…. I already checked out Andrews patch awhile ago must of forgot his comment on updating 3D textures. Very cool patch though!
>
> My work around for now involves creating a bank of textures t0, t1, t2….. and then making a circular buffer through indexing each texture and sending video content.
>
> I tried to use just one texture and changing the @name before assigning a new matrix but as soon as you change the name it seems the old texture ‘@name old’ is no longer available. Is there someway of overriding this?
>
>
>


November 5, 2007 | 5:09 pm

Is there any way to add a slice to an existing 3D texture without
uploading the whole ‘cube’? This would afford huge speed gains.

If I bind an empty 3D texture, can I use sampler3D, force the last 3D
coord to be ‘constant’ for the frame and pop in a sampler2D/2dRect?

Ive seen this technique before used outside of jitter, but I was under
the impression (I believe I asked if 3D textures were supported, and
thought the answer was no) that sampler3D is not supported? So one can
have 3D textures, not 3D samplers in a shader?

I somehow missed this thread until now as well. Awesome awesome patch.

So, in short, can I bind a jit.gl.texture @dim 720 480 60 with a
sampler3D within a jit.gl.shader / slab?

I suppose I could have tried it in the time ive been writing this
email. hah. Sorry. :)

On Nov 5, 2007, at 10:56 AM, Wesley Smith wrote:

> No. You have to keep all instances around. I beleive I posted a
> javascript that makes a circular buffer out of 2D textures.
>
> wes
>
> On 11/5/07, Tyler Nitsch wrote:
>>
>> Thanks…. I already checked out Andrews patch awhile ago must of
>> forgot his comment on updating 3D textures. Very cool patch though!
>>
>> My work around for now involves creating a bank of textures t0, t1,
>> t2….. and then making a circular buffer through indexing each
>> texture and sending video content.
>>
>> I tried to use just one texture and changing the @name before
>> assigning a new matrix but as soon as you change the name it seems
>> the old texture ‘@name old’ is no longer available. Is there
>> someway of overriding this?
>>
>>
>>


November 5, 2007 | 5:14 pm

Nevermind. I somehow missed the shader in there that has sampler3D. I
will shut up and rtfm, and report back when I have something cool
working :P

On Nov 5, 2007, at 10:56 AM, Wesley Smith wrote:

> No. You have to keep all instances around. I beleive I posted a
> javascript that makes a circular buffer out of 2D textures.
>
> wes
>
> On 11/5/07, Tyler Nitsch wrote:
>>
>> Thanks…. I already checked out Andrews patch awhile ago must of
>> forgot his comment on updating 3D textures. Very cool patch though!
>>
>> My work around for now involves creating a bank of textures t0, t1,
>> t2….. and then making a circular buffer through indexing each
>> texture and sending video content.
>>
>> I tried to use just one texture and changing the @name before
>> assigning a new matrix but as soon as you change the name it seems
>> the old texture ‘@name old’ is no longer available. Is there
>> someway of overriding this?
>>
>>
>>


November 5, 2007 | 5:32 pm

FWIW, 3D texture management is one of the things rumored to be
investigated for the next major Jitter upgrade, so if you can stand to
wait…

Otherwise, the patch I posted should serve as a good general guide for
people wanted to work with 3D textures within a slab context in Jitter
until there are better methods.

For people just looking to do a circular buffer video-delay effects,
this will be best accomplished using a scripting language such as
JavaScript or Lua. I believe both Wes and myself have posted examples
of this in the past.

Best,
Andrew B.

vade wrote:
> Nevermind. I somehow missed the shader in there that has sampler3D. I
> will shut up and rtfm, and report back when I have something cool
> working :P
>


November 5, 2007 | 5:40 pm

Thanks Wes for the pointers… I dug up those javascript examples. This is some good motivation to start using javascript more often. … especially for multiple renderings of similar objects!

Andrew, when I’m completely versed in the current functionality of Jitter then maybe I’ll become impatient waiting for the next release ;-).


November 5, 2007 | 5:44 pm

Hi. Yeah i have a pretty decent javascript for a buffer of 2D
textures, but im realizing now that I probably will have to delve into
gl.lua to get 3D texture management so I can add slices to an existing
3D texture without re-uploading the whole texture. Oh, always
something new to learn. :P

Thanks,

On Nov 5, 2007, at 12:32 PM, andrew benson wrote:

> FWIW, 3D texture management is one of the things rumored to be
> investigated for the next major Jitter upgrade, so if you can stand
> to wait…
>
> Otherwise, the patch I posted should serve as a good general guide
> for people wanted to work with 3D textures within a slab context in
> Jitter until there are better methods.
>
> For people just looking to do a circular buffer video-delay effects,
> this will be best accomplished using a scripting language such as
> JavaScript or Lua. I believe both Wes and myself have posted
> examples of this in the past.
> y
> Best,
> Andrew B.
>
>
>
> vade wrote:
>> Nevermind. I somehow missed the shader in there that has sampler3D.
>> I will shut up and rtfm, and report back when I have something cool
>> working :P


December 17, 2010 | 4:11 pm

Hi,

With things coming like kinect, is there any plan for real time 3D texture shader management in jitter ?
Or I missed something?



Ad.
March 21, 2011 | 4:39 pm

Would anyone have the andrew’s Time warp patch ??
Thx !
Ad.



Ad.
March 23, 2011 | 4:25 pm

no one ?
Thx
Ad


March 23, 2011 | 7:35 pm

I think this is it, from 09/2007

Attachments:
  1. timewarp.zip


Ad.
March 23, 2011 | 10:04 pm

As always thank you Andrew !!!
Ad.


Viewing 14 posts - 1 through 14 (of 14 total)