|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
>
> Using average worked well for me (after much painful struggling) ;)
>
>
http://news.povray.org/povray.advanced-users/thread/%3Cweb.5d2ceb7afbee6e2d4eec112d0%40news.povray.org%3E/
>
>
> THAT is some pretty slick work, there. Nicely done.
> I would not have ever thought of using those tools - as I almost never play with
> them.
> A simple and elegant solution.
>
> I may have to investigate some of this further one day and see if I can make
> some interesting scenes that visually "show how this works".
Thanks. I cleaned it up a little bit to use 'average' with a pigment map to
combine the slope patterns instead of layering three separate textures, and
changed the 'phase' so the color maps run in the correct direction this time.
When using 'average' to combine colors, you need to multiply the base color by
the total number of colors being averaged, in order to preserve the full
strength of the output colors. See below, each of the rgb values are set to '3'
because I am averaging 3 colors together.
I guess the 'average' function *assumes* all input colors are going to be a
maximum of '1', and scales the output to be a maximum of '1', so increasing the
'weighting' value for all colors makes no difference.
// ----------------------------------------------------------------
#version 3.7;
//+w500 +h500 +am2 +a0.1 File_Gamma=1.0 Display_Gamma=1.0
#global_settings{assumed_gamma 1.0}
// ----------------------------------------------------------------
// TEXTURES
// ----------------------------------------------------------------
#declare X_RED =
pigment{
slope x
sine_wave frequency 0.5 phase -0.25
color_map{
[0 color rgb<0,0,0>]
[1 color rgb<3,0,0>]
}
}
#declare Y_GRN =
pigment{
slope y
sine_wave frequency 0.5 phase -0.25
color_map{
[0 color rgb<0,0,0>]
[1 color rgb<0,3,0>]
}
}
#declare Z_BLU =
pigment{
slope -z
sine_wave frequency 0.5 phase -0.25
color_map{
[0 color rgb<0,0,0>]
[1 color rgb<0,0,3>]
}
}
#declare NORMAL_MAP =
texture{
pigment{
average
pigment_map{
[1 X_RED]
[1 Y_GRN]
[1 Z_BLU]
}
}
finish{ambient 1 diffuse 0}
}
// ----------------------------------------------------------------
// SCENE
// ----------------------------------------------------------------
#declare fo_sphere = function{internal(61)}
isosurface{
function{fo_sphere(x,y,z,1)}
contained_by{sphere{<0, 0, 0>, 2}}
accuracy 0.001
max_gradient 2
texture{NORMAL_MAP}
}
camera{
orthographic
location <0, 0, -10>
up y*3
right x*3
look_at <0, 0, 0>
}
Post a reply to this message
Attachments:
Download 'normal_test.png' (32 KB)
Preview of image 'normal_test.png'
|
|