Forums > Jitter

jit.gl.sketch immediate drawing overlay problem

March 27, 2007 | 1:59 pm

Hello list,

Perhaps this is just a stupid mistake on my part, but I’m having
trouble drawing an overlay using OpenGL/jit.sketch in immediate mode.

Here’s an example – I can draw lots of little dots and blend them
additively as I draw them, but when I draw a giant dot that overlays
the entire scene then I can’t draw anything else unless I call
glclear. I hope that makes sense. It’s probably something silly
that I’m doing, but maybe people will find it interesting enough to
take a look at it. immediate mode on jit.gl.sketch is pretty nice.

BTW, Max/Jitter 4.5.7/1.5.3rc3 on OS X 10.4.8

Thanks
Evan

#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 641 245 164 196617 Now you can’t draw anymore points to
the screen unless glclear has been called?;
#P window linecount 1;
#P comment 725 176 164 196617 < -- try drawing an overlay;
#P window linecount 3;
#P message 547 166 171 196617 glenable blend , glblendfunc 6 1 ,
glcolor 1. 0. 0. 0.4 , moveto 0. 0. 1. , circle 3.;
#P window linecount 1;
#P message 130 172 41 196617 glclear;
#P message 174 172 57 196617 getcmdlist;
#P newex 354 273 50 196617 print;
#P newex 325 110 97 196617 vexpr $f1/127.-1.;
#P button 325 22 29 0;
#P window linecount 3;
#P message 421 190 68 196617 0.96063 0.92126 0.614173;
#P window linecount 1;
#P newex 421 163 76 196617 prepend set;
#P newex 325 87 110 196617 jit.spill @plane 0;
#P newex 325 60 110 196617 jit.noise 1 char 3;
#P window linecount 5;
#P message 325 162 88 196617 glenable blend , glblendfunc 6 1 ,
glcolor 1. 1. 0. 0.2 , moveto $1 $2 $3 , circle 0.2;
#P window linecount 1;
#P newex 236 172 55 196617 r fillScale;
#P toggle 187 43 15 0;
#P window linecount 2;
#P newex 236 237 128 196617 jit.gl.sketch pointy @immediate 1;
#P window linecount 1;
#N vpatcher 242 341 1133 788;
#P inlet 247 46 20 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 307 214 57 196617 getcamera;
#P window linecount 2;
#P newex 35 174 176 196617 jit.window pointy @depthbuffer 1
@fsmenubar 0;
#P window linecount 1;
#P newex 247 85 57 196617 qmetro 10;
#P newex 287 173 42 196617 t erase;
#P newex 247 149 50 196617 gate 2;
#P newex 247 118 50 196617 uzi 2;
#P newex 247 239 224 196617 jit.gl.render pointy @erase_color 0. 0.
0. 1.;
#P connect 7 0 4 0;
#P connect 4 0 1 0;
#P connect 1 2 2 0;
#P fasten 6 0 0 0 312 234 252 234;
#P connect 2 0 0 0;
#P fasten 3 0 0 0 292 195 252 195;
#P connect 1 0 2 1;
#P pop;
#P newobj 187 68 98 196617 p window+renderer;
#P comment 357 132 222 196617 Note: (will only draw visible points if
z is > 0.);
#P comment 363 34 164 196617 < -- try drawing a few points first;
#P connect 4 0 2 0;
#P fasten 16 0 3 0 552 236 241 236;
#P fasten 15 0 3 0 135 212 241 212;
#P fasten 14 0 3 0 179 212 241 212;
#P connect 6 0 3 0;
#P connect 5 0 3 0;
#P connect 11 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 12 0;
#P connect 12 0 6 0;
#P connect 3 1 13 0;
#P fasten 12 0 9 0 330 153 426 153;
#P connect 9 0 10 0;
#P window clipboard copycount 19;


March 27, 2007 | 2:12 pm

oh i get it… it’s my blend function.
should have been 6 7, not 6 1, apparently.
(GL_ONE_MINUS_SRC_ALPHA)

sorry for the extra noise, hope everyone learned something here. good.

