POV-Ray : Newsgroups : povray.binaries.images : Blobs as container : Re: Blobs as container Server Time
9 Aug 2024 19:39:15 EDT (-0400)
  Re: Blobs as container  
From: Alain
Date: 14 Dec 2004 19:56:28
Message: <41bf8bbc@news.povray.org>
JC (Exether) nous apporta ses lumieres ainsi en ce 2004-12-14 10:03... :

> Hi,
>
> For my PovComp WIP, I'm trying to use blobs as liquid containers. I 
> have made a little scene to illustrate the problem I have.
> In this scene you see eight containers, on the right are two CSG 
> containers to check if the problem appears. On the left you have 3 
> series of blob container from deep on the right to shallow on the left.
> They are all filled with liquid, first plane, the containers are 
> filled with a semi sphere that is a little bigger than the hole (which 
> is what I would like to do) and second plane, the liquid is 
> 'differenced' to be a little bit smaller than the hole.
>
> As you can see all the first plane blob containers have a line 
> appearing at the contact between the liquid's surface and the 
> container. And this line gets thicker as the slope is less steep.
>
> Is this a bug ? Is it something I made wrong (I made the code 
> available) ? Is there any way to avoid it ?
>
> Thanks for your help,
>
> JC
>
> ------------------------------------------------------------------------
>
>
>------------------------------------------------------------------------
>
>// Persistence of Vision Ray Tracer Scene Description File
>// File: ?.pov
>// Vers: 3.5
>// Desc: Radiosity Scene Template
>// Date: mm/dd/yy
>// Auth: ?
>//
>
>#version 3.5;
>
>#declare Radiosity=on;
>
>global_settings {
>  assumed_gamma 1.5
>  #if (Radiosity)
>    radiosity {
>      pretrace_start 0.08
>      pretrace_end   0.01
>      count 50           
>      nearest_count 5    
>      error_bound 0.9    
>    }
>  #end
>}
>
>#default {
>  texture {
>    pigment {rgb 1}
>    #if (Radiosity)
>      finish {
>        ambient 0.0
>        diffuse 0.6
>        specular 0.3
>      }
>    #else
>      finish {
>        ambient 0.1
>        diffuse 0.6
>        specular 0.3
>      }
>    #end
>  }
>}
>
>// ----------------------------------------
>
>camera {
>  right x*image_width/image_height
>  location  <0,3,-4>
>  look_at   <0,1,0>
>  angle 55
>}
>
>light_source {
>  <40,30,-45>       // light's position
>  color rgb <1, 1, 1>  // light's color
>}
>
>// ----------------------------------------
>
>plane { y, 0 }
>plane { y, -10 }
>
>#declare M_Water= material {
>        texture{
>            #declare SC=1/255;
>            pigment{rgbt <SC*57, SC*63, SC*66, 0.9>}
>            finish{ambient 0 diffuse 0.3 reflection {0,1 fresnel on} conserve_energy
specular 0.4 roughness 0.003 }
>        }
>        interior{
>            ior 1.34
>            fade_distance 1
>            fade_power 1001
>            fade_color rgbt <SC*37, SC*63, SC*45, 0.7>
>        }
>}
>
>// create a smooth blobby shape
>#declare RadiusVal   = 1.0; // (0 < RadiusVal) outer sphere of influence on other
components
>#declare StrengthVal = 1.0; // (+ or -) strength of component's radiating density
>
>#macro BBassin (thr, flat)
>blob {
>  threshold thr
>  sphere { y, RadiusVal, StrengthVal }
>  sphere { <0,1.5*flat,0>, RadiusVal*0.7*flat, -StrengthVal }
>  sphere { <0,1.2*flat,0>, RadiusVal*0.5*flat, -StrengthVal }
>}
>#end
>
>#local SBassin1 = difference {
>  sphere { <0,1,0>, 0.6 }
>  sphere { <0,1.5,0>, 0.5 }
>  sphere { <0,1.2,0>, 0.4 }
>}
>#local SBassin2 = difference {
>  sphere { <0,1,0>, 0.59 }
>  sphere { <0,1.5,0>, 0.49 }
>  sphere { <0,1.2,0>, 0.4 }
>}
>
>
>#declare Water = intersection {
>  sphere { <0,1.15,0>, 0.5 }
>  cylinder { <0,0.7,0>, <0,1.15,0>, 0.51 }
>}
>
>#local e=0.6;
>union {
>  object { BBassin (0.4, 1.0) }
>  object { Water material { M_Water } }
>  translate <e,0,-e>
>}
>union {
>  object { BBassin (0.4, 1.0) }
>  difference { object { Water } object { BBassin (0.39,1.0) } material { M_Water } }
>  translate <e,0,e>
>}
>union {
>  object { BBassin (0.4, 1.1) }
>  object { Water material { M_Water } }
>  translate <-e,0,-e>
>}
>union {
>  object { BBassin (0.4, 1.1) }
>  difference { object { Water } object { BBassin (0.39,1.1) } material { M_Water } }
>  translate <-e,0,e>
>}
>union {
>  object { BBassin (0.4, 1.2) }
>  object { Water material { M_Water } }
>  translate <-3*e,0,-e>
>}
>union {
>  object { BBassin (0.4, 1.2) }
>  difference { object { Water } object { BBassin (0.39,1.2) } material { M_Water } }
>  translate <-3*e,0,e>
>}
>union {
>  object { SBassin1 }
>  object { Water material { M_Water } }
>  translate <3*e,0,-e>
>}
>union {
>  object { SBassin1 }
>  difference { object { Water } object { SBassin2 } material { M_Water } }
>  translate <3*e,0,e>
>}
>
>  
>
You've been hit by a bad case of 
ray-misses-the-intersection-between-two-surfaces-and-hit-what's-behind!
Adding a different interior_textures to each examples give me 6 
differently coloured areas where you have black.
My render (raised the camera a bit, no radiosity, interior with ambient 1):

Alain


Post a reply to this message


Attachments:
Download 'essai_fringe.png' (86 KB)

Preview of image 'essai_fringe.png'
essai_fringe.png


 

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