File: raytracing_tutorial05.html

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 239,848 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; makefile: 93
file content (101 lines) | stat: -rw-r--r-- 4,117 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>BALLView Raytracing Demo 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<blockquote>
 	
<h3>Setting the Light Sources</h3>
In a typical scenario, the default light settings are often inappropriate. 
So let's try to recreate the better light settings as shown in the last step.
<br>
<br>
The light sources of the scene can be modified using the <b>Preferences</b> dialog.
Open it by clicking the menu entry 
<br>
<b>"Edit->Preferences"</b>
<br>
and highlighting the entry <b>"Lighting"</b>.
<br>

<h4>Setting the Light Intensity</h4>
Playing with the light intensity and attenuation is one of the keys
to creating exciting raytracing images.

Change the intensity of the current light by highlighting <b>Light 1</b>
in the <b>Light Sources</b> list and setting its intensity to <b>500</b>.
Activate your choice by pressing the <b>Apply</b> button. 
<br>

<h4>Set the Light Position</h4>
A light's position can either be 
<ul>
<li>relative to the camera or
<li>absolute in the scene.
</ul>
In order to find a good light position, we attach the light to the camera,
move until an acceptable scene is reached, and then change it to an absolute position.<br>
First attach the light relative to the camera at <b>Position (1, -2, -15)</b> and 
activate this change by pressing the <b>Apply</b> button. <br>
Then find an appropriate light position by changing
the camera location (clicking and draging the mouse).<br>
If you found a nice spot, switch to an <b>absolute</b> light orientation and activate
it by clicking the <b>Apply</b> button. <br>
Now we can change the camera position, e.g., rotate around the molecule, but the
light will keep its position.<br>
Finally, try to set the light to the <b>absolute position</b> of <b>(-2, 24, -14)</b> 
(Do not forget to press the <b>Apply</b> button!)
and re<b>focus</b> the camera (Structures window->right click->Focus). 
<br>
The resulting scene is clearly too bright. 

This can be changed by setting the attenuation.
<br>


<h4>Change the Attenuation</h4>
The attenuation determines the loss of intensity with increasing distance
to the light source. It is determined by three 
coefficients:<ul>
	<li> constant, 
	<li> linear, and 
	<li>  quadratic.</ul>
Using constant attenuation, e.g., (2,0.0), the light intensity does not decrease 
with the distance.<br>
Linear attenuation, e.g., (0, 10, 0), yields a light intensity decreasing linearly with distance from the light source.<br>
Using quadratic attenuation, e.g. (0, 0, 1), the intensity decreases quadraticly.<br>
For the current scene set the <b>attenuation</b> to <b>(0, 0, 0.7)</b>.<br>
Activate your choice by pressing the <b>Apply</b> button. 
<br>

<h4>Change the Light's Colour</h4>
Sometimes a smoother light might look more appealing than a flashy light. <br>
The light's color can be changed by pressing the <b>Edit</b>-button of the
Intensity box. Choose a smoother color, e.g., light yellow. The color can be selected 
using the color picker, a CMYK model, or the RGB model.<br>
Set a light yellow color by choosing, in the RGB-Model, Red=255, Green=245, and Blue=208.<br> 
Activate your choice by pressing the <b>OK</b> button of the Select Color dialog and by pressing the <b>Apply</b> button. 
<br>


<h4>Add a Second Light Source</h4>
More advanced light settings can be achieved by positioning additional light sources which might spice up the scene. Note, however, that raytracing performance
decreases linearly with the number of light sources.<br/>

To add a point light source, press the <b>Add</b> button within the Light Sources list. 
All its properties can be easily changed after hightlighting the new light <b>Light 2</b>.
<br>
Try to position a second light source at absolute position <b>(-6.3, 3.1; -1)</b> 
with attenuation of <b>(1, 0, 0.9)</b>, and Intensity of <b>18</b>.<br>
Close the Preferences dialog by pressing the OK button.
<br>
<br>
Press <b>Next</b> to continue.
<br>
<br>
</blockquote>

</html>