Forums > Jitter

GL draw order differences on XP and OSX

January 30, 2006 | 12:27 am

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


January 30, 2006 | 6:02 pm

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


January 30, 2006 | 10:01 pm

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


January 30, 2006 | 10:20 pm

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


May 19, 2006 | 2:22 pm

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


May 20, 2006 | 4:26 pm

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


May 20, 2006 | 5:20 pm

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


May 20, 2006 | 10:22 pm

>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();
}


May 21, 2006 | 12:28 am

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


May 21, 2006 | 1:04 pm

thanks nesa!

oli


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