Transparent texture on a gridshape
What would be the easiest way to create a transparent texture on a gridshape such as a cube? blend_enable is on but I'm not sure what to send to jit.gl.texture to make a simple texture transparent?
Can anyone please help?
Thanks
Rhys
make sure there is information in the alpha channel. Jitter CPU based
matrixes have alpha in plane 0, ARGB format. OpenGL is typically RGBA
format.
you can pack/unpack or use @planemap to fudge an alpha, etc, or just
make one with an app pretty easily.
On Mar 15, 2007, at 8:26 AM, Rhys Perkins wrote:
>
> What would be the easiest way to create a transparent texture on a
> gridshape such as a cube? blend_enable is on but I'm not sure what
> to send to jit.gl.texture to make a simple texture transparent?
>
> Can anyone please help?
>
> Thanks
>
> Rhys
v a d e //
www.vade.info
abstrakt.vade.info
If you just want your texture to be translucent, with no variation, try
using @color 1. 1. 1. 0.1 (the last number is alpha value) on your
gridshape object. You can adjust the alpha value of the color to get
the optimum transparency. You might also play a bit with different
blend_mode settings, such as additive blending (@blend_mode 6 1). For
some other alpha generation tricks, there are a couple of ideas in my
Jitter Recipes.
Cheers,
Andrew B.
I'm having a horrible time trying to get any transparency in my shape can anyone please help further. I feel frustrated!
I just cant seem to make the red transparent and I would definitely like to use jit.pack...am I just confusing myself?
Thanks
There are 2 ways to get transparency:
1) use a texture. The alpha channel of the matrix will set transparency
2) set the color. The alpha channel of the color will set transparency
For 1, transparency ccan vary spatially over the surface of your shape.
For 2, transparency is global to the surface.
wes
On 3/16/07, Rhys Perkins wrote:
>
> I'm having a horrible time trying to get any transparency in my shape can anyone please help further. I feel frustrated!
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P message 45 341 68 196617 255 , 0 2000;
> #P newex 45 379 40 196617 line 0;
> #P button 48 552 15 0;
> #P newex 45 431 27 196617 t b i;
> #P number 45 404 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P button 45 471 15 0;
> #P newex 48 576 53 196617 jit.pack 4;
> #P message 62 472 50 196617 setall $1;
> #P newex 62 507 105 196617 jit.matrix 4 char 1 1;
> #P newex 48 645 152 196617 jit.gl.texture ball @name Cube1;
> #P connect 7 0 3 0;
> #P connect 3 0 0 0;
> #P fasten 1 0 7 0 67 538 53 538;
> #P connect 1 0 3 1;
> #P fasten 4 0 1 0 50 495 67 495;
> #P connect 2 0 1 0;
> #P connect 6 1 2 0;
> #P connect 6 0 4 0;
> #P connect 5 0 6 0;
> #P connect 8 0 5 0;
> #P connect 9 0 8 0;
> #P window clipboard copycount 10;
>
> I just cant seem to make the red transparent and I would definitely like to use jit.pack...am I just confusing myself?
>
> Thanks
>
I've also been banging my head against a wall of similar problems the last couple of days. I worked out this patch, to solve and get a better understanding of my problems. Maybe it helps?
I get terrible framerates (9-10) with this one, so there must be some really inefficient patching here;)
For such large matrices, you want to avoid jit.pack and jit.unpack.
Also you don't need to generate your gradient all the time.
Thanks Wesley. Your modifications certainly made it more efficient. After I set the colormode to uyvy, I think it got even better.
Now I just got a couple of questions:
When you send an ARGB source (or an UYVY) onto a jit.gl.gridshape, does it get auto-remapped to RGBA? In the manual it's mentioned that jit.pack and jit.unpack, are good objects for doing this conversion, but why aren't they good to use for large matrices?
Is there a reason why you don't set both of the matrixes after the rgb2luma-conversion, to one plane? like this: jit.matrix 1 char 720 576
What does double buffering do? I notice the blending behaves differently in fullscreen with that turned on.
Sorry for hijacking the thread, but I think it's on topic.