On Mar 27, 2007, at 2:59 PM, evan.raskob [lists] wrote:

> Hello list,
>
> Perhaps this is just a stupid mistake on my part, but I’m having
> trouble drawing an overlay using OpenGL/jit.sketch in immediate mode.
>
> Here’s an example – I can draw lots of little dots and blend them
> additively as I draw them, but when I draw a giant dot that
> overlays the entire scene then I can’t draw anything else unless I
> call glclear. I hope that makes sense. It’s probably something
> silly that I’m doing, but maybe people will find it interesting
> enough to take a look at it. immediate mode on jit.gl.sketch is
> pretty nice.
>
> BTW, Max/Jitter 4.5.7/1.5.3rc3 on OS X 10.4.8
>
>
> Thanks
> Evan
>
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 3;
> #P comment 641 245 164 196617 Now you can’t draw anymore points to
> the screen unless glclear has been called?;
> #P window linecount 1;
> #P comment 725 176 164 196617 < -- try drawing an overlay;
> #P window linecount 3;
> #P message 547 166 171 196617 glenable blend , glblendfunc 6 1 ,
> glcolor 1. 0. 0. 0.4 , moveto 0. 0. 1. , circle 3.;
> #P window linecount 1;
> #P message 130 172 41 196617 glclear;
> #P message 174 172 57 196617 getcmdlist;
> #P newex 354 273 50 196617 print;
> #P newex 325 110 97 196617 vexpr $f1/127.-1.;
> #P button 325 22 29 0;
> #P window linecount 3;
> #P message 421 190 68 196617 0.96063 0.92126 0.614173;
> #P window linecount 1;
> #P newex 421 163 76 196617 prepend set;
> #P newex 325 87 110 196617 jit.spill @plane 0;
> #P newex 325 60 110 196617 jit.noise 1 char 3;
> #P window linecount 5;
> #P message 325 162 88 196617 glenable blend , glblendfunc 6 1 ,
> glcolor 1. 1. 0. 0.2 , moveto $1 $2 $3 , circle 0.2;
> #P window linecount 1;
> #P newex 236 172 55 196617 r fillScale;
> #P toggle 187 43 15 0;
> #P window linecount 2;
> #P newex 236 237 128 196617 jit.gl.sketch pointy @immediate 1;
> #P window linecount 1;
> #N vpatcher 242 341 1133 788;
> #P inlet 247 46 20 0;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P message 307 214 57 196617 getcamera;
> #P window linecount 2;
> #P newex 35 174 176 196617 jit.window pointy @depthbuffer 1
> @fsmenubar 0;
> #P window linecount 1;
> #P newex 247 85 57 196617 qmetro 10;
> #P newex 287 173 42 196617 t erase;
> #P newex 247 149 50 196617 gate 2;
> #P newex 247 118 50 196617 uzi 2;
> #P newex 247 239 224 196617 jit.gl.render pointy @erase_color 0. 0.
> 0. 1.;
> #P connect 7 0 4 0;
> #P connect 4 0 1 0;
> #P connect 1 2 2 0;
> #P fasten 6 0 0 0 312 234 252 234;
> #P connect 2 0 0 0;
> #P fasten 3 0 0 0 292 195 252 195;
> #P connect 1 0 2 1;
> #P pop;
> #P newobj 187 68 98 196617 p window+renderer;
> #P comment 357 132 222 196617 Note: (will only draw visible points
> if z is > 0.);
> #P comment 363 34 164 196617 < -- try drawing a few points first;
> #P connect 4 0 2 0;
> #P fasten 16 0 3 0 552 236 241 236;
> #P fasten 15 0 3 0 135 212 241 212;
> #P fasten 14 0 3 0 179 212 241 212;
> #P connect 6 0 3 0;
> #P connect 5 0 3 0;
> #P connect 11 0 7 0;
> #P connect 7 0 8 0;
> #P connect 8 0 12 0;
> #P connect 12 0 6 0;
> #P connect 3 1 13 0;
> #P fasten 12 0 9 0 330 153 426 153;
> #P connect 9 0 10 0;
> #P window clipboard copycount 19;
>


