home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 3
/
CDASC03.ISO
/
maj
/
4174
/
dat
/
colors.inc
next >
Wrap
Text File
|
1993-04-01
|
5KB
|
142 lines
// define surface characteristics this file includes simple matte and
// reflective surface characteristics for some common colors.
// Polyray input file - Alexander Enzmann
// First define some standard surface characteristics, matte, shiny (plastic),
// reflective.
define matte
surface {
ambient 0.1
diffuse 0.7
}
define shiny
surface {
ambient 0.1
diffuse 0.6
specular white, 0.6
microfacet Phong 7
}
define reflective
surface {
ambient 0.1
diffuse 0.5
specular white, 0.5
microfacet Phong 7
reflection white, 0.5
}
define metallic
surface {
ambient 0.1
diffuse 0.5
specular 0.6
microfacet Phong 5
reflection white, 0.25
}
// Now build textures using different colors for the surfaces above
// First the matte colors. Diffuse reflections only, no shiny spot
define matte_white texture { matte { color white } }
define matte_grey texture { matte { color grey } }
define matte_black texture { matte { color dark_slate_gray } }
define matte_red texture { matte { color red } }
define matte_blue texture { matte { color blue } }
define matte_green texture { matte { color green } }
define matte_cyan texture { matte { color cyan } }
define matte_yellow texture { matte { color yellow } }
define matte_magenta texture { matte { color magenta } }
define matte_orange texture { matte { color orange } }
define matte_aquamarine texture { matte { color aquamarine } }
define matte_brown texture { matte { color brown } }
// Now the standard plastic coloration, diffuse color plus shiny white spot
define shiny_red texture { shiny { color red } }
define shiny_green texture { shiny { color green } }
define shiny_blue texture { shiny { color blue } }
define shiny_cyan texture { shiny { color cyan } }
define shiny_yellow texture { shiny { color yellow } }
define shiny_magenta texture { shiny { color magenta } }
define shiny_orange texture { shiny { color orange } }
define shiny_coral texture { shiny { color coral } }
define steel_blue texture { shiny { color steel_blue } }
// A set of surfaces that combine color with reflectivity
define reflective_white texture { reflective { color white } }
define reflective_grey texture { reflective { color grey } }
define reflective_red texture { reflective { color red } }
define reflective_blue texture { reflective { color blue } }
define reflective_green texture { reflective { color green } }
define reflective_cyan texture { reflective { color cyan } }
define reflective_yellow texture { reflective { color yellow } }
define reflective_magenta texture { reflective { color magenta } }
define reflective_orange texture { reflective { color orange } }
define reflective_coral texture { reflective { color coral } }
define reflective_brown texture { metallic { color brown } }
define reflective_tan texture { metallic { color tan } }
define reflective_gold texture { metallic { color coral } }
// And now some specific colors
define glass
texture {
surface {
ambient 0
diffuse 0
specular 0.2
reflection white, 0.1
transmission white, 1, 1.5
}
}
define mirror
texture {
surface {
ambient white, 0.1
diffuse white, 0.2
specular 0
reflection white, 1
}
}
// Now we define some color map lookup functions that provide the ability
// to mimic the predefined texture functions in other raytracers. Most of
// these would be modified in some way, perhaps to add more or less turbulence
// to one of the variables, or perhaps to perform scaling in one or more
// direction. The look of a texture that uses one of these functions will
// depend on how much it is scaled and what the color map looks like
define agate_fn ((sin(6.2832 * (1.1*z + 2.6*noise(P, <2.8,0.5,4>)))+1)/2)^0.77
define marble_fn sawtooth(x + 2*noise(P, 4))
define granite_fn noise(7*P, 5)
define wood_fn sawtooth(sqrt(x*x+y*y))
define odd_wood1
sawtooth(|<x+sin(x+dnoise(P,3)[0]), y+sin(y+dnoise(P,3)[1]), 0>|)
define noisy_wood_fn
sawtooth(|<x+0.05*sin(6.28*(x+2*dnoise(P,3)[0])),
y+0.05*sin(6.28*(y+2*dnoise(P,3)[1])), 0>|)
define bozo_fn noise(P, 1)
define leopard_fn ((sin(x)+sin(y)+sin(z))/3)^2
define onion_fn fmod(|P|, 1)
define noisy_onion_fn fmod(|P|+noise(P, 3), 1)
define checker_fn |fmod(floor(x)+floor(y)+floor(z), 2)|
define checker3_fn |fmod(floor(x)+floor(y)+floor(z), 3)|
define pi 3.1415926535897932384626
define radial_fn (1 + atan2(x, z)/pi)/2
// Some standard sorts of color maps to use with the functions above (or
// modifications thereof).
define white_marble_map
color_map([0, 0.8, white, 0.5*white]
[0.8, 1, 0.5*white, 0.2*white])
define red_marble_map
color_map([0, 0.8, <1, 0.6, 0.6>, <1, 0.4, 0.4>]
[0.8, 1, <1, 0.4, 0.4>, <1, 0.1, 0.1>])
define jade_color_map
color_map([0, 0.8, <1, 0.6, 0.1>, <0, 0.3, 0>]
[0.8, 1, <0.1, 0.5, 0.1>, <0, 0, 0.3>])
define sky_color_map
color_map([0, 0.5, <0.2, 0.2, 0.5>, <0.2, 0.2, 0.5>]
[0.5, 0.6, <0.2, 0.2, 0.5>, 0.75*white]
[0.6, 1, 0.75*white, 0.25*white])