It is currently Sun Aug 23, 2026 5:58 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Perspective Shadow
PostPosted: Sat Mar 26, 2016 2:13 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
GIMP Version: 2.8.16
Operating System: Windows
GIMP Experience: Basic Level

List any relevant plug-ins or scripts:
Lights and Shadows / Perspective /



I was trying to read/follow OMG's tutorial on Clear Glass Brumbies.
There is mentioned the use of the filter shown above
(Lights and Shadows / Perspective)
.
That filter allows the shadow to have an angle from 0 to 180, creating in any case the shadow behind the object.
I'm wondering whether:
- there is a similar filter with the possibility of shadow in front of the object (case when the sun is behind the object)
-- or --
- someone is able to find the source of that filter, analyze it and see whether it can be "extended" to work with angles from 0 to 360 (or from -180 to 180)
Thanks

_________________
"Where am I ?"


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: Perspective Shadow
PostPosted: Sat Mar 26, 2016 2:34 pm  (#2) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14166
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
dinasset wrote:
GIMP Version: 2.8.16
Operating System: Windows
GIMP Experience: Basic Level

List any relevant plug-ins or scripts:
Lights and Shadows / Perspective /



I was trying to read/follow OMG's tutorial on Clear Glass Brumbies.
There is mentioned the use of the filter shown above
(Lights and Shadows / Perspective)
.
That filter allows the shadow to have an angle from 0 to 180, creating in any case the shadow behind the object.
I'm wondering whether:
- there is a similar filter with the possibility of shadow in front of the object (case when the sun is behind the object)
-- or --
- someone is able to find the source of that filter, analyze it and see whether it can be "extended" to work with angles from 0 to 360 (or from -180 to 180)
Thanks

That's interesting.
I'm not aware of any filter that does what you're asking.
It would make for a very nice addition to the already available lights and shadows filters.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sat Mar 26, 2016 3:18 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2648
Location: Poland
Standard in Gimp: perspective-shadow.scm

Before
  SF-ADJUSTMENT _"Angle"                        '(45 0 180 1 10 1 0)

After
  SF-ADJUSTMENT _"Angle"                        '(45 0 360 1 10 1 0)


Is that it?


Edit 28-03-2016:

Appendix removed after the notes Ofnuts (OK) in the post (# 16)
Today I found the solution Graechan
http://gimpchat.com/viewtopic.php?f=9&t=9006


Attachments:
Perspective.png
Perspective.png [ 355.5 KiB | Viewed 4191 times ]

_________________
Image


Last edited by MareroQ on Mon Mar 28, 2016 12:26 am, edited 1 time in total.
Top
 Post subject: Re: Perspective Shadow
PostPosted: Sat Mar 26, 2016 3:56 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
thanks a lot MareroQ !
But it didn't show in the standard sets of my Gimp functions.
Now I downloaded and installed the source you provided and it "replaced" the previous one.
Is it a "special version"?

edit: did "you" the change? if so, excellent and quick solution!

_________________
"Where am I ?"


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sat Mar 26, 2016 4:14 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
I have the impression that the perspective is not correct with the shadow in front of the object:
did the change only extend the rotation without changing the perspective computation ?
(if any, maybe there is no perspective computation, in spite of the filter's name)

_________________
"Where am I ?"


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sat Mar 26, 2016 4:28 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
it seems the perspective calculation is there, thus it should be changed also...

examples:

Attachment:
Shadow-behind(angle140).png
Shadow-behind(angle140).png [ 10.42 KiB | Viewed 4149 times ]


Attachment:
Shadow-infrontof(angle320).png
Shadow-infrontof(angle320).png [ 14.6 KiB | Viewed 4149 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sat Mar 26, 2016 5:38 pm  (#7) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4527
Location: Canada
maybe this does what you want viewtopic.php?f=9&t=9006

_________________
TinT


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sat Mar 26, 2016 5:54 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
unfortunately not, Tin
this one "looses" the part just in front of the object, so it's difficult to judge whether the perspective is correct
Attachment:
new-320.png
new-320.png [ 9.2 KiB | Viewed 4115 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sat Mar 26, 2016 5:57 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
now I'm going to sleep.
Happy Easter to all Gimp-chatters:
- those who are already on Sunday (Australian)
- those who enter now the Sunday (Europe)
- those who have still to wait (America)
Happy Easter !

_________________
"Where am I ?"


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sat Mar 26, 2016 6:24 pm  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2015
Posts: 256
Is this what you want:

Old:
(half-bottom-width (/ select-width 2))

New:
(half-bottom-width (/ select-width 1.5))

Making the number larger makes the shadow come to more of a point. Smaller makes the shadow spread out.

Attachment:
perspective.png
perspective.png [ 4.64 KiB | Viewed 4108 times ]


And set at 1.25:

Attachment:
perspective.png
perspective.png [ 4.23 KiB | Viewed 4100 times ]


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 1:59 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
Yes, Steven, that's OK for shadow "in front of the object".
This modification of the script should be made ONLY when this is the case.
So far I didn't try to insert your modification into the code, but I guess that the statement should be conditioned:
-if angle > 180
else it should remain as it is for shadows behind.
I'll have a look (don't know if today, busy day).
Thanks for your indication.

_________________
"Where am I ?"


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 4:49 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2015
Posts: 256
I agree entirely. I just can't find a way to set that condition. The statement looks simple enough, but I can not understand how to implement it.


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 5:54 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2648
Location: Poland
Hi Steven.

Maybe in this metod?


Edit 28-03-2016:

Appendix removed after the notes Ofnuts (OK) in the post (# 16)


Attachments:
Add parametr.png
Add parametr.png [ 24.7 KiB | Viewed 1820 times ]

_________________
Image


Last edited by MareroQ on Mon Mar 28, 2016 12:28 am, edited 1 time in total.
Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 7:29 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14831
Location: roma, italy
downloaded and tried your version: I don't get any shadow

edit: it seems there is some "formal" error in the code (it doesn't start, practically)
I restored your original version

_________________
"Where am I ?"


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 3:26 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2015
Posts: 256
I could not find a way to work it into the script, so I cheated and made a second script. It shows under Perspective2 and is only for 181 degrees through 359 degrees. It shows as Perspective2 under Light and Shadow. Use Perspective for shadows behind and Persective2 for shadows in front.

I have uploaded the file with the corrected header information. Thank you ofnuts


Attachments:
perspective-shadowv2.scm [8.82 KiB]
Downloaded 86 times


Last edited by steven8 on Sun Mar 27, 2016 6:58 pm, edited 1 time in total.
Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 5:51 pm  (#16) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
MareroQ wrote:
Standard in Gimp: perspective-shadow.scm

Before
  SF-ADJUSTMENT _"Angle"                        '(45 0 180 1 10 1 0)

After
  SF-ADJUSTMENT _"Angle"                        '(45 0 360 1 10 1 0)


Is that it?


This is open source, so modifying code and publishing your version is OK.

However, as a matter of etiquette you should clearly identify this version as yours, by changing the relevant info (header, and author/copyright in the registration data) because once it gets on the net, the origin of the modified version is quickly lost and people having problems with it will pester the original author.

Mentioning that this is derivative work and citing the original author is of course welcome...

_________________
Image


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 6:21 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12837
Just fyi, that G'MIC also can do perspective shadow. :)


Attachments:
3d_shadow.png
3d_shadow.png [ 369.88 KiB | Viewed 1781 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 9:07 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2015
Posts: 256
lylejk wrote:
Just fyi, that G'MIC also can do perspective shadow. :)


This does not work the same way. Even with a blank selection, the Perspective shadow will create a shadow based on that selection area, but when I try that with G'Mic, it does not produce anything. Actually, I could not get G'Mic to produce a shadow even with an image selection, using your same settings. :?:


Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 9:42 pm  (#19) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12837
Yeah; and to toy a lot to get it to do this one. :)


Attachments:
3d_sdw-ty.png
3d_sdw-ty.png [ 100.22 KiB | Viewed 1767 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Perspective Shadow
PostPosted: Sun Mar 27, 2016 9:45 pm  (#20) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2015
Posts: 256
Ah, I will have to give that a go when I get a chance. Thank you, sir!


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

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group