March 27, 2007 | 2:26 pm

no that’s still not it.

i’m not sure what blend mode i’m applying improperly, i also tried 2
5 and 3 5 and neither gives the effect of fading the scene out to
black that I’m looking for. I have the red book open in front of me
and it’s not a huge help, at least in my case.

thanks
-evan

On Mar 27, 2007, at 3:12 PM, evan.raskob [lists] wrote:

> oh i get it… it’s my blend function.
> should have been 6 7, not 6 1, apparently.
> (GL_ONE_MINUS_SRC_ALPHA)
>
> sorry for the extra noise, hope everyone learned something here.
> good.
>
>
>
>
> On Mar 27, 2007, at 2:59 PM, evan.raskob [lists] wrote:
>
>> Hello list,
>>
>> Perhaps this is just a stupid mistake on my part, but I’m having
>> trouble drawing an overlay using OpenGL/jit.sketch in immediate mode.
>>
>> Here’s an example – I can draw lots of little dots and blend them
>> additively as I draw them, but when I draw a giant dot that
>> overlays the entire scene then I can’t draw anything else unless I
>> call glclear. I hope that makes sense. It’s probably something
>> silly that I’m doing, but maybe people will find it interesting
>> enough to take a look at it. immediate mode on jit.gl.sketch is
>> pretty nice.
>>
>> BTW, Max/Jitter 4.5.7/1.5.3rc3 on OS X 10.4.8
>>
>>
>> Thanks
>> Evan
>>
>>
>> #P window setfont "Sans Serif" 9.;
>> #P window linecount 3;
>> #P comment 641 245 164 196617 Now you can’t draw anymore points to
>> the screen unless glclear has been called?;
>> #P window linecount 1;
>> #P comment 725 176 164 196617 < -- try drawing an overlay;
>> #P window linecount 3;
>> #P message 547 166 171 196617 glenable blend , glblendfunc 6 1 ,
>> glcolor 1. 0. 0. 0.4 , moveto 0. 0. 1. , circle 3.;
>> #P window linecount 1;
>> #P message 130 172 41 196617 glclear;
>> #P message 174 172 57 196617 getcmdlist;
>> #P newex 354 273 50 196617 print;
>> #P newex 325 110 97 196617 vexpr $f1/127.-1.;
>> #P button 325 22 29 0;
>> #P window linecount 3;
>> #P message 421 190 68 196617 0.96063 0.92126 0.614173;
>> #P window linecount 1;
>> #P newex 421 163 76 196617 prepend set;
>> #P newex 325 87 110 196617 jit.spill @plane 0;
>> #P newex 325 60 110 196617 jit.noise 1 char 3;
>> #P window linecount 5;
>> #P message 325 162 88 196617 glenable blend , glblendfunc 6 1 ,
>> glcolor 1. 1. 0. 0.2 , moveto $1 $2 $3 , circle 0.2;
>> #P window linecount 1;
>> #P newex 236 172 55 196617 r fillScale;
>> #P toggle 187 43 15 0;
>> #P window linecount 2;
>> #P newex 236 237 128 196617 jit.gl.sketch pointy @immediate 1;
>> #P window linecount 1;
>> #N vpatcher 242 341 1133 788;
>> #P inlet 247 46 20 0;
>> #P window setfont "Sans Serif" 9.;
>> #P window linecount 1;
>> #P message 307 214 57 196617 getcamera;
>> #P window linecount 2;
>> #P newex 35 174 176 196617 jit.window pointy @depthbuffer 1
>> @fsmenubar 0;
>> #P window linecount 1;
>> #P newex 247 85 57 196617 qmetro 10;
>> #P newex 287 173 42 196617 t erase;
>> #P newex 247 149 50 196617 gate 2;
>> #P newex 247 118 50 196617 uzi 2;
>> #P newex 247 239 224 196617 jit.gl.render pointy @erase_color 0.
>> 0. 0. 1.;
>> #P connect 7 0 4 0;
>> #P connect 4 0 1 0;
>> #P connect 1 2 2 0;
>> #P fasten 6 0 0 0 312 234 252 234;
>> #P connect 2 0 0 0;
>> #P fasten 3 0 0 0 292 195 252 195;
>> #P connect 1 0 2 1;
>> #P pop;
>> #P newobj 187 68 98 196617 p window+renderer;
>> #P comment 357 132 222 196617 Note: (will only draw visible points
>> if z is > 0.);
>> #P comment 363 34 164 196617 < -- try drawing a few points first;
>> #P connect 4 0 2 0;
>> #P fasten 16 0 3 0 552 236 241 236;
>> #P fasten 15 0 3 0 135 212 241 212;
>> #P fasten 14 0 3 0 179 212 241 212;
>> #P connect 6 0 3 0;
>> #P connect 5 0 3 0;
>> #P connect 11 0 7 0;
>> #P connect 7 0 8 0;
>> #P connect 8 0 12 0;
>> #P connect 12 0 6 0;
>> #P connect 3 1 13 0;
>> #P fasten 12 0 9 0 330 153 426 153;
>> #P connect 9 0 10 0;
>> #P window clipboard copycount 19;
>>
>


