|
 |
The upper left object has a simple material with interior color, and can
be used as wine.
But suppose you want ripples on the wine's surface? Simply adding a
normal to the material causes ripples all over, not just on the upper
surface. The upper right object shows the result. (I used 'quilt'
instead of ripples to better illustrate the normal.)
The obvious solution, especially if we're creating a macro that can vary
the wine's pour level, is to intersect the top of the wine with a
material that has the normal; but for some reason, this kills the
interior color. The result is at the lower left.
It turns out that I can get the desired result by applying a naked
texture to the intersecting plane. This is shown in the object at the
lower right. But I am still puzzled why using a material failed.
---%<-----%<-----%<-----%<---[BEGIN CODE]---%<-----%<-----%<-----%<---
#version 3.7;
//-------------------- AN ENVIRONMENT ----------------------
camera
{ location <0, 25, -23>
look_at <0, 2.3, 0>
right x
angle 17.5
}
global_settings
{ assumed_gamma 1
max_trace_level 100
}
light_source
{ <35, 73, -61>, rgb 360000
fade_distance 0.12
fade_power 2
spotlight point_at <0, 2, 0>
radius -90 falloff 90 tightness 2
}
box
{ -<72, 0.001, 72>, <72, 96, 72>
hollow
pigment { rgb 1 }
finish { diffuse 0.6 ambient rgb 0.1 emission 0 }
}
//----------------------- THE TEST -------------------------
#declare t_Wine = texture
{ pigment { rgbf 1 }
finish
{ reflection { 1 fresnel } conserve_energy
specular albedo 0.028 roughness 0.0003
}
}
#declare m_Wine = material
{ texture { t_Wine }
interior
{ ior 1.34
fade_color rgb <0.9, 0, 0.6>
fade_distance 0.2
fade_power 1000
}
}
#declare n_Surface = normal { quilted -0.6 scale 0.5 rotate 45 * y}
intersection // smooth material
{ sphere { y, 1 scale <2, 4, 2> }
plane { y, 4 }
hollow
material { m_Wine }
translate <-2.25, 0, 3>
}
intersection // material with normal
{ sphere { y, 1 scale <2, 4, 2> }
plane { y, 4 }
hollow
material { m_Wine texture { t_Wine normal { n_Surface } } }
translate <2.25, 0, 3>
}
intersection // material with intersecting material
{ sphere { y, 1 scale <2, 4, 2> }
plane
{ y, 4
material { m_Wine texture { t_Wine normal { n_Surface } } }
}
hollow
material { m_Wine }
translate <-2.25, 0, -3>
}
intersection // material with intersecting texture
{ sphere { y, 1 scale <2, 4, 2> }
plane
{ y, 4
texture { t_Wine normal { n_Surface } }
}
hollow
material { m_Wine }
translate <2.25, 0, -3>
}
--->%----->%----->%----->%----[END CODE]---->%----->%----->%----->%---
Post a reply to this message
Attachments:
Download 'cutaway_normal_mat.jpg' (59 KB)
Preview of image 'cutaway_normal_mat.jpg'

|
 |
|
 |
Cousin Ricky <ric### [at] yahoo com> wrote:
> The obvious solution, especially if we're creating a macro that can vary
> the wine's pour level, is to intersect the top of the wine with a
> material that has the normal; but for some reason, this kills the
> interior color. The result is at the lower left.
>
> It turns out that I can get the desired result by applying a naked
> texture to the intersecting plane. This is shown in the object at the
> lower right. But I am still puzzled why using a material failed.
Best I can figure is that your sphere is just a regular thing, and has a default
ior of 1. But your material has a different ior, and so you might get some sort
of interface where Snell's law applies, and depending on your viewing angle, you
might hit that critical angle.
Not to mention that the quilted normal probably gives you lens-like effects.
Your successful experiment applies the ior to the whole intersection result.
Try it with a different normal, different viewing angle, and try one experiment
where the sphere is given an interior ior as well before intersecting.
Maybe there's a solution in there somewhere. . .
- BW
Post a reply to this message
|
 |
|
 |
On 3/24/25 13:24, Cousin Ricky wrote:
> The obvious solution, especially if we're creating a macro that can vary
> the wine's pour level, is to intersect the top of the wine with a
> material that has the normal; but for some reason, this kills the
> interior color. The result is at the lower left.
It's always been the case that the interior{} intersections must be
'clean' for the fade_* features to work correctly.
Meaning, for the fading calculations there cannot be terminating or
intervening surfaces unrelated to those forming an interior region.
Your case is, I believe, more complicated in that by referencing the
'material' wrap of a texture{} and interior{} for the plane in the
intersection for the lower left case, you've created a situation where
two different interior{} definitions are seen (that they are identical
doesn't matter) which are attached to two different transparent surfaces.
Where the starting and stopping intersections are on different surfaces
with respect to the attached interiors, no fading calculations get done.
Attached is an image where for the lower left case I changed:
hollow
material { m_Wine }
to:
hollow
texture { pigment {rgb 1 } }
This makes the fade calculation for interior attached to the plane in
the intersection 'clean'. Not what you want of course, but yep...
Bill P.
Post a reply to this message
Attachments:
Download 'cricky.png' (158 KB)
Preview of image 'cricky.png'

|
 |