Forums > Jitter

having trouble with gllight msg to jit.gl.sketch

May 23, 2007 | 8:14 am

On May 23, 2007, at 1:55 AM, pascal wrote:

>
> I’ve just updated to Jitter 1.6.3.rc1 . And a jit.gl.sketch seems
> not to respond to "reset, glenable lighting, glenable normalize,
> glenable light1, gllight light1 ambient 0. 0. 0. 1., gllight light1
> specular 0. 0. 0. 1., gllight light1 diffuse 1. 1. 1. 1., gllight
> light1 position 1. 0. 0. 1.," type of messages ..(it was in Jitter
> 1.6.3.b2).

As always, simple example, please?

However I can clarify what’s changed. In jit.gl.sketch, now to solve
other state bleed through problems (a more common usage problem), we
push the attribute stack, so if you make these changes in
jit.gl.sketch, it won’t affect other objects unless you use the
drawobject sketch command, or use @immediate 1. If this is going to
be a big problem for people, I suppose I could change it so that
jit.gl.sketch has a @pushstate attribute (default on) which you and
others who need the old behavior (@immediate 0 @pushstate 0) could
have your cake and eat it too.

-Joshua


May 23, 2007 | 8:55 am

I’ve just updated to Jitter 1.6.3.rc1 . And a jit.gl.sketch seems not to respond to "reset, glenable lighting, glenable normalize, glenable light1, gllight light1 ambient 0. 0. 0. 1., gllight light1 specular 0. 0. 0. 1., gllight light1 diffuse 1. 1. 1. 1., gllight light1 position 1. 0. 0. 1.," type of messages ..(it was in Jitter 1.6.3.b2).

Cheers

Pascal


May 23, 2007 | 3:49 pm

Sorry ..( for the example patch ..) ..I’ll try with your indications Anyway..here is a very small example that was setting the parameters of light1 ( for ex ..) ..That did work in 1.6.3.b2 :

max v2;
#N vpatcher 8 338 663 763;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 248 71 132 196617 jit.window lt depthbuffer 1;
#P message 21 107 14 196617 1;
#P newex 21 80 48 196617 loadbang;
#P newex 158 380 74 196617 jit.gl.sketch lt;
#P window setfont "Sans Serif" 12.;
#P window linecount 4;
#P message 158 298 362 196620 reset , glenable lighting , glenable normalize , glenable light1 , gllightmodel ambient 0. 0. 0. 1. , gllight light1 ambient 0. 0. 0. 1. , gllight light1 specular 0. 0. 0. 1. , gllight light1 diffuse 0. 1. 1. 1. , gllight light1 position 2. 0. 0. 1. ,;
#P toggle 328 168 15 0;
#P window setfont "Fixedwidth Serif" 10.;
#P window linecount 1;
#P message 328 188 110 1441802 auto_material $1;
#P toggle 21 143 15 0;
#P toggle 214 168 15 0;
#P message 214 189 110 1441802 smooth_shading $1;
#P toggle 95 170 15 0;
#P message 95 190 113 1441802 lighting_enable $1;
#P newex 20 195 62 1441802 t b erase;
#P window linecount 3;
#P newex 143 230 121 1441802 jit.gl.gridshape lt @shape torus @position 0 0 -3;
#B color 5;
#P window linecount 1;
#P newex 20 171 62 1441802 qmetro 50;
#P newex 20 254 103 1441802 jit.gl.render lt;
#B color 5;
#P connect 8 0 1 0;
#P connect 1 0 3 0;
#P fasten 3 1 0 0 77 219 25 219;
#P connect 3 0 0 0;
#P connect 13 0 14 0;
#P connect 14 0 8 0;
#P connect 14 0 5 0;
#P connect 5 0 4 0;
#P connect 9 0 2 0;
#P connect 6 0 2 0;
#P connect 4 0 2 0;
#P connect 11 0 12 0;
#P connect 14 0 7 0;
#P connect 7 0 6 0;
#P connect 14 0 10 0;
#P connect 10 0 9 0;
#P pop;


May 23, 2007 | 4:05 pm

On May 23, 2007, at 8:49 AM, pascal wrote:

>
> Sorry ..( for the example patch ..) ..I’ll try with your
> indications Anyway..here is a very small example that was setting
> the parameters of light1 ( for ex ..) ..That did work in 1.6.3.b2 :

Thanks, yes this clearly illustrates that you are exploiting the
state bleeding properties of jit.gl.sketch (which is a problem for
many other users). I’ve added a pushstate attribute to the next
version (released shortly) you can set to 0 to get this state
bleeding behavior back with @pushstate 0.

-Joshua


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