March 27, 2007 | 2:44 pm

Sounds like depth buffer issues. gldisable depth_test.

wes

On 3/27/07, evan.raskob [lists]

wrote:
>
> no that’s still not it.
>
> i’m not sure what blend mode i’m applying improperly, i also tried 2 5 and 3
> 5 and neither gives the effect of fading the scene out to black that I’m
> looking for. I have the red book open in front of me and it’s not a huge
> help, at least in my case.
>
> thanks
> -evan
>
>
> On Mar 27, 2007, at 3:12 PM, evan.raskob [lists] wrote:
>
> oh i get it… it’s my blend function.
> should have been 6 7, not 6 1, apparently.
> (GL_ONE_MINUS_SRC_ALPHA)
>
> sorry for the extra noise, hope everyone learned something here. good.
>
>
>
>
>
> On Mar 27, 2007, at 2:59 PM, evan.raskob [lists] wrote:
> Hello list,
>
> Perhaps this is just a stupid mistake on my part, but I’m having trouble
> drawing an overlay using OpenGL/jit.sketch in immediate mode.
>
> Here’s an example – I can draw lots of little dots and blend them additively
> as I draw them, but when I draw a giant dot that overlays the entire scene
> then I can’t draw anything else unless I call glclear. I hope that makes
> sense. It’s probably something silly that I’m doing, but maybe people will
> find it interesting enough to take a look at it. immediate mode on
> jit.gl.sketch is pretty nice.
>
> BTW, Max/Jitter 4.5.7/1.5.3rc3 on OS X 10.4.8
>
>
> Thanks
> Evan
>
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 3;
> #P comment 641 245 164 196617 Now you can’t draw anymore points to the
> screen unless glclear has been called?;
> #P window linecount 1;
> #P comment 725 176 164 196617 < -- try drawing an overlay;
> #P window linecount 3;
> #P message 547 166 171 196617 glenable blend , glblendfunc 6 1 , glcolor
> 1. 0. 0. 0.4 , moveto 0. 0. 1. , circle 3.;
> #P window linecount 1;
> #P message 130 172 41 196617 glclear;
> #P message 174 172 57 196617 getcmdlist;
> #P newex 354 273 50 196617 print;
> #P newex 325 110 97 196617 vexpr $f1/127.-1.;
> #P button 325 22 29 0;
> #P window linecount 3;
> #P message 421 190 68 196617 0.96063 0.92126 0.614173;
> #P window linecount 1;
> #P newex 421 163 76 196617 prepend set;
> #P newex 325 87 110 196617 jit.spill @plane 0;
> #P newex 325 60 110 196617 jit.noise 1 char 3;
> #P window linecount 5;
> #P message 325 162 88 196617 glenable blend , glblendfunc 6 1 , glcolor 1.
> 1. 0. 0.2 , moveto $1 $2 $3 , circle 0.2;
> #P window linecount 1;
> #P newex 236 172 55 196617 r fillScale;
> #P toggle 187 43 15 0;
> #P window linecount 2;
> #P newex 236 237 128 196617 jit.gl.sketch pointy @immediate 1;
> #P window linecount 1;
> #N vpatcher 242 341 1133 788;
> #P inlet 247 46 20 0;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P message 307 214 57 196617 getcamera;
> #P window linecount 2;
> #P newex 35 174 176 196617 jit.window pointy @depthbuffer 1 @fsmenubar 0;
> #P window linecount 1;
> #P newex 247 85 57 196617 qmetro 10;
> #P newex 287 173 42 196617 t erase;
> #P newex 247 149 50 196617 gate 2;
> #P newex 247 118 50 196617 uzi 2;
> #P newex 247 239 224 196617 jit.gl.render pointy @erase_color 0. 0. 0. 1.;
> #P connect 7 0 4 0;
> #P connect 4 0 1 0;
> #P connect 1 2 2 0;
> #P fasten 6 0 0 0 312 234 252 234;
> #P connect 2 0 0 0;
> #P fasten 3 0 0 0 292 195 252 195;
> #P connect 1 0 2 1;
> #P pop;
> #P newobj 187 68 98 196617 p window+renderer;
> #P comment 357 132 222 196617 Note: (will only draw visible points if z is >
> 0.);
> #P comment 363 34 164 196617 < -- try drawing a few points first;
> #P connect 4 0 2 0;
> #P fasten 16 0 3 0 552 236 241 236;
> #P fasten 15 0 3 0 135 212 241 212;
> #P fasten 14 0 3 0 179 212 241 212;
> #P connect 6 0 3 0;
> #P connect 5 0 3 0;
> #P connect 11 0 7 0;
> #P connect 7 0 8 0;
> #P connect 8 0 12 0;
> #P connect 12 0 6 0;
> #P connect 3 1 13 0;
> #P fasten 12 0 9 0 330 153 426 153;
> #P connect 9 0 10 0;
> #P window clipboard copycount 19;
>
>
>
>


