Forums > Jitter

multiple shapes with masked-based transparent textures


ico
September 26, 2007 | 3:29 am

Hi all,

Here’s an interesting problem. I am trying to use multiple planes (or any
kind of shape for that matter) where all of them rely upon masked textures
so as to ensure that their surface is partially transparent.

However, in the following example even though both gridshape objects (patch
guts borrowed from another example provided on the listserve) are
transparent, only one of them is truly transparent, while other is only
transparent in respect to the background color.

If you change both shapes’ z-axis, you’ll find out that one of them is not
really transparent but only blended with the background color. The desired
goal is to have (in this case) both of them truly transparent both in
respect to background and to each other.

FWIW, adding more shapes perpetuates the problem with all but one shape
being partially transparent only in respect to the background.

Any ideas how to address this?

#P window setfont "Sans Serif" 9.;
#P number 535 173 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 491 173 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 451 193 98 9109513 pak blend_mode 0. 0.;
#P flonum 195 349 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 160 349 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 125 349 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 104 373 91 9109513 pak position 0. 0. 0.;
#P flonum 211 276 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 176 276 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 141 276 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 120 300 91 9109513 pak position 0. 0. 0.;
#P newex 409 503 26 9109513 print;
#P message 371 455 62 9109513 getmoviedim;
#P newex 356 478 63 9109513 jit.qt.movie;
#P message 356 431 121 9109513 read countdown.mov , bang;
#P newex 356 527 151 9109513 jit.gl.texture showme @name disis;
#P window linecount 2;
#P newex 249 376 383 9109513 jit.gl.gridshape showme @shape plane @scale
0.45 0.45 @lighting_enable 0 @smooth_shading 1 @depth_enable 1 @blend_enable
1 @blend_mode 6 8 @texture disis;
#P flonum 173 108 35 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 173 133 106 9109513 erase_color $1 $1 $1 1.;
#P newex 237 504 26 9109513 print;
#P message 199 456 62 9109513 getmoviedim;
#P newex 184 479 63 9109513 jit.qt.movie;
#P message 184 432 121 9109513 read countdown.mov , bang;
#P newex 184 528 155 9109513 jit.gl.texture showme @name cctad;
#P window linecount 2;
#P newex 244 337 387 9109513 jit.gl.gridshape showme @shape plane @scale 0.6
0.3 @lighting_enable 0 @smooth_shading 1 @depth_enable 1 @blend_enable 1
@blend_mode 6 8 @texture cctad;
#P toggle 110 107 15 0;
#P window linecount 1;
#P newex 110 160 195 9109513 jit.gl.render showme @erase_color 1. 1. 1. 1.;
#N vpatcher 369 505 902 789;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 125 75 50 9109513 route ms;
#P window linecount 2;
#P message 283 139 87 9109513 ; jitter cursor $1;
#P window linecount 1;
#P newex 273 110 31 9109513 == 0;
#P newex 122 29 48 9109513 loadbang;
#P newex 123 49 80 9109513 patcherargs ms;
#P outlet 80 172 15 0;
#P newex 161 168 257 9109513 jit.window showme @fsmenubar 0 @depthbuffer 1
@fsaa 1;
#P toggle 245 125 15 0;
#P newex 206 124 35 9109513 sel 27;
#P newex 161 124 40 9109513 key;
#P newex 161 146 91 9109513 prepend fullscreen;
#P newex 44 100 57 9109513 qmetro 40;
#P newex 44 128 66 9109513 t b b b erase;
#P inlet 44 52 15 0;
#P inlet 91 54 15 0;
#P outlet 44 172 15 0;
#P outlet 62 172 15 0;
#P connect 3 0 5 0;
#P connect 5 0 4 0;
#P connect 4 0 1 0;
#P fasten 4 3 1 0 103 158 49 158;
#P connect 4 1 0 0;
#P connect 4 2 11 0;
#P fasten 16 0 5 1 130 96 96 96;
#P connect 2 0 5 1;
#P connect 13 0 12 0;
#P fasten 12 1 16 0 198 70 130 70;
#P fasten 9 0 6 0 250 144 166 144;
#P connect 6 0 10 0;
#P fasten 7 0 8 0 166 143 203 143 203 122 211 122;
#P fasten 8 0 9 0 211 142 242 142 242 122 250 122;
#P connect 9 0 14 0;
#P connect 14 0 15 0;
#P pop;
#P newobj 110 132 54 9109513 p @ms 40;
#P connect 25 0 11 0;
#P connect 21 0 11 0;
#P connect 17 0 3 0;
#P connect 2 0 0 0;
#P connect 0 0 1 0;
#P connect 9 0 1 0;
#P connect 22 0 21 1;
#P connect 18 0 17 1;
#P connect 23 0 21 2;
#P connect 10 0 9 0;
#P connect 19 0 17 2;
#P connect 7 0 6 0;
#P connect 5 0 6 0;
#P connect 6 0 4 0;
#P connect 24 0 21 3;
#P connect 20 0 17 3;
#P connect 6 1 8 0;
#P connect 13 0 14 0;
#P connect 15 0 14 0;
#P connect 14 0 12 0;
#P connect 14 1 16 0;
#P connect 26 0 25 1;
#P connect 27 0 25 2;
#P window clipboard copycount 28;

