Render destination : absurd

Mar 23, 2007 at 10:05am

Render destination : absurd

- about tut 31jMoreRenderDestinations -
Said :
jit.gl.render object draws the objects in the order in which
they were added to the context… In this case, the yellow circle was added to the draw context named “B” after the blue circle, so it appears on top.

>>>> No ! stangely the yellow circle doesn’t appear, I add it to the draw context AFTER the blue circle but I have to redraw this last one to see the yellow one : absurd !!

Could you confirm ?

Derrick.

#30983
Mar 23, 2007 at 11:24am

Quote: derrickgiscloux wrote on Fri, 23 March 2007 11:05
—————————————————-
> – about tut 31jMoreRenderDestinations -
> Said :
> jit.gl.render object draws the objects in the order in which
> they were added to the context… In this case, the yellow circle was added to the draw context named “B” after the blue circle, so it appears on top.
>
> >>>> No ! stangely the yellow circle doesn’t appear, I add it to the draw context AFTER the blue circle but I have to redraw this last one to see the yellow one : absurd !!
>
> Could you confirm ?
>
> Derrick.
—————————————————-

Hi Derrick,

If you post your patch it’s easier to test and reply.

Best,
Mattijs

#99803
Mar 23, 2007 at 2:05pm

Here’s the patch (4.6 / 1.6)

max v2;
#N vpatcher 337 43 791 563;
#P origin -37 16;
#P user panel 170 337 21 21;
#X brgb 0 4 182;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 174 453 14 15;
#X brgb 255 255 0;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P newex 88 155 98 1441802 jit.gl.render C;
#B color 5;
#P message 61 381 38 1441802 B;
#P message 108 381 38 1441802 C;
#P message 18 381 32 1441802 A;
#P newex 18 413 128 1441802 prepend drawto;
#B color 5;
#P newex 52 182 98 1441802 jit.gl.render B;
#B color 5;
#P newex 18 327 147 1441802 jit.gl.gridshape A @color 0 0 1 @scale 0.5 0.5 0.5;
#B color 5;
#P message 61 272 38 1441802 B;
#P user jit.pwindow 234 92 162 92 0 1 0 0 1 0;
#X name A;
#P message 235 69 73 1441802 name A;
#P user jit.pwindow 235 378 162 92 0 1 0 0 1 0;
#X name C;
#P message 236 355 73 1441802 name C;
#P message 108 272 38 1441802 C;
#P message 18 272 32 1441802 A;
#P user jit.pwindow 234 234 162 92 0 1 0 0 1 0;
#X name B;
#P message 235 211 73 1441802 name B;
#P comment 10 20 115 131137548 OpenGL Renderers;
#P comment 214 19 115 131137548 Destinations;
#P newex 14 113 73 1441802 t b erase;
#P newex 18 440 147 1441802 jit.gl.gridshape A @color 1 1 0 @scale 0.2 0.2 0.2;
#B color 5;
#P comment 29 44 70 1310730 Start Rendering;
#P newex 14 80 62 1441802 qmetro 5;
#P toggle 14 43 15 0;
#P newex 14 208 98 1441802 jit.gl.render A;
#B color 5;
#P user panel 9 36 189 200;
#X brgb 156 199 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 9 244 142 131137548 Switch Destinations;
#P newex 18 304 128 1441802 prepend drawto;
#B color 5;
#P user panel 9 259 189 241;
#X brgb 215 143 99;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 214 36 207 463;
#X brgb 213 202 167;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 6 0 7 0;
#P connect 7 0 10 0;
#P fasten 10 1 5 0 82 169 19 169;
#P fasten 10 0 5 0 19 169 19 169;
#P fasten 16 0 2 0 113 295 23 295;
#P connect 15 0 2 0;
#P fasten 21 0 2 0 66 295 23 295;
#P connect 2 0 22 0;
#P fasten 27 0 24 0 66 404 23 404;
#P connect 25 0 24 0;
#P fasten 26 0 24 0 113 404 23 404;
#P connect 24 0 9 0;
#P fasten 10 1 23 0 82 156 57 156;
#P fasten 10 0 23 0 19 156 57 156;
#P fasten 10 1 28 0 82 143 93 143;
#P fasten 10 0 28 0 19 143 93 143;
#P connect 19 0 20 0;
#P connect 13 0 14 0;
#P connect 17 0 18 0;
#P pop;

#99804
Mar 23, 2007 at 2:25pm

order of operations. if you draw the small yellow circle before your
large blue circle the blue circle is drawn above. Check your order, I
can get it to work by changing my click order.

check out the @automatic 0 documentation for understanding why.

also

