POV-Ray : Newsgroups : povray.news-submissions : How to avoid the artifacts about height_map? : Re: How to avoid the artifacts about height_map? Server Time
24 Apr 2024 10:42:48 EDT (-0400)
  Re: How to avoid the artifacts about height_map?  
From: Kenneth
Date: 5 Jan 2013 18:20:01
Message: <web.50e8b38ed45462dac2d977c20@news.povray.org>
"Terry  Chen" <nwp### [at] gmailcom> wrote:

> Thank you very much, but it still has problems , for the side faces of the
> intersection object no refractions came out. The front and left face seem that
> they don't exist, so we can directly see the bottom as if no water is here.
>
> from http://www.f-lohmueller.de/pov_tut/all_shapes/shapes655e.htm,
> I changed the sign of D,finally this can get a good result.What shocks me is
> that the sign is very important. Only <D,-D,D> works well.
>

Oh, now I see what you are trying to do. (Sorry, I was confused about what your
problem was. Your link to Freidrich Lohmuller's page made it clear.)

His page actually has some small mistakes, in his use of D there. I had to work
that out too.

To get what you want, your box needs to be made *smaller* on all sides than the
height_field (*except* for the top and bottom surfaces of the box.) This is what
creates the solid 'sides' of the height_field, in an intersection. If the box is
made smaller on the TOP, it will cut away some of your water waves (but they
will still be solid.) If it is made smaller on the BOTTOM, the intersection may
not be solid in certain places there--it is just like using water_level. (The
'top' and 'bottom' of a height_field behave differently in an intersection.)

But here is something interesting, and useful to know: A height_field, by
nature, actually has an *infinite* depth in -y. It is invisible, but it is
there. Because of this, the bottom of your intersection box could have a large
NEGATIVE value for y, and the intersection will still be 'solid', way down in
-y.

Here is your code again. I have added a few things, to make it more useful for
you. Now, you can make your water any 'depth' that you want, and it will remain
solid on all sides. Note that the water depth and the height_field scale are two
separate things now.

#declare D = 0.00001;
#declare water_depth = .3; // any positive value
#declare HF_y_scale = 0.55; // for the scale of the 'top surface' of the
// water; any positive value

intersection{
height_field {
sys "Surface.bmp"
smooth
scale <1,HF_y_scale,1>
translate <0,water_depth,0>
 }

box{
 <D,-D,D>, // the bottom y-value can be anything now, + or -, but no higher
// than water_depth
<1-D,water_depth + HF_y_scale + D,1-D> // x and z are *smaller* than the
// height_field, not larger.
 }

 texture
    {
        pigment {color rgbf <1, 1, 1, 1>} // Here, rgbf does the same as rgbt
// because the water has no 'color.' Try changing it to rgbf <.85,.90,1,1>
        finish
        {
            ambient 0.0
            diffuse 0.0
            reflection
            {
                0.02, 1.0
                fresnel on
            }
            specular 1
            roughness .03
        }
     }
interior {ior 1.33}
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.