Ivica Ico Bukvic, D.M.A.
Composition, Music Technology, CCTAD, CHCI
Virginia Tech
Dept. of Music – 0240
Blacksburg, VA 24061
(540) 231-6139
(540) 231-5034 (fax)
ico@vt.edu

http://www.music.vt.edu/people/faculty/bukvic/


September 26, 2007 | 5:54 am

@depth_enable 0

On Sep 25, 2007, at 8:29 PM, "Ivica Ico Bukvic" wrote:

> Hi all,
>
> Here’s an interesting problem. I am trying to use multiple planes
> (or any
> kind of shape for that matter) where all of them rely upon masked
> textures
> so as to ensure that their surface is partially transparent.
>
> However, in the following example even though both gridshape objects
> (patch
> guts borrowed from another example provided on the listserve) are
> transparent, only one of them is truly transparent, while other is
> only
> transparent in respect to the background color.
>
> If you change both shapes’ z-axis, you’ll find out that one of them
> is not
> really transparent but only blended with the background color. The
> desired
> goal is to have (in this case) both of them truly transparent both in
> respect to background and to each other.
>
> FWIW, adding more shapes perpetuates the problem with all but one
> shape
> being partially transparent only in respect to the background.
>
> Any ideas how to address this?
>
> #P window setfont "Sans Serif" 9.;
> #P number 535 173 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 491 173 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window linecount 1;
> #P newex 451 193 98 9109513 pak blend_mode 0. 0.;
> #P flonum 195 349 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 160 349 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 125 349 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 104 373 91 9109513 pak position 0. 0. 0.;
> #P flonum 211 276 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 176 276 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 141 276 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 120 300 91 9109513 pak position 0. 0. 0.;
> #P newex 409 503 26 9109513 print;
> #P message 371 455 62 9109513 getmoviedim;
> #P newex 356 478 63 9109513 jit.qt.movie;
> #P message 356 431 121 9109513 read countdown.mov , bang;
> #P newex 356 527 151 9109513 jit.gl.texture showme @name disis;
> #P window linecount 2;
> #P newex 249 376 383 9109513 jit.gl.gridshape showme @shape plane
> @scale
> 0.45 0.45 @lighting_enable 0 @smooth_shading 1 @depth_enable 1
> @blend_enable
> 1 @blend_mode 6 8 @texture disis;
> #P flonum 173 108 35 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0
> 0;
> #P window linecount 1;
> #P message 173 133 106 9109513 erase_color $1 $1 $1 1.;
> #P newex 237 504 26 9109513 print;
> #P message 199 456 62 9109513 getmoviedim;
> #P newex 184 479 63 9109513 jit.qt.movie;
> #P message 184 432 121 9109513 read countdown.mov , bang;
> #P newex 184 528 155 9109513 jit.gl.texture showme @name cctad;
> #P window linecount 2;
> #P newex 244 337 387 9109513 jit.gl.gridshape showme @shape plane
> @scale 0.6
> 0.3 @lighting_enable 0 @smooth_shading 1 @depth_enable 1
> @blend_enable 1
> @blend_mode 6 8 @texture cctad;
> #P toggle 110 107 15 0;
> #P window linecount 1;
> #P newex 110 160 195 9109513 jit.gl.render showme @erase_color 1. 1.
> 1. 1.;
> #N vpatcher 369 505 902 789;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 0;
> #P newex 125 75 50 9109513 route ms;
> #P window linecount 2;
> #P message 283 139 87 9109513 ; jitter cursor $1;
> #P window linecount 1;
> #P newex 273 110 31 9109513 == 0;
> #P newex 122 29 48 9109513 loadbang;
> #P newex 123 49 80 9109513 patcherargs ms;
> #P outlet 80 172 15 0;
> #P newex 161 168 257 9109513 jit.window showme @fsmenubar 0
> @depthbuffer 1
> @fsaa 1;
> #P toggle 245 125 15 0;
> #P newex 206 124 35 9109513 sel 27;
> #P newex 161 124 40 9109513 key;
> #P newex 161 146 91 9109513 prepend fullscreen;
> #P newex 44 100 57 9109513 qmetro 40;
> #P newex 44 128 66 9109513 t b b b erase;
> #P inlet 44 52 15 0;
> #P inlet 91 54 15 0;
> #P outlet 44 172 15 0;
> #P outlet 62 172 15 0;
> #P connect 3 0 5 0;
> #P connect 5 0 4 0;
> #P connect 4 0 1 0;
> #P fasten 4 3 1 0 103 158 49 158;
> #P connect 4 1 0 0;
> #P connect 4 2 11 0;
> #P fasten 16 0 5 1 130 96 96 96;
> #P connect 2 0 5 1;
> #P connect 13 0 12 0;
> #P fasten 12 1 16 0 198 70 130 70;
> #P fasten 9 0 6 0 250 144 166 144;
> #P connect 6 0 10 0;
> #P fasten 7 0 8 0 166 143 203 143 203 122 211 122;
> #P fasten 8 0 9 0 211 142 242 142 242 122 250 122;
> #P connect 9 0 14 0;
> #P connect 14 0 15 0;
> #P pop;
> #P newobj 110 132 54 9109513 p @ms 40;
> #P connect 25 0 11 0;
> #P connect 21 0 11 0;
> #P connect 17 0 3 0;
> #P connect 2 0 0 0;
> #P connect 0 0 1 0;
> #P connect 9 0 1 0;
> #P connect 22 0 21 1;
> #P connect 18 0 17 1;
> #P connect 23 0 21 2;
> #P connect 10 0 9 0;
> #P connect 19 0 17 2;
> #P connect 7 0 6 0;
> #P connect 5 0 6 0;
> #P connect 6 0 4 0;
> #P connect 24 0 21 3;
> #P connect 20 0 17 3;
> #P connect 6 1 8 0;
> #P connect 13 0 14 0;
> #P connect 15 0 14 0;
> #P connect 14 0 12 0;
> #P connect 14 1 16 0;
> #P connect 26 0 25 1;
> #P connect 27 0 25 2;
> #P window clipboard copycount 28;
>
>
> Ivica Ico Bukvic, D.M.A.
> Composition, Music Technology, CCTAD, CHCI
> Virginia Tech
> Dept. of Music – 0240
> Blacksburg, VA 24061
> (540) 231-6139
> (540) 231-5034 (fax)
> ico@vt.edu
> http://www.music.vt.edu/people/faculty/bukvic/
>
>