painters algorithm!

On Mar 23, 2007, at 3:05 PM, derrickgiscloux wrote:

> max v2;
> #N vpatcher 337 43 791 563;
> #P origin -37 16;
> #P user panel 170 337 21 21;
> #X brgb 0 4 182;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 20;
> #X shadow 0;
> #X done;
> #P user panel 174 453 14 15;
> #X brgb 255 255 0;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 20;
> #X shadow 0;
> #X done;
> #P newex 88 155 98 1441802 jit.gl.render C;
> #B color 5;
> #P message 61 381 38 1441802 B;
> #P message 108 381 38 1441802 C;
> #P message 18 381 32 1441802 A;
> #P newex 18 413 128 1441802 prepend drawto;
> #B color 5;
> #P newex 52 182 98 1441802 jit.gl.render B;
> #B color 5;
> #P newex 18 327 147 1441802 jit.gl.gridshape A @color 0 0 1 @scale
> 0.5 0.5 0.5;
> #B color 5;
> #P message 61 272 38 1441802 B;
> #P user jit.pwindow 234 92 162 92 0 1 0 0 1 0;
> #X name A;
> #P message 235 69 73 1441802 name A;
> #P user jit.pwindow 235 378 162 92 0 1 0 0 1 0;
> #X name C;
> #P message 236 355 73 1441802 name C;
> #P message 108 272 38 1441802 C;
> #P message 18 272 32 1441802 A;
> #P user jit.pwindow 234 234 162 92 0 1 0 0 1 0;
> #X name B;
> #P message 235 211 73 1441802 name B;
> #P comment 10 20 115 131137548 OpenGL Renderers;
> #P comment 214 19 115 131137548 Destinations;
> #P newex 14 113 73 1441802 t b erase;
> #P newex 18 440 147 1441802 jit.gl.gridshape A @color 1 1 0 @scale
> 0.2 0.2 0.2;
> #B color 5;
> #P comment 29 44 70 1310730 Start Rendering;
> #P newex 14 80 62 1441802 qmetro 5;
> #P toggle 14 43 15 0;
> #P newex 14 208 98 1441802 jit.gl.render A;
> #B color 5;
> #P user panel 9 36 189 200;
> #X brgb 156 199 224;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P comment 9 244 142 131137548 Switch Destinations;
> #P newex 18 304 128 1441802 prepend drawto;
> #B color 5;
> #P user panel 9 259 189 241;
> #X brgb 215 143 99;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P user panel 214 36 207 463;
> #X brgb 213 202 167;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P connect 6 0 7 0;
> #P connect 7 0 10 0;
> #P fasten 10 1 5 0 82 169 19 169;
> #P fasten 10 0 5 0 19 169 19 169;
> #P fasten 16 0 2 0 113 295 23 295;
> #P connect 15 0 2 0;
> #P fasten 21 0 2 0 66 295 23 295;
> #P connect 2 0 22 0;
> #P fasten 27 0 24 0 66 404 23 404;
> #P connect 25 0 24 0;
> #P fasten 26 0 24 0 113 404 23 404;
> #P connect 24 0 9 0;
> #P fasten 10 1 23 0 82 156 57 156;
> #P fasten 10 0 23 0 19 156 57 156;
> #P fasten 10 1 28 0 82 143 93 143;
> #P fasten 10 0 28 0 19 143 93 143;
> #P connect 19 0 20 0;
> #P connect 13 0 14 0;
> #P connect 17 0 18 0;
> #P pop;

v a d e //

http://www.vade.info
abstrakt.vade.info

#99805
Mar 23, 2007 at 3:36pm

Sorry I insist,
It seems stupid but It’s not me, just look at tutorial 31 :

” if you draw the small yellow circle before your
large blue circle the blue circle is drawn above.”

IT WOULD BUT NOT !

the last one is drawn behind ! and it is the first “draw(n)to” which is drawn above !
It’s absurd !
What did I miss ?

#99806
Mar 23, 2007 at 3:52pm

