POV-Ray : Newsgroups : povray.binaries.images : Sundial and shadow problem Server Time
6 Nov 2024 04:19:14 EST (-0500)
  Sundial and shadow problem (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: kurtz le pirate
Subject: Sundial and shadow problem
Date: 3 Jan 2021 05:36:11
Message: <5ff19e1b$1@news.povray.org>
Hello,

Little brain teaser : the attached image is part of an animation that 
simulates a simplified sundial. In order not to overload the image, the 
shadow of the sundial has been removed with the "no_shadow" attribute. 
But not for the gnomon to get the "time". As you can see, its shadow is 
also projected on the ground "through" the wall.

So, how to remove this shadow on the floor but keep the shadow on the wall ?

-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message


Attachments:
Download 'cadransolaire109.jpg' (46 KB)

Preview of image 'cadransolaire109.jpg'
cadransolaire109.jpg


 

From: William F Pokorny
Subject: Re: Sundial and shadow problem
Date: 3 Jan 2021 08:08:49
Message: <5ff1c1e1$1@news.povray.org>
On 1/3/21 5:36 AM, kurtz le pirate wrote:
> Hello,
> 
> Little brain teaser : the attached image is part of an animation that 
> simulates a simplified sundial. In order not to overload the image, the 
> shadow of the sundial has been removed with the "no_shadow" attribute. 
> But not for the gnomon to get the "time". As you can see, its shadow is 
> also projected on the ground "through" the wall.
> 
> So, how to remove this shadow on the floor but keep the shadow on the 
> wall ?
> 
If the scene is simple - like what you shown - you might be able to dial 
back on the scene's max_trace_level until the unwanted shadow disappears.

There is also the projected_through feature for lights. If you put a 
special object on the back side of the no shadow shape (or maybe just 
the gnomon) for that projection_through shape it should be the shadow 
disappears. Off the top of my head a little unsure about how light 
attenuation (if any) acts with the feature.

Hmm, wonder if you could just project through no shadow shape... Would 
the shadow on it still show up normally?

Might also be seam issues to fight between any inserted 
projected_through shape and the seen ones if that shape is in the scene.

IIRC. You need not otherwise insert a projected through shape in scene. 
Meaning it can be defined and then referenced only by the 
projected_through keyword in the light. In that way it affects nothing 
else in the scene except being a local light portal into the scene for 
the given light definition.

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Sundial and shadow problem
Date: 3 Jan 2021 08:45:08
Message: <web.5ff1ca30346ceddf1f9dae300@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
> Hello,
>
> Little brain teaser : the attached image is part of an animation that
> simulates a simplified sundial. In order not to overload the image, the
> shadow of the sundial has been removed with the "no_shadow" attribute.
> But not for the gnomon to get the "time". As you can see, its shadow is
> also projected on the ground "through" the wall.
>
> So, how to remove this shadow on the floor but keep the shadow on the wall ?

That's indeed a crazy little problem, and a wonderful brain-teaser.
It's before 2nd coffee, so all I can suggest is to have you main light source
(maybe with parallel) and then put a second light source on the back side of the
wall, in line with the light / point-at vector...

Do you need a shadow on the floor?   What if THAT had no_shadow as well?
I'm sure there may be something you can do with light groups to separate the
components of the scene.  Perhaps the gnomon and wall in one group, and the
floor in the other.


Post a reply to this message

From: Alain Martel
Subject: Re: Sundial and shadow problem
Date: 3 Jan 2021 12:10:41
Message: <5ff1fa91$1@news.povray.org>
Le 2021-01-03 à 05:36, kurtz le pirate a écrit :
> Hello,
> 
> Little brain teaser : the attached image is part of an animation that 
> simulates a simplified sundial. In order not to overload the image, the 
> shadow of the sundial has been removed with the "no_shadow" attribute. 
> But not for the gnomon to get the "time". As you can see, its shadow is 
> also projected on the ground "through" the wall.
> 
> So, how to remove this shadow on the floor but keep the shadow on the 
> wall ?
> 

First a little question : Does the illumination of the floor need to 
vary according to the Sun's position ?

If no, then, you can do the following :
Remove that no_shadow as you'll no longer need it.
Change the finish of the floor for this :
finish{ diffuse 0 emission 0.6 }

That way, the floor no longer receive any illumination from the light, 
and the emission make it clearly visible.

If the illumination of the floor must reflect the Sun's location, use a 
light_group :

Place the floor in a light_group.
In that, have a light that mirrors the main light.
Have the diffuse set as, keeping the rest of the finish unchanged :
finish { diffuse 0, 0.6 }
Add an inside_texture with : pigment {rgbt 1}

The front diffuse don't diffuse any light. The backside part reproduce 
the normal diffuse.
The inside_texture ensure that the light coming from bellow won't get 
blocked by the bottom part of the floor.


Post a reply to this message

From: Kenneth
Subject: Re: Sundial and shadow problem
Date: 4 Jan 2021 11:00:01
Message: <web.5ff33ae5346ceddfd98418910@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
> Hello,
>
> Little brain teaser...
>
> So, how to remove this shadow on the floor but keep the shadow on the wall ?
>
> --

That is indeed an interesting situation.

After reading the various suggestions here, I experimented with different
set-ups, and finally found one that works. It uses two light sources: a
shadowless one in a light_group with the large horizonal disc, and another light
for everything else. The no_shadow flag is not needed in any of the objects.

---

plane{...}

// light_source A
light_source {...}

light_group{
// light_source B
light_source {  // same position as light_source A
....
  shadowless
}

// large horizontal disc
cylinder{...}
} // end of light_group

// sundial CSG
union{
box{...}

// gnomon
cylinder{...}
}


Post a reply to this message


Attachments:
Download 'shadow_question.png' (61 KB)

Preview of image 'shadow_question.png'
shadow_question.png


 

From: kurtz le pirate
Subject: Re: Sundial and shadow problem
Date: 6 Jan 2021 11:56:11
Message: <5ff5ebab$1@news.povray.org>
On 04/01/2021 16:57, Kenneth wrote:
> After reading the various suggestions here, I experimented with different
> set-ups, and finally found one that works. It uses two light sources: a
> shadowless one in a light_group with the large horizonal disc, and another light
> for everything else. The no_shadow flag is not needed in any of the objects.

Interesting approach. I'm trying this out.
Thanks Kenneth


-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: Subclick
Subject: Re: Sundial and shadow problem
Date: 6 Jan 2021 22:01:49
Message: <87czyhtppn.fsf@sp.am>
"Kenneth" <kdw### [at] gmailcom> writes:
> After reading the various suggestions here, I
> experimented with different
> set-ups, and finally found one that works. It uses
> two light sources: a
> shadowless one in a light_group with the large
> horizonal disc, and another light
> for everything else. The no_shadow flag is not
> needed in any of the objects.

I’ve tried that out, too.  With a shadowless light source, you don’t get
highlights.  You can remedy this by setting “no_shadow” for both the
wall and the gnomon, and putting the former in a light group with a
negative-intensity light source projected through the gnomon.


Post a reply to this message


Attachments:
Download 'sundial.mpg' (658 KB) Download 'us-ascii' (1 KB)

From: kurtz le pirate
Subject: Re: Sundial and shadow problem
Date: 7 Jan 2021 13:17:12
Message: <5ff75028$1@news.povray.org>
You can see the result with Kenneth's method here:
<http://louisbel.free.fr/wip/sundial.html>


Very close to Subclick
LOL



-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: Kenneth
Subject: Re: Sundial and shadow problem
Date: 8 Jan 2021 11:55:00
Message: <web.5ff88e1a346ceddfd98418910@news.povray.org>
Subclick <no### [at] spam> wrote:
> "Kenneth" <kdw### [at] gmailcom> writes:
> > After reading the various suggestions here, I
> > experimented with different
> > set-ups, and finally found one that works...
>
> I've tried that out, too.  With a shadowless light source, you don't
> get highlights.  You can remedy this by setting no_shadow for both
> the wall and the gnomon, and putting the former in a light group
> with a negative-intensity light source projected through the gnomon.

That is a really clever solution, and a good improvement. I didn't notice the
lack of highlights in my own test.

At first, I thought that the negative light_source would 'invert' the color of
the wall object; but that's not the case.

Here's my own demo code. (Note that the light_group requires global_lights ON).
-------

#default{finish{ambient .04 diffuse .8}}

camera {
  perspective
  location  <-4, 2.5, -3>
  look_at   <0, 0,  0>
  right     x*image_width/image_height
  angle 40
}

// light_source A-- main
light_source {
  0*x                  // light's position (translated below)
  color rgb <1,1,1>    // light's color
  translate <20, 20, -20>
}

plane{y,0 pigment{rgb .2}}


// large horizontal disc
superellipsoid{ <1,.2> rotate 90*x scale 1.5*<1,.1,1>
texture{
pigment{ rgb .5*<.6,1,.6>
       }
       finish{phong .8}
       normal{bumps .7 scale .1 bump_size 1}
       }

       }

// --- sundial ---
#declare GNOMON =
cylinder{0,-.55*z,.02
pigment{rgb <.8,.2,.2>}
rotate -40*x
translate .9*y
no_shadow
}

object{GNOMON}

light_group{
// light_source B-- same position as light_source A
light_source {
  0*x
  color rgb -1 // NEGATIVE light
  translate <20, 20, -20>
  projected_through{GNOMON}
}

// vertical wall
superellipsoid{<.1,.3> scale <.7,1,.08>
texture{
pigment{rgb <.95,.85,.55>}
finish{phong 1}
}
no_shadow
}
global_lights on
} // end of light_group


Post a reply to this message


Attachments:
Download 'sundial_shadow_solution_2.png' (119 KB)

Preview of image 'sundial_shadow_solution_2.png'
sundial_shadow_solution_2.png


 

From: kurtz le pirate
Subject: Re: Sundial and shadow problem
Date: 8 Jan 2021 13:26:07
Message: <5ff8a3bf$1@news.povray.org>
On 08/01/2021 17:53, Kenneth wrote:
> At first, I thought that the negative light_source would 'invert' the color of
> the wall object; but that's not the case.

hum, hum... negative light...
why not, just had to think of it.



-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.