ico
September 26, 2007 | 12:44 pm

> @depth_enable 0

I appreciate your help but I already tried using this and as a result I have
no ability to utilize such planes in a 3D setting which is something I may
have failed to mention (in other words, occlusion does not work). Please
correct me if I am wrong.

Sincerely,

Ivica Ico Bukvic, D.M.A.
Composition, Music Technology, CCTAD, CHCI
Virginia Tech
Dept. of Music – 0240
Blacksburg, VA 24061
(540) 231-6139
(540) 231-5034 (fax)
ico@vt.edu

http://www.music.vt.edu/people/faculty/bukvic/



ico
September 26, 2007 | 1:07 pm

> > @depth_enable 0
>
> I appreciate your help but I already tried using this and as a result I
> have
> no ability to utilize such planes in a 3D setting which is something I may
> have failed to mention (in other words, occlusion does not work). Please
> correct me if I am wrong.

Apropos the same, another perhaps simple question is how to make sure that
only masked parts are transparent instead of the entire texture being
half-transparent?

In other words, I am trying to have 2 or more 3D shapes whose transparency
applies only to the parts which are black on the countdown.mov (in this case
mainly edges around the circle).

Aain, any help is most appreciated.

Sincerely,

Ico


September 26, 2007 | 4:27 pm

On Sep 26, 2007, at 5:44 AM, Ivica Ico Bukvic wrote:

>> @depth_enable 0
>
> I appreciate your help but I already tried using this and as a
> result I have
> no ability to utilize such planes in a 3D setting which is
> something I may
> have failed to mention (in other words, occlusion does not work).
> Please
> correct me if I am wrong.

You *need* depth_enable 0 to get the behavior you are looking for.
See more in forum archives, this is a common question. You either
need to do explicit scene management to get the look you want, or try
some tricky multiple rendering passes. It’s not "done for you" by the
graphics card, and Jitter does not have any explicit scene management
implementation.

-Joshua


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