[PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Klemens Schmiady

Hey there,

the sphere in combination with the lighting leads to strange artefacts 
as shown in the .jpg.

Looking for a solution.

Thanks!
#N canvas 703 79 944 717 10;
#X declare -lib Gem;
#X obj 61 245 alpha 1;
#X obj 61 311 sphere 1 50;
#X obj 301 159 gemwin;
#X msg 398 84 0 \, destroy;
#X msg 82 210 auto \$1;
#X obj 82 171 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#N canvas 1024 311 450 316 light 0;
#X obj 110 200 declare -lib Gem;
#X obj 113 127 light;
#X obj 113 12 gemhead;
#X obj 259 30 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X msg 259 68 debug \$1;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 1 0;
#X restore 400 123 pd light;
#N canvas 1062 138 362 426 mousemove 0;
#X obj 129 8 gemmouse;
#X obj 136 88 pack;
#X obj 136 110 spigot;
#X obj 136 131 unpack;
#X obj 136 196 t f f;
#X obj 36 16 gemkeyname;
#X obj 36 39 pack 0 s;
#X obj 36 62 route 1;
#X obj 36 84 route space;
#X msg 36 107 0;
#X msg 136 365 view \$2 \$3 \$1 0 0 0 0 1 0;
#X obj 136 173 +;
#X obj 136 221 * -1;
#X obj 201 237 t f f;
#X obj 201 174 +;
#X obj 201 262 * -1;
#X obj 36 129 t f f f;
#X text 61 106 reset;
#N canvas 292 198 304 356 coordinates 0;
#X obj 89 52 inlet;
#X obj 94 331 outlet;
#X obj 193 62 atan;
#X msg 193 41 1;
#X obj 193 84 / 45;
#X obj 193 20 loadbang;
#X text 94 29 r phi theta;
#X obj 89 78 unpack 0 0 0;
#X obj 128 123 *;
#X obj 168 123 *;
#X obj 120 197 cos;
#X obj 150 198 sin;
#X obj 120 166 t f f;
#X obj 183 198 cos;
#X obj 213 199 sin;
#X obj 183 167 t f f;
#X obj 120 230 *;
#X obj 150 231 *;
#X obj 85 275 *;
#X obj 125 275 *;
#X obj 174 277 *;
#X obj 66 242 t f f f;
#X obj 91 308 pack 0 0 0;
#X connect 0 0 7 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 4 0 9 1;
#X connect 4 0 8 1;
#X connect 5 0 3 0;
#X connect 7 0 21 0;
#X connect 7 1 8 0;
#X connect 7 2 9 0;
#X connect 8 0 12 0;
#X connect 9 0 15 0;
#X connect 10 0 16 0;
#X connect 11 0 17 0;
#X connect 12 0 10 0;
#X connect 12 1 11 0;
#X connect 13 0 16 1;
#X connect 13 0 17 1;
#X connect 14 0 20 1;
#X connect 15 0 13 0;
#X connect 15 1 14 0;
#X connect 16 0 18 1;
#X connect 17 0 19 1;
#X connect 18 0 22 0;
#X connect 19 0 22 1;
#X connect 20 0 22 2;
#X connect 21 0 18 0;
#X connect 21 1 19 0;
#X connect 21 2 20 0;
#X connect 22 0 1 0;
#X restore 136 310 pd coordinates;
#X obj 136 249 t b f;
#X obj 136 289 pack 4 0 0;
#X obj 177 46 t f f;
#X obj 177 67 -;
#X obj 136 45 t f f;
#X obj 136 66 -;
#X obj 278 57 s stay_cube;
#X obj 278 35 select 1;
#X obj 201 151 * 0.5;
#X obj 136 153 * 0.5;
#X obj 201 209 clip -90 90;
#X obj 136 388 outlet;
#X connect 0 0 23 0;
#X connect 0 1 21 0;
#X connect 0 2 2 1;
#X connect 0 4 26 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 28 0;
#X connect 3 1 27 0;
#X connect 4 0 12 0;
#X connect 4 1 11 1;
#X connect 5 0 6 0;
#X connect 5 1 6 1;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 16 0;
#X connect 10 0 30 0;
#X connect 11 0 4 0;
#X connect 12 0 19 0;
#X connect 13 0 15 0;
#X connect 13 1 14 1;
#X connect 14 0 29 0;
#X connect 15 0 20 2;
#X connect 16 0 11 0;
#X connect 16 1 11 1;
#X connect 16 1 14 0;
#X connect 16 2 14 1;
#X connect 18 0 10 0;
#X connect 19 0 20 0;
#X connect 19 1 20 1;
#X connect 20 0 18 0;
#X connect 21 0 22 1;
#X connect 21 1 22 0;
#X connect 22 0 1 1;
#X connect 23 0 24 1;
#X connect 23 1 24 0;
#X connect 24 0 1 0;
#X connect 26 0 25 0;
#X connect 27 0 14 0;
#X connect 28 0 11 0;
#X connect 29 0 13 0;
#X restore 316 84 pd mousemove;
#X msg 301 42 lighting 1 \, create \, 1;
#X obj 61 104 gemhead;
#X connect 0 0 1 0;
#X connect 3 0 2 0;
#X connect 4 0 0 0;
#X connect 5 0 4 0;
#X connect 7 0 2 0;
#X connect 8 0 2 0;
#X connect 9 0 0 0;
attachment: glitch.jpg___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Cyrille Henry

hello,

i can't reproduce this.
is there anything special to do in the patch?
cheers
c


Le 10/01/2013 11:06, Klemens Schmiady a écrit :

Hey there,

the sphere in combination with the lighting leads to strange artefacts as shown 
in the .jpg.
Looking for a solution.

Thanks!


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Klemens Schmiady

Am 10.01.2013 11:40, schrieb Cyrille Henry:

hello,

i can't reproduce this.
is there anything special to do in the patch?
cheers
c


Le 10/01/2013 11:06, Klemens Schmiady a écrit :

Hey there,

the sphere in combination with the lighting leads to strange 
artefacts as shown in the .jpg.

Looking for a solution.

Thanks!


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list





You have to change the perspective by using your mouse movement.

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Jack
Le 10/01/2013 11:57, Klemens Schmiady a écrit :
 Am 10.01.2013 11:40, schrieb Cyrille Henry:
 hello,

 i can't reproduce this.
 is there anything special to do in the patch?
 cheers
 c


 Le 10/01/2013 11:06, Klemens Schmiady a écrit :
 Hey there,

 the sphere in combination with the lighting leads to strange
 artefacts as shown in the .jpg.
 Looking for a solution.

 Thanks!


 ___
 Pd-list@iem.at mailing list
 UNSUBSCRIBE and account-management -
 http://lists.puredata.info/listinfo/pd-list


 You have to change the perspective by using your mouse movement.

 ___
 Pd-list@iem.at mailing list
 UNSUBSCRIBE and account-management -
 http://lists.puredata.info/listinfo/pd-list

I think, this is because your viewpoint come too close to your geo (sphere).
Put a [max 2] (for example) on your Z axis for the viewpoint to avoid
collision.
++

Jack



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Max

Am 10.01.2013 um 12:34 schrieb Jack j...@rybn.org:
 Le 10/01/2013 11:57, Klemens Schmiady a écrit :
 Am 10.01.2013 11:40, schrieb Cyrille Henry:
 hello,
 
 i can't reproduce this.
 is there anything special to do in the patch?
 cheers
 c
 
 Le 10/01/2013 11:06, Klemens Schmiady a écrit :
 Hey there,
 
 the sphere in combination with the lighting leads to strange
 artefacts as shown in the .jpg.
 Looking for a solution.
 
 I think, this is because your viewpoint come too close to your geo (sphere).
 Put a [max 2] (for example) on your Z axis for the viewpoint to avoid
 collision.

i don't think it's that. i simplified the patch a bit more:



testing_gem.pd
Description: Binary data


with
GEM: ver: 0.93.3 
GEM: compiled: Nov 10 2011
i have the same phenomenon here.___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Cyrille Henry

hello,

thanks for providing a simple patch to reproduce this effect.

this artefact came from the default light model in Gem : lights are computed 
for both side of mesh.
 
The best solution is to remove this option (see attachment).

I usually disable it anyway since it is unneeded if you are careful with 
normals, and disable it can improve rendering speed.

cheers
c

Le 10/01/2013 16:22, Max a écrit :


Am 10.01.2013 um 12:34 schrieb Jack j...@rybn.org:

Le 10/01/2013 11:57, Klemens Schmiady a écrit :

Am 10.01.2013 11:40, schrieb Cyrille Henry:

hello,

i can't reproduce this.
is there anything special to do in the patch?
cheers
c

Le 10/01/2013 11:06, Klemens Schmiady a écrit :

Hey there,

the sphere in combination with the lighting leads to strange
artefacts as shown in the .jpg.
Looking for a solution.


I think, this is because your viewpoint come too close to your geo (sphere).
Put a [max 2] (for example) on your Z axis for the viewpoint to avoid
collision.


i don't think it's that. i simplified the patch a bit more:





with
GEM: ver: 0.93.3
GEM: compiled: Nov 10 2011
i have the same phenomenon here.



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list



testing_gem.pd
Description: application/puredata
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Klemens Schmiady

Am 10.01.2013 17:02, schrieb Cyrille Henry:

hello,

thanks for providing a simple patch to reproduce this effect.

this artefact came from the default light model in Gem : lights are 
computed for both side of mesh.


The best solution is to remove this option (see attachment).
I usually disable it anyway since it is unneeded if you are careful 
with normals, and disable it can improve rendering speed.


cheers
c

Le 10/01/2013 16:22, Max a écrit :


Am 10.01.2013 um 12:34 schrieb Jack j...@rybn.org:

Le 10/01/2013 11:57, Klemens Schmiady a écrit :

Am 10.01.2013 11:40, schrieb Cyrille Henry:

hello,

i can't reproduce this.
is there anything special to do in the patch?
cheers
c

Le 10/01/2013 11:06, Klemens Schmiady a écrit :

Hey there,

the sphere in combination with the lighting leads to strange
artefacts as shown in the .jpg.
Looking for a solution.


I think, this is because your viewpoint come too close to your geo 
(sphere).

Put a [max 2] (for example) on your Z axis for the viewpoint to avoid
collision.


i don't think it's that. i simplified the patch a bit more:





with
GEM: ver: 0.93.3
GEM: compiled: Nov 10 2011
i have the same phenomenon here.



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list





___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list
Thanks for the help! This problem still accrues if I add a texture to 
the sphere though.
The black artefacts disappear but I get white artefacts instead on 
the contrary side.



Thanks
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Cyrille Henry



Le 10/01/2013 17:59, Klemens Schmiady a écrit :


Thanks for the help! This problem still accrues if I add a texture to the 
sphere though.
The black artefacts disappear but I get white artefacts instead on the 
contrary side.



that's not the effect of alpha 1?
c
c


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] choose language