March 27, 2007 | 2:51 pm

bingo, disabling depth testing for all my drawing makes it work
properly. thanks a million.

-evan

On Mar 27, 2007, at 3:44 PM, Wesley Smith wrote:

> Sounds like depth buffer issues. gldisable depth_test.
>
> wes
>
> On 3/27/07, evan.raskob [lists]

wrote:
>>
>> no that’s still not it.
>>
>> i’m not sure what blend mode i’m applying improperly, i also tried
>> 2 5 and 3
>> 5 and neither gives the effect of fading the scene out to black
>> that I’m
>> looking for. I have the red book open in front of me and it’s not
>> a huge
>> help, at least in my case.
>>
>> thanks
>> -evan
>>
>>
>> On Mar 27, 2007, at 3:12 PM, evan.raskob [lists] wrote:
>>
>> oh i get it… it’s my blend function.
>> should have been 6 7, not 6 1, apparently.
>> (GL_ONE_MINUS_SRC_ALPHA)
>>
>> sorry for the extra noise, hope everyone learned something here.
>> good.
>>
>>
>>
>>
>>
>> On Mar 27, 2007, at 2:59 PM, evan.raskob [lists] wrote:
>> Hello list,
>>
>> Perhaps this is just a stupid mistake on my part, but I’m having
>> trouble
>> drawing an overlay using OpenGL/jit.sketch in immediate mode.
>>
>> Here’s an example – I can draw lots of little dots and blend them
>> additively
>> as I draw them, but when I draw a giant dot that overlays the
>> entire scene
>> then I can’t draw anything else unless I call glclear. I hope
>> that makes
>> sense. It’s probably something silly that I’m doing, but maybe
>> people will
>> find it interesting enough to take a look at it. immediate mode on
>> jit.gl.sketch is pretty nice.
>>
>> BTW, Max/Jitter 4.5.7/1.5.3rc3 on OS X 10.4.8
>>
>>
>> Thanks
>> Evan
>>
>>
>> #P window setfont "Sans Serif" 9.;
>> #P window linecount 3;
>> #P comment 641 245 164 196617 Now you can’t draw anymore points to
>> the
>> screen unless glclear has been called?;
>> #P window linecount 1;
>> #P comment 725 176 164 196617 < -- try drawing an overlay;
>> #P window linecount 3;
>> #P message 547 166 171 196617 glenable blend , glblendfunc 6 1 ,
>> glcolor
>> 1. 0. 0. 0.4 , moveto 0. 0. 1. , circle 3.;
>> #P window linecount 1;
>> #P message 130 172 41 196617 glclear;
>> #P message 174 172 57 196617 getcmdlist;
>> #P newex 354 273 50 196617 print;
>> #P newex 325 110 97 196617 vexpr $f1/127.-1.;
>> #P button 325 22 29 0;
>> #P window linecount 3;
>> #P message 421 190 68 196617 0.96063 0.92126 0.614173;
>> #P window linecount 1;
>> #P newex 421 163 76 196617 prepend set;
>> #P newex 325 87 110 196617 jit.spill @plane 0;
>> #P newex 325 60 110 196617 jit.noise 1 char 3;
>> #P window linecount 5;
>> #P message 325 162 88 196617 glenable blend , glblendfunc 6 1 ,
>> glcolor 1.
>> 1. 0. 0.2 , moveto $1 $2 $3 , circle 0.2;
>> #P window linecount 1;
>> #P newex 236 172 55 196617 r fillScale;
>> #P toggle 187 43 15 0;
>> #P window linecount 2;
>> #P newex 236 237 128 196617 jit.gl.sketch pointy @immediate 1;
>> #P window linecount 1;
>> #N vpatcher 242 341 1133 788;
>> #P inlet 247 46 20 0;
>> #P window setfont "Sans Serif" 9.;
>> #P window linecount 1;
>> #P message 307 214 57 196617 getcamera;
>> #P window linecount 2;
>> #P newex 35 174 176 196617 jit.window pointy @depthbuffer 1
>> @fsmenubar 0;
>> #P window linecount 1;
>> #P newex 247 85 57 196617 qmetro 10;
>> #P newex 287 173 42 196617 t erase;
>> #P newex 247 149 50 196617 gate 2;
>> #P newex 247 118 50 196617 uzi 2;
>> #P newex 247 239 224 196617 jit.gl.render pointy @erase_color 0.
>> 0. 0. 1.;
>> #P connect 7 0 4 0;
>> #P connect 4 0 1 0;
>> #P connect 1 2 2 0;
>> #P fasten 6 0 0 0 312 234 252 234;
>> #P connect 2 0 0 0;
>> #P fasten 3 0 0 0 292 195 252 195;
>> #P connect 1 0 2 1;
>> #P pop;
>> #P newobj 187 68 98 196617 p window+renderer;
>> #P comment 357 132 222 196617 Note: (will only draw visible points
>> if z is >
>> 0.);
>> #P comment 363 34 164 196617 < -- try drawing a few points first;
>> #P connect 4 0 2 0;
>> #P fasten 16 0 3 0 552 236 241 236;
>> #P fasten 15 0 3 0 135 212 241 212;
>> #P fasten 14 0 3 0 179 212 241 212;
>> #P connect 6 0 3 0;
>> #P connect 5 0 3 0;
>> #P connect 11 0 7 0;
>> #P connect 7 0 8 0;
>> #P connect 8 0 12 0;
>> #P connect 12 0 6 0;
>> #P connect 3 1 13 0;
>> #P fasten 12 0 9 0 330 153 426 153;
>> #P connect 9 0 10 0;
>> #P window clipboard copycount 19;
>>
>>
>>
>>


June 26, 2009 | 6:18 pm

I am having trouble figuring out the integer values for the parameters for glblendfunc
How did you find out 6, 7 and corresponding blend function parameters (gl_one_minus_src_alpha, etc?)
Can you pass me the link to these values?


June 27, 2009 | 6:39 pm

Jitter 1.6.3 tutorial 33, p 295.


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