GL draw order differences on XP and OSX

Jan 30, 2006 at 12:27am

GL draw order differences on XP and OSX

i just tried my jitter js patch (made on my Mac) on my PC. I found that the drawing order in the sketch was reversed. Is there an easy way to remedy this? I am using ortho = 2 and the “painter’s algorhythm”(no z depth). Reversing the camera doesn’t work.

My mac is and ibook and I have an ATI radeon 9600 graphics card on my PC. Could this differ depending on what gfx card was used?

thanks,

oli

my plugins – http://www.oli.adbe.org

#24158
Jan 30, 2006 at 6:02pm

Everytime you save your patch, object order in the patcher is
reversed (for the curious reader, open as text and keep saving and
reloading to see how this is the case). This is a long time Max
idiosyncrasy.

In automatic mode, patcher order makes a difference without depth
buffering. When not using depth buffering, I would recommend turning
automatic off and draw each object explicitly using bangs. We might
add a “layer” attribute to jit.gl.* objects in a future version to
support ordering in automatic mode independent of patcher order, but
for the meantime the technique suggested is what you’ll need to do.

-Joshua

#69447
Jan 30, 2006 at 10:01pm

thanks for your reply joshua. I’m doing all of this in javascript so i thought that the order would be the same on both systems. Unfortunately i have to use automatic = 0 to draw multiple text labels around the screen.

oli

http://www.oli.adbe.org

#69448
Jan 30, 2006 at 10:20pm

Well without seeing an example, I can’t offer more feedback. I would
like to encourage as often as possible that people present patch
examples with steps to reproduce behavior. Otherwise, there is less
of a chance that anyone will be able to offer insight.

-Joshua

#69449
May 19, 2006 at 2:22pm

hi joshua,

here is the patch:

http://www.oli.adbe.org/downloads/intlib_05.zip

the file that contains the drawing code in question is
int.libsupporti_ispace.js

on windows XP everything is drawn in exactly the opposite order to on OS X. I have tried reversing the camera but it didn’t help.

sorry I can’t provide a smaller example file.

cheers,

oli

#69450
May 20, 2006 at 4:26pm

i found that by reversing the order of the drawing commands the interface will draw correctly. I’d rather not have to make to seperate js files for mac and windows tho, i’m sure there must be an easier way.

anyone got any ideas?

cheers,

oli

#69451
May 20, 2006 at 5:20pm

I haven’t had a problem drawing with OpenGL in jsui, using the same
code on both Windows and Mac. Are you talking about jsui or js
jitter objects?

Probably best to post your code.

Best,
Evan

#69452
May 20, 2006 at 10:22pm

>Are you talking about jsui or js jitter objects?

- js jitter

What is shown below draws the black circles on top of the red circles on OSX and vice-versa on XP. Also, on OSX the red circles are semi transparent, on XP they are opaque. Am I using automatic mode in the wrong way?
I suppose I could include two different sets of drawing functions in the js but this seems a bit messy (there is a lot of drawing code).

oli

//renderorder.mxt

max v2;
#N vpatcher 313 284 913 684;
#P toggle 70 79 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 70 100 57 196617 qmetro 40;
#P newex 119 158 88 196617 js renderorder.js;
#P connect 2 0 1 0;
#P connect 1 0 0 0;
#P pop;

// renderorder.js

autowatch = 1;

// Jitter Stuff —————————-
//——————————————-
var mywindow = new JitterObject(“jit.window”,”space”);
mywindow.depthbuffer = 0;
mywindow.fsmenubar = 0;

var myrender = new JitterObject(“jit.gl.render”,”space”);
myrender.ortho = 2;
myrender.erase_color = [1,1,1,1];

var mysketch = new JitterObject(“jit.gl.sketch”,”space”);
mysketch.blend_enable = 1;
mysketch.antialias = 1;
mysketch.automatic = 0;

function bang()
{
myrender.erase();
mysketch.reset();
mysketch.shapeslice(30,1);

for (i = 0;i < 5; i++)
{
with(mysketch)
{
moveto([-1+(i*0.5),0.,0.]);

//draw red circle
glcolor([1.,0.,0.,0.7]);
circle(0.3);

//draw black inner circle
glcolor([0.,0.,0.,1]);
circle(0.05);
}
}

mysketch.draw();
myrender.drawswap();
}

#69453
May 21, 2006 at 12:28am

hello,

very nice lib you’ve released, thanks!

you(we actually) were lucky with this one: the problem seems to be in
depth_enable beeing 1 by default, so adding mysketch.depth_enable = 0 solved
problems here.

best,
nesa

#69454
May 21, 2006 at 1:04pm

thanks nesa!

oli

#69455

You must be logged in to reply to this topic.