It works for me as well but don’t rely on this behavior! It is better
to be explicit and use the @layer message.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 515 333 14 196617 3;
#P message 498 333 14 196617 2;
#P message 481 333 14 196617 1;
#P message 481 356 49 196617 layer $1;
#P message 518 249 14 196617 3;
#P message 501 249 14 196617 2;
#P message 484 249 14 196617 1;
#P message 484 272 49 196617 layer $1;
#P user panel 177 344 21 21;
#X brgb 0 4 182;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 181 460 14 15;
#X brgb 255 255 0;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 95 162 98 1441802 jit.gl.render C;
#B color 5;
#P message 68 388 38 1441802 B;
#P message 115 388 38 1441802 C;
#P message 25 388 32 1441802 A;
#P newex 25 420 128 1441802 prepend drawto;
#B color 5;
#P newex 59 189 98 1441802 jit.gl.render B;
#B color 5;
#P window linecount 3;
#P newex 25 334 147 1441802 jit.gl.gridshape A @color 0 0 1 @scale 0.5 0.5 0.5;
#B color 5;
#P window linecount 1;
#P message 68 279 38 1441802 B;
#P user jit.pwindow 241 99 162 92 0 1 0 0 1 0;
#X name A;
#P message 242 76 73 1441802 name A;
#P user jit.pwindow 242 385 162 92 0 1 0 0 1 0;
#X name C;
#P message 243 362 73 1441802 name C;
#P message 115 279 38 1441802 C;
#P message 25 279 32 1441802 A;
#P user jit.pwindow 241 241 162 92 0 1 0 0 1 0;
#X name B;
#P message 242 218 73 1441802 name B;
#P window setfont Arial 12.;
#P comment 17 27 115 131137548 OpenGL Renderers;
#P comment 221 26 115 131137548 Destinations;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 21 120 73 1441802 t b erase;
#P window linecount 3;
#P newex 25 447 147 1441802 jit.gl.gridshape A @color 1 1 0 @scale 0.2 0.2 0.2;
#B color 5;
#P window setfont Times 10.;
#P window linecount 1;
#P comment 36 51 70 1310730 Start Rendering;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 21 87 62 1441802 qmetro 5;
#P toggle 21 50 15 0;
#P newex 21 215 98 1441802 jit.gl.render A;
#B color 5;
#P user panel 16 43 189 200;
#X brgb 156 199 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont Arial 12.;
#P comment 16 251 142 131137548 Switch Destinations;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 25 311 128 1441802 prepend drawto;
#B color 5;
#P user panel 16 266 189 241;
#X brgb 215 143 99;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 221 43 207 463;
#X brgb 213 202 167;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 35 0 9 0;
#P connect 36 0 35 0;
#P connect 37 0 35 0;
#P connect 38 0 35 0;
#P connect 31 0 22 0;
#P connect 34 0 31 0;
#P connect 33 0 31 0;
#P connect 32 0 31 0;
#P connect 17 0 18 0;
#P connect 13 0 14 0;
#P connect 19 0 20 0;
#P fasten 10 0 5 0 26 176 26 176;
#P fasten 10 0 23 0 26 163 64 163;
#P fasten 10 0 28 0 26 150 100 150;
#P fasten 10 1 28 0 89 150 100 150;
#P fasten 10 1 5 0 89 176 26 176;
#P fasten 10 1 23 0 89 163 64 163;
#P connect 24 0 9 0;
#P fasten 26 0 24 0 120 411 30 411;
#P connect 25 0 24 0;
#P fasten 27 0 24 0 73 411 30 411;
#P connect 2 0 22 0;
#P fasten 21 0 2 0 73 302 30 302;
#P connect 15 0 2 0;
#P fasten 16 0 2 0 120 302 30 302;
#P connect 7 0 10 0;
#P connect 6 0 7 0;
#P window clipboard copycount 39;

#99807
Mar 23, 2007 at 5:11pm

In other words: the tutorial is slightly outdated.

Mattijs

#99808
Mar 23, 2007 at 5:19pm

The tutorials haven’t been updated to reflect some of the new features
of J1.6, this is true.

wes

On 3/23/07, Mattijs Kneppers wrote:
>
> In other words: the tutorial is slightly outdated.
>
> Mattijs
> –
> SmadSteck – http://www.smadsteck.nl
> Interactive audiovisual sampling soft- and hardware
>
>

#99809
Mar 23, 2007 at 6:11pm

Oh friends ! thanks, thanks !!

Derrick

#99810
Mar 23, 2007 at 6:18pm

Another potential problem here is that on many cards on windows (or
resultant from driver settings), is that a depth buffer is used
regardless of whether or not it is disabled in jit.window (as it
should by default).

However, I now see some issues on Mac which are likely the result of
changes to infrastructure that this tutorial should probably never
have relied upon. So you can just consider this part of the tutorial
mis-information. As others have mentioned for reliable render order,
you should use @layer, or @automatic 0. Still you will need to
remember that depth testing can eliminate desired “painter’s
algorithm” style 2D rendering, and you might just want to use
depth_enable 0 in such cases.

Apologies for the confusion with respect to the tutorials. For future
versions we’ll look into updating these.

-Joshua

#99811

You must be logged in to reply to this topic.