2013-01-10 Thread András Murányi
On Wed, Jan 9, 2013 at 5:35 PM, Hans-Christoph Steiner h...@at.or.atwrote:


 Since Tcl handles all of the changing of English strings to the chosen
 language,


Does it mean that there are no GUI strings in the C code?


 it is theoritically possible to do in a plugin.  The key problem is
 that the translations are loaded (load_locale in pd-gui.tcl) before the
 plugins and Tcl's msgcat, the library for the translations, provides
 mcload,
 but no mkunload.


To be exact, not even mcunload would be necessary, just a way to reload
strings according to the new locale. Unfortunately, this functionality is
missing from TCL (there are some feature requests in the tracker that
target it, though).
So, to effectively change the GUI language, Pd needs to be restarted. Do we
wish to have a language selection option in the preferences, which  writes
its setting somewhere on the disk, and then load_locale would be changed in
a way that it takes a look at the saved setting before defaulting to the
OS/env language? (my vote is: no)

András



 .hc

 On 01/09/2013 10:35 AM, András Murányi wrote:
  I have visited this problem some time ago, and these were my (more or
 less
  accurate) findings:
  - There are language strings in the C code as well as in Tcl
  - In Tcl there is a straightforward way to redefine the language, but I
  haven't found a way to change the actual strings on the display without
  having to restart Pd
  - I have no idea how it goes on the C side :)
  - My impression is that this may go beyond the scope of a plugin
 
  András
 
  On Wed, Jan 9, 2013 at 2:50 PM, batinste dwanaf...@yahoo.fr wrote:
 
  language-plugin, anyone ? :)
 
 
  On 09/01/2013 14:23, Hans-Christoph Steiner wrote:
 
  The easiest way is to start it in the Terminal like this:
 
  GNU/Linux: LANG=en pd-extended
  Mac OS X:  LANG=en /Applications/Pd-extended.app/**
  Contents/Resources/bin/pd
  Windows (in cmd.exe):
set LANG=en
%ProgramFiles%\pd\bin\pd
 
  If you want to force English, you can also delete the .msg files in the
  pd/po
  folder.
 
  .hc
 
 
  On 01/09/2013 07:05 AM, João Pais wrote:
 
  Hi,
 
  with the latest Pd version, Pd uses the system language as standard.
 The
  thing
  is, I want to keep my Pd in english. How is it possible to set the
  language
  when starting Pd?
 
  Where can suggestions to the language be sent?
 
  Best,
 
  João
 
 
 
 

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Cyrille Henry

try
depth 0
c
c

Le 10/01/2013 18:46, Klemens Schmiady a écrit :

Am 10.01.2013 18:25, schrieb Cyrille Henry:



Le 10/01/2013 17:59, Klemens Schmiady a écrit :


Thanks for the help! This problem still accrues if I add a texture to the 
sphere though.
The black artefacts disappear but I get white artefacts instead on the 
contrary side.



that's not the effect of alpha 1?
c
c



I don't know actually. But it happens regardless of which image i'm using.


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Lighting glitch, [alpha]-object depth detection

2013-01-10 Thread Jack
Le 10/01/2013 16:22, Max a écrit :
 Am 10.01.2013 um 12:34 schrieb Jack j...@rybn.org:
 Le 10/01/2013 11:57, Klemens Schmiady a écrit :
 Am 10.01.2013 11:40, schrieb Cyrille Henry:
 hello,

 i can't reproduce this.
 is there anything special to do in the patch?
 cheers
 c

 Le 10/01/2013 11:06, Klemens Schmiady a écrit :
 Hey there,

 the sphere in combination with the lighting leads to strange
 artefacts as shown in the .jpg.
 Looking for a solution.
 I think, this is because your viewpoint come too close to your geo (sphere).
 Put a [max 2] (for example) on your Z axis for the viewpoint to avoid
 collision.
 i don't think it's that. i simplified the patch a bit more:




 with
 GEM: ver: 0.93.3 
 GEM: compiled: Nov 10 2011
 i have the same phenomenon here.

Yep, you are right Max. I think it was a problem with the near clipping
plane of the frustum. But i was wrong...
Cyrille, your patch seems to have the same problem if you put an alpha =
0.5, or i am wrong ?
Here a patch that enable culling.
Hoping it helps to solve _this_ problem.
++

Jack

PS : dont't forget to start by rendering the light before geos with an
argument in [gemhead] ;)


testing.pd
Description: application/puredata
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] choose language

2013-01-10 Thread Hans-Christoph Steiner
On 01/10/2013 12:36 PM, András Murányi wrote:
 On Wed, Jan 9, 2013 at 5:35 PM, Hans-Christoph Steiner h...@at.or.atwrote:
 

 Since Tcl handles all of the changing of English strings to the chosen
 language,
 
 
 Does it mean that there are no GUI strings in the C code?

There are GUI strings in the C code, but in order for you to see them, they
are sent to pd-gui, the Tcl process.  If you're running in -nogui mode, there
will be no translations since all the translations are handled in Tcl.

 
 
 it is theoritically possible to do in a plugin.  The key problem is
 that the translations are loaded (load_locale in pd-gui.tcl) before the
 plugins and Tcl's msgcat, the library for the translations, provides
 mcload,
 but no mkunload.

 
 To be exact, not even mcunload would be necessary, just a way to reload
 strings according to the new locale. Unfortunately, this functionality is
 missing from TCL (there are some feature requests in the tracker that
 target it, though).
 So, to effectively change the GUI language, Pd needs to be restarted. Do we
 wish to have a language selection option in the preferences, which  writes
 its setting somewhere on the disk, and then load_locale would be changed in
 a way that it takes a look at the saved setting before defaulting to the
 OS/env language? (my vote is: no)

That would be possible.  I would be willing to accept such a patch if it was
well tested but I'm not going to write it :)

.hc


 
 András
 
 

 .hc

 On 01/09/2013 10:35 AM, András Murányi wrote:
 I have visited this problem some time ago, and these were my (more or
 less
 accurate) findings:
 - There are language strings in the C code as well as in Tcl
 - In Tcl there is a straightforward way to redefine the language, but I
 haven't found a way to change the actual strings on the display without
 having to restart Pd
 - I have no idea how it goes on the C side :)
 - My impression is that this may go beyond the scope of a plugin

 András

 On Wed, Jan 9, 2013 at 2:50 PM, batinste dwanaf...@yahoo.fr wrote:

 language-plugin, anyone ? :)


 On 09/01/2013 14:23, Hans-Christoph Steiner wrote:

 The easiest way is to start it in the Terminal like this:

 GNU/Linux: LANG=en pd-extended
 Mac OS X:  LANG=en /Applications/Pd-extended.app/**
 Contents/Resources/bin/pd
 Windows (in cmd.exe):
   set LANG=en
   %ProgramFiles%\pd\bin\pd

 If you want to force English, you can also delete the .msg files in the
 pd/po
 folder.

 .hc


 On 01/09/2013 07:05 AM, João Pais wrote:

 Hi,

 with the latest Pd version, Pd uses the system language as standard.
 The
 thing
 is, I want to keep my Pd in english. How is it possible to set the
 language
 when starting Pd?

 Where can suggestions to the language be sent?

 Best,

 João





 

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] choose language

2013-01-10 Thread András Murányi
On Thu, Jan 10, 2013 at 7:25 PM, Hans-Christoph Steiner h...@at.or.atwrote:

 On 01/10/2013 12:36 PM, András Murányi wrote:
  On Wed, Jan 9, 2013 at 5:35 PM, Hans-Christoph Steiner h...@at.or.at
 wrote:
 
 
  Since Tcl handles all of the changing of English strings to the chosen
  language,
 
 
  Does it mean that there are no GUI strings in the C code?

 There are GUI strings in the C code, but in order for you to see them, they
 are sent to pd-gui, the Tcl process.  If you're running in -nogui mode,
 there
 will be no translations since all the translations are handled in Tcl.


Ah! BTW, would it take much to have gettext working on the C side too?




  it is theoritically possible to do in a plugin.  The key problem is
  that the translations are loaded (load_locale in pd-gui.tcl) before the
  plugins and Tcl's msgcat, the library for the translations, provides
  mcload,
  but no mkunload.
 
 
  To be exact, not even mcunload would be necessary, just a way to reload
  strings according to the new locale. Unfortunately, this functionality is
  missing from TCL (there are some feature requests in the tracker that
  target it, though).
  So, to effectively change the GUI language, Pd needs to be restarted. Do
 we
  wish to have a language selection option in the preferences, which
  writes
  its setting somewhere on the disk, and then load_locale would be changed
 in
  a way that it takes a look at the saved setting before defaulting to the
  OS/env language? (my vote is: no)

 That would be possible.  I would be willing to accept such a patch if it
 was
 well tested but I'm not going to write it :)

 .hc


Well I shall not take on more things (but to carry on with things that I've
already started), but... :)
This stuff would actually be another driver for me to dive into the prefs
system... and eventually evolve that a bit, too*.

* right now the guiprefs system is geared towards the recentfiles list, and
it might need some mods to serve other purposes as well.

András
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Cursor automation in pd?

2013-01-10 Thread Hans-Christoph Steiner

Alexandre Quessy made objects to do that with X11 (i.e. GNU/Linux):

https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/aalex

They're called x11key and x11mouse.

.hc

On Jan 10, 2013, at 12:11 AM, Sebastian Valenzuela wrote:

 Hi everyone,
 
 I can't find the answer to this question anywhere. Is it possible to automate 
 the movement and clicks of a mouse in pure data?
 
 Or maybe there is an easier way of doing what i'm trying to do? In my 
 project, I am having pd sense a google talk phone call being made to my 
 browser (Google Chrome). It will wait for one ring, then I'd like it to 
 move the mouse and accept the call on the browser. One problem I see with 
 this is that it might stop once it clicks out of the patch..?
 
 I know there are other automation programs out there; I was actually working 
 on some code in AutoIt to accept that call. But i'd like to do it all in pd, 
 if possible.
 
 Thank you for your time,
 Sebastian
 ___
 Pd-list@iem.at mailing list
 UNSUBSCRIBE and account-management - 
 http://lists.puredata.info/listinfo/pd-list


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list