Difference between revisions of "Reference Talk:Light Source"

From POV-Wiki
Jump to navigation Jump to search
(+reply)
 
(6 intermediate revisions by 2 users not shown)
Line 73: Line 73:
  
 
:Oops, I was wrong. But translation is *dangerous*. As per clipka's response to my post:
 
:Oops, I was wrong. But translation is *dangerous*. As per clipka's response to my post:
 
+
<blockquote>With a parallel light source, the
<blockquote>And that direction is unchanged: With a parallel light source, the
 
 
direction of all light rays depends only on the /relative/ location of
 
direction of all light rays depends only on the /relative/ location of
 
two points: The light source's nominal center and the point_at
 
two points: The light source's nominal center and the point_at
Line 81: Line 80:
 
location of the points, not their relative location to one another. And
 
location of the points, not their relative location to one another. And
 
thus the light direction remains unimpressed.</blockquote>
 
thus the light direction remains unimpressed.</blockquote>
 +
:I.e. translating a light source translates the location of the source of the light *and* the location the light is pointing at, which could produce unwanted effects. [[User:SharkD|SharkD]] 16:59, 12 September 2016 (UTC)
 +
:You might want to update this page as well: [[Knowledgebase:Language_Questions_and_Tips#Topic_1]]. [[User:SharkD|SharkD]] 17:19, 12 September 2016 (UTC)
 +
 +
== Suggested addition to Parallel Lights section ==
 +
 +
From pov newsgroup wip disussion [http://news.povray.org/povray.binaries.images/thread/%3C5ffd0bab%40news.povray.org%3E/?mtop=432577&moff=10|here] Alain Martel gave following tip":
 +
" You only need to make it just
 +
distant enough that it is farther than the farthest other object in your
 +
scene." Which I believe would make sense as a Nice tip / note right after the mention of non shadowed areas thus something alng the lines of :
 +
==Parallel Lights==
 +
{{#indexentry:parallel, light_source}}
 +
{{#indexentry:point_at, parallel}}
 +
{{#indexentry:light_source, parallel}}
 +
{{#indexentry:parallel}}
 +
{{#indexentry:point_at, light_source}}
 +
{{#indexentry:keyword, point_at}}
 +
<pre>
 +
syntax:
 +
 +
light_source {
 +
  LOCATION_VECTOR, COLOR
 +
  [LIGHT_SOURCE_ITEMS...]
 +
  parallel
 +
  point_at VECTOR
 +
  }
 +
</pre>
 +
 +
<p>The <code>parallel</code> keyword can be used with any type of light source.</p>
 +
<p class="Note"><strong>Note:</strong> For normal point lights, <code>point_at</code> must come after
 +
<code>parallel</code>.</p>
 +
 +
<p>Parallel lights are useful for simulating very distant light sources, such as
 +
sunlight. As the name suggests, it makes the light rays parallel.</p>
 +
<p>Technically this is done by shooting rays from the closest point on a plane to the
 +
object intersection point. The plane is determined by a perpendicular defined by the
 +
light <code>location</code> and the <code>point_at</code> vector.</p>
  
I.e. translating a light source translates the location of the source of the light *and* the location the light is pointing at, which could produce unwanted effects. [[User:SharkD|SharkD]] 16:59, 12 September 2016 (UTC)
+
<p>Two things must be considered when choosing the light location
 +
(specifically, its distance):</p><ol>
 +
<li>Any parts of an object <em>above</em> the light plane still get illuminated according to
 +
the light direction, but they will not cast or receive shadows.</li>
 +
<li><code>fade_distance</code> and <code>fade_power</code> use the light
 +
<code>location</code> to determine distance for light attenuation, so the attenuation
 +
still looks like that of a point source.
 +
<br>Area light also uses the light location in its calculations.</li></ol>
 +
<p class="Note"><strong>Tip:</strong> For non faded lights, you only need to make <code>location</code> just
 +
distant enough from the center that it is farther than the farthest other object in your
 +
scene.</p>
 +
--[[User:Maurice|Maurice]] 17:18, 25 January 2021 (UTC)
 +
<p>Done... i also did some needed grammar cleanup</p>
 +
--[[User:Jholsenback|jholsenback]] 18:50, 31 January 2021 (UTC)

Latest revision as of 18:50, 31 January 2021

Suggested looks_like changes

Here is the current wording:

Normally the light source itself has no visible shape. The light simply radiates from an invisible point or area. You may give a light source any shape by adding a looks_like { OBJECT } statement.

There is an implied no_shadow attached to the looks_like object so that light is not blocked by the object. Without the automatic no_shadow the light inside the object would not escape. The object would, in effect, cast a shadow over everything.

If you want the attached object to block light then you should attach it with a union and not a looks_like as follows:

union {
  light_source { <100, 200, -300> color White }
  object { My_Lamp_Shape }
  }

Presumably parts of the lamp shade are transparent to let some light out.

Here is my suggested wording:

Normally the light source itself has no visible shape. The light simply radiates from an invisible point or area. You may give a light source any shape by adding a looks_like { OBJECT } statement.

There is an implied no_shadow attached to the looks_like object so that light is not blocked by the object. Without the automatic no_shadow the light inside the object would not escape. The object would, in effect, cast a shadow over everything.

When creating the light source, the looks_like object should be positioned at the origin. For instance:

union {
  light_source { <100, 200, -300> color White }
  object {
    sphere { <0, 0, 0>, My_Lamp_Radius }
    }
  }

Alternately, you could declare the object beforehand and reference the object from within the light source, like this:

#declare My_Lamp_Shape = sphere { <0, 0, 0>, My_Lamp_Radius }

light_source {
  <100, 200, -300> color White
  looks_like { My_Lamp_Shape }
  }

For point lights and spotlights you could also place the light source and the looks_like object at the origin and translate them together later. But for parallel lights this will not work.

If you instead want the attached object to block light then you should attach it with a union and not a looks_like as follows:

union {
  light_source { <100, 200, -300> color White }
  object { My_Lamp_Shape }
  }

Presumably parts of the lamp shade are transparent to let some light out.

SharkD 22:48, 8 September 2016 (UTC)

Oops, I was wrong. But translation is *dangerous*. As per clipka's response to my post:

With a parallel light source, the

direction of all light rays depends only on the /relative/ location of two points: The light source's nominal center and the point_at parameter. But transformations act on both these points (I've just checked the code), so a translation operation changes only the absolute location of the points, not their relative location to one another. And

thus the light direction remains unimpressed.

I.e. translating a light source translates the location of the source of the light *and* the location the light is pointing at, which could produce unwanted effects. SharkD 16:59, 12 September 2016 (UTC)
You might want to update this page as well: Knowledgebase:Language_Questions_and_Tips#Topic_1. SharkD 17:19, 12 September 2016 (UTC)

Suggested addition to Parallel Lights section

From pov newsgroup wip disussion [1] Alain Martel gave following tip": " You only need to make it just distant enough that it is farther than the farthest other object in your scene." Which I believe would make sense as a Nice tip / note right after the mention of non shadowed areas thus something alng the lines of :

Parallel Lights

syntax:

light_source {
  LOCATION_VECTOR, COLOR
  [LIGHT_SOURCE_ITEMS...]
  parallel
  point_at VECTOR
  }

The parallel keyword can be used with any type of light source.

Note: For normal point lights, point_at must come after parallel.

Parallel lights are useful for simulating very distant light sources, such as sunlight. As the name suggests, it makes the light rays parallel.

Technically this is done by shooting rays from the closest point on a plane to the object intersection point. The plane is determined by a perpendicular defined by the light location and the point_at vector.

Two things must be considered when choosing the light location (specifically, its distance):

  1. Any parts of an object above the light plane still get illuminated according to the light direction, but they will not cast or receive shadows.
  2. fade_distance and fade_power use the light location to determine distance for light attenuation, so the attenuation still looks like that of a point source.
    Area light also uses the light location in its calculations.

Tip: For non faded lights, you only need to make location just distant enough from the center that it is farther than the farthest other object in your scene.

--Maurice 17:18, 25 January 2021 (UTC)

Done... i also did some needed grammar cleanup

--jholsenback 18:50, 31 January 2021 (UTC)