1 // This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
2 // To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a
3 // letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
5 // Persistence of Vision Ray Tracer Scene Description File
6 // File: gamma_showcase.pov
8 // Desc: Gamma Handling Test Scene - An arrangement of spheres on a marble plane
10 // Auth: Christoph Lipka
11 // MORE INFORMATION: http://wiki.povray.org/content/Documentation:Tutorial_Section_3.3#Gamma_Handling
14 // +w640 +h480 +a0.3 +am1 +fN -d File_Gamma=sRGB Output_File_Name=gamma_showcase.png
15 // +w640 +h480 +a0.3 +am1 +fN -d File_Gamma=1.0 Output_File_Name=gamma_showcase_linear.png
16 // +w320 +h240 +a0.3 +am1 +fN -d File_Gamma=sRGB Output_File_Name=gamma_showcase_ref0.png Declare=Stripes=off
17 // +w320 +h240 +a0.3 +am1 +fN -d File_Gamma=sRGB Output_File_Name=gamma_showcase_ref1.png Declare=Stripes=off Declare=Gamma=1.2
18 // +w320 +h240 +a0.3 +am1 +fN -d File_Gamma=sRGB Output_File_Name=gamma_showcase_ref2.png Declare=Stripes=off Declare=Gamma=0.8
19 // +w640 +h480 +a0.3 +am1 -f +d
27 #
declare Stripes
= on;
57 specular 0.6 roughness 0.001
58 reflection { 0.0 1.0 fresnel
on }
64 // ----------------------------------------
66 #local TestRed
= rgb <0.5,0.1,0.1>;
67 #local TestGreen
= rgb <0.1,0.5,0.1>;
68 #local TestBlue
= rgb <0.1,0.1,0.5>;
70 #local CameraFocus
= <0,0.5,0>;
71 #local CameraDist
= 8;
72 #local CameraDepth
= 1.8;
73 #local CameraTilt
= 20;
77 direction z*CameraDepth
78 right x*image_width
/image_height
80 translate <0,0,-CameraDist
>
85 #macro LightSource
(Pos
,Color
)
91 radius 175/vlength(Pos
)
92 falloff 200/vlength(Pos
)
93 area_light x*vlength(Pos
)/10, y*vlength(Pos
)/10, 9,9 adaptive 1 jitter circular orient
98 LightSource
(<-500,500,-500>,TestRed
+ <0.2,0.2,0.2>)
99 LightSource
(< 0,500,-500>,TestGreen
+ <0.2,0.2,0.2>)
100 LightSource
(< 500,500,-500>,TestBlue
+ <0.2,0.2,0.2>)
102 // ----------------------------------------
104 #macro DarkStripeBW
(TargetBrightness
)
105 #
if (TargetBrightness
< 0.5)
108 (TargetBrightness
*2 - 1.0)
112 #macro BrightStripeBW
(TargetBrightness
)
113 #
if (TargetBrightness
< 0.5)
120 #macro DarkStripeRGB
(TargetColor
)
121 <DarkStripeBW
(TargetColor.
red),DarkStripeBW
(TargetColor.
green),DarkStripeBW
(TargetColor.
blue)>
124 #macro BrightStripeRGB
(TargetColor
)
125 <BrightStripeBW
(TargetColor.
red),BrightStripeBW
(TargetColor.
green),BrightStripeBW
(TargetColor.
blue)>
128 #macro StripedPigment
(TargetColor
)
130 function
{ abs(mod(abs(image_height
*CameraDepth
*y/z+0.5),2.0)-1.0) }
132 [0.5 color rgb DarkStripeRGB
(TargetColor
) ]
133 [0.5 color rgb BrightStripeRGB
(TargetColor
) ]
135 translate <0,0,-CameraDist
>
137 translate CameraFocus
146 texture { T_Stone11
}
150 #macro GammaAdjust
(C
,G
)
151 #local C2
= color rgbft <pow(C.
red,G
),pow(C.
green,G
),pow(C.
blue,G
),pow(C.
filter,G
),pow(C.
transmit,G
)>;
155 #macro TestSphere
(Pos
,Radius
,TargetColor
,Split
)
157 Pos
+ y*Radius
, Radius
158 texture { pigment { color GammaAdjust
(TargetColor
,Gamma
) } }
163 Pos
+ y*Radius
+ x*0.001, Radius
164 texture { pigment { StripedPigment
(TargetColor
) } }
170 TestSphere
(<-2,0,1>, 1, TestRed
, true)
171 TestSphere
(< 0,0,1>, 1, TestGreen
, true)
172 TestSphere
(< 2,0,1>, 1, TestBlue
, true)
177 #local Color2
= TestRed
;
179 #local Color2
= TestBlue
;
181 #local P
= abs(I
-0.5)*2;
182 TestSphere
(<I
*4-2,0,-0.5>, 2/Steps
, (1-P
)*TestGreen
+ P
*Color2
, true)
187 TestSphere
(<I
*4-2,0,-1.5>, 2/Steps
, rgb I
, true)
188 TestSphere
(<I
*4-2,0,-2.0>, 2/Steps
, GammaAdjust
(rgb I
, 2.2*Gamma
), false)