It is currently Mon Nov 09, 2026 4:20 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 6:49 pm  (#1) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
GIMP Version: 2.6.11
Operating System: Windows
OS Version:windows 7
GIMP Experience: Basic Level

List any ERROR messages you received:
none



I am trying to run this in NONINTERACTIVE mode but the PDB settings are confusing and the results
are disappointing,is there anywhere I can go for support on this default plug-in. I have been trying
for a few days, but cannot get even close to the INTERACTIVE result or finding info on the plug-in :(

Need 2 light sources and bump map as in the water drop tutorial by Molly viewtopic.php?p=31375#p31375

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 7:36 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Aren't they under your filters > light and shadow > lighting effects >

_________________
Image


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 8:04 pm  (#3) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
This is the error screen I get if I use lighting effects more than once and the second time it is usually a different image. The filter works ok, it just puts up the error messages. I just close the notice and go on and lighting effects works ok.

Image

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 8:32 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I don't get errors it's just that the PDB's settings are ambiguous when trying to use in script, So my results are poor.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 8:36 pm  (#5) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
Graechan wrote:
List any ERROR messages you received:
:lol Sorry, Graechan. I saw this and ran with it.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 8:48 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
molly wrote:
Aren't they under your filters > light and shadow > lighting effects >

Molly thankyou for your advice but it's the NONINTERACTIVE use of the lighting effects I'm having trouble with. I thought the the Tutorial was worth wrighting a script to but I have stumbled with the lighting effects part in the PDB.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 9:49 pm  (#7) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
'O' I thought I would post some images of wher my script is up to first is my image so far.

Image

and after using lighting effects from menu I get this image

Image

I am trying to do same in the script but get nothing like it. This is for light 1,material and bump map I ran it again for light 2(changing settings)
(plug-in-lighting RUN-NONINTERACTIVE image img-layer img-channel 0 TRUE FALSE 0 1 '(255 255 255) -1 -1 1 1.87 -1.52 1.00 0.50 0.25 0.10 10.00 0 FALSE FALSE FALSE)

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 11:26 pm  (#8) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
Graechan wrote:
'O' I thought I would post some images of wher my script is up to first is my image so far.
So is it possible in the script to tell it to use the channel for a bump map? That seems a bit of a rocky place to deal with in a script, to me anyway.

I don't write scripts so I'm not much help.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 11:37 pm  (#9) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
I hope you don't mind but I plugged your values into this commented code block for readability.

    (plug-in-lighting
                      1                ; Interactive (0), non-interactive (1)
                      image            ; Input image
                      img-layer        ; Input drawable
                      img-channel      ; Bumpmap drawable (set to 0 if disabled)
                      0                ; Environmentmap drawable (set to 0 if disabled)
                      TRUE             ; Enable bumpmapping (TRUE/FALSE)
                      FALSE            ; Enable envmapping (TRUE/FALSE)
                      0                ; Type of mapping (0=linear,1=log, 2=sinusoidal, 3=spherical)
                      1                ; Type of lightsource (0=point,1=directional,3=spot,4=none)
                      '(255 255 255)   ; Lightsource color (r,g,b)
                     -1                ; Lightsource position x
                     -1                ; Lightsource position y
                      1                ; Lightsource position z
                      1.87             ; Lightsource direction x
                     -1.52             ; Lightsource direction y
                      1.00             ; Lightsource direction z
                      0.50             ; Material ambient intensity (0..1)
                      0.25             ; Material diffuse intensity (0..1)
                      0.10             ; Material diffuse reflectivity (0..1)
                      10               ; Material specular reflectivity (0..1)
                      0                ; Material highlight (0..->), note: it's expotential
                      FALSE            ; Apply antialiasing (TRUE/FALSE)
                      FALSE            ; Create a new image (TRUE/FALSE)
                      FALSE)           ; Make background transparent (TRUE/FALSE)


There is a overview of the plug-in's parameters/arguments here: http://docs.gimp.org/en/plug-in-lighting.html

I haven't been though the tutorial but are you sure the settings match up with what the tutorial uses?

Found some source code for the lighting plug-in here and here.

I do feel you pain when it comes to interactive -vs- non-interactive.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sat Oct 22, 2011 11:51 pm  (#10) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
Also, there's this tutorial with the lighting settings: http://www.gimpchat.com/viewtopic.php?p=31375#p31375

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 12:24 am  (#11) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I have been following the tutorial and checking the result of each step with the video then entering it into my script.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 1:16 am  (#12) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
I double checked your parameter values with the link O posted and they look correct.

Assuming you have the correct drawables in place, I don't see why it wouldn't work. :hoh

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 2:08 am  (#13) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
GnuTux wrote:
I double checked your parameter values with the link O posted and they look correct.

Assuming you have the correct drawables in place, I don't see why it wouldn't work. :hoh

And that is what is frustrating me. the drawables are correct, but it returns no change to the Image.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 8:59 am  (#14) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Do the values for the last two parms look right?
10         ; Material specular reflectivity (0..1)
0          ; Material highlight (0..->), note: it's exponential

Maybe we should put together a quick little script with user inputs for all the lighting-plug-in parameters, just to experiment so we know what the results will be when the plug-in is called non-interactively. That would allow the testing and tweaking of all the lighting parameters before plugging them into a script.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 5:58 pm  (#15) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I have discovered that I needed to have the image displayed for the plug-in to return a result.

(gimp-display-new image)
   (plug-in-lighting RUN-NONINTERACTIVE image img-layer img-channel 0 TRUE FALSE 0 1 '(255 255 255) -1 -1 1 1.87 -1.52 1.00 0.50 0.25 0.10 10.00 0 FALSE FALSE FALSE)
   (gimp-displays-flush)

Idon't know why but now I get something back 'Image below' (I stroked by 1 to post)

Image

Now I have to make a second call of the plug-in for light 2(without bump-map I assume).

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 6:23 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
I think you only have to bump map it once and do light one and light two. I don't have the tute up in front of me.

_________________
Image


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 6:28 pm  (#17) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
GnuTux wrote:
Do the values for the last two parms look right?
10         ; Material specular reflectivity (0..1)
0          ; Material highlight (0..->), note: it's exponential

Maybe we should put together a quick little script with user inputs for all the lighting-plug-in parameters, just to experiment so we know what the results will be when the plug-in is called non-interactively. That would allow the testing and tweaking of all the lighting parameters before plugging them into a script.

That is a fantastic idea and I would love to be involved after I finish this script, It's a very interesting plug-in with no info from Wilbur.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 7:33 pm  (#18) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
The following Image is after using this code (stroked for clarity)

(gimp-display-new image)
   (plug-in-lighting RUN-NONINTERACTIVE image img-layer img-channel 0 TRUE FALSE 0 1 '(255 255 255) -1 -1 1 1.87 -1.52 1.00 0.50 0.25 0.10 10.00 0 FALSE FALSE FALSE)
   (gimp-displays-flush)
   (plug-in-colortoalpha RUN-NONINTERACTIVE image img-layer '(222 222 222))
   (plug-in-lighting RUN-NONINTERACTIVE image img-layer img-channel 0 TRUE FALSE 0 1 '(255 255 255) 2 -1 1 -1.57 1.51 1.00 0.50 0.25 0.10 10.00 0 FALSE FALSE FALSE)
   (plug-in-colortoalpha RUN-NONINTERACTIVE image img-layer '(222 222 222))
   (gimp-displays-flush)

Image

The result looks poor wish I could put both light sources on 1 call.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 8:45 pm  (#19) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Since it is not mentioned in the documentation, it might be helpful to know the following:

Dialog Parameter    PDB Argument
"Glowing"           #17 (ambient intensity)
"Intensity"         #18 (diffuse intensity)
"Bright"            #19 (diffuse reflectivity)
"Shiny"             #20 (specular reflectivity)
"Polished"          #21 (material highlight)


Neither the "Distance" nor the "Metallic" option in the Dialog appear to have corresponding PDB arguments. You might be able to get close to the metallic effect by setting the two reflectivities to the same value and adjusting the two intensities.

Also, it appears that the Antialiasing argument (#22) of the PDB call is completely ignored by the plug-in (nor is it available in the Dialog).

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Lighting effects plug-in
PostPosted: Sun Oct 23, 2011 9:16 pm  (#20) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Saulgoode I have learn't that my setting are incorrect, now I'll go for walk out the back then come back and ammend did you discover any info on running plug-in with two light sources :coolthup

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group