02_user_tutorials:04_light_modelling:light-modeling-light-sources
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| 02_user_tutorials:04_light_modelling:light-modeling-light-sources [2025/01/24 15:51] – removed - external edit (Unknown date) 127.0.0.1 | 02_user_tutorials:04_light_modelling:light-modeling-light-sources [2025/01/24 15:51] (current) – ↷ Page moved from 02_user_tutorials:light_modelling:light-modeling-light-sources to 02_user_tutorials:04_light_modelling:light-modeling-light-sources tim2 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Light Sources ====== | ||
| + | |||
| + | Regarding light sources, GroIMP provides a complete set of possible implementations. They all implement the //Light// and // | ||
| + | |||
| + | |||
| + | The following code places the three light sources next to each other starting with a // | ||
| + | |||
| + | <code java> | ||
| + | protected void init () [ | ||
| + | Axiom ==> | ||
| + | [ Translate(0.0, | ||
| + | LightNode.(setLight(new PointLight())) | ||
| + | M(-0.6) TextLabel(" | ||
| + | [ Translate(0.75, | ||
| + | LightNode.(setLight(new SpotLight())) | ||
| + | M(-0.1) TextLabel(" | ||
| + | [ Translate(1.5, | ||
| + | LightNode.(setLight(new DirectionalLight())) | ||
| + | M(-0.1) TextLabel(" | ||
| + | ; | ||
| + | ] | ||
| + | </ | ||
| + | |||
| + | In the 3D View, they are visualized as a cone for a // | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |||
| + | All light sources provide the functionality of visualizing the light rays emitted by them. To do so, the visualization just need to be activated. Additionally, | ||
| + | |||
| + | <code java> | ||
| + | protected void init () [ | ||
| + | Axiom ==> | ||
| + | LightNode.(setLight(new PointLight().( | ||
| + | setVisualize(true), | ||
| + | setNumberofrays(400), | ||
| + | setRaylength(0.5) | ||
| + | ))); | ||
| + | ] | ||
| + | </ | ||
| + | |||
| + | The output of the light ray visualization of the three light sources is given below. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |||
| + | ===== PointLight ===== | ||
| + | |||
| + | A // | ||
| + | |||
| + | ===== SpotLight ===== | ||
| + | |||
| + | As a specialization of a // | ||
| + | |||
| + | ===== DirectionalLight ===== | ||
| + | |||
| + | The // | ||
| + | |||
| + | ===== AreaLight ===== | ||
| + | |||
| + | An area light can be created using a parallelogram as base and transforming it to a light source. It will cast a diffuse distribution in the positive direction of the local z-axis of the parallelogram. Note, as for now, it does not (yet) support user defined physical light distribution. | ||
| + | |||
| + | <code java> | ||
| + | module AreaLamp extends Parallelogram() { | ||
| + | { | ||
| + | setLight(new AreaLight().(setPower(100))); | ||
| + | setLength(1); | ||
| + | setAxis(0.5f, | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== PhysicalLight ===== | ||
| + | |||
| + | tbd | ||
| + | |||
| + | |||
| + | ===== Power distribution over several light sources ===== | ||
| + | |||
| + | The power of all light sources implemented within GroIMP are given/set in Watt. When the light model is executed, the number of light rays is distributed no equally over all light sources, but rather relative to their power! This has the consequence that when a light source with a high power and one with a very low power are together in a scene, the physical power distribution of the light source with the lower power will be very much underrepresented. | ||
| + | |||
| + | As an example, a scene with two light sources with a power of 10W and 90W, and a total number of 10.000 rays, the first light will create 1.000 rays, the second one 9.000 rays. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |||
| + | |||
