POV-Ray : Newsgroups : povray.binaries.images : Isosurface self shadow? Server Time
9 Aug 2024 09:04:55 EDT (-0400)
  Isosurface self shadow? (Message 1 to 8 of 8)  
From: Mienai
Subject: Isosurface self shadow?
Date: 10 Mar 2005 04:15:01
Message: <web.42300f7283cbb9cbc7fccea0@news.povray.org>
So I've created an isosurface object, unfortunately where it curves down
(from light to dark) the transition shadow gets real jagged.  I found that
if I decrease the accuracy to .00001 it gets rid of it, unfortunately my
object now takes FOREVER.  Is there another way around this?


Post a reply to this message


Attachments:
Download 'shadow.jpg' (21 KB)

Preview of image 'shadow.jpg'
shadow.jpg


 

From: Mike Williams
Subject: Re: Isosurface self shadow?
Date: 10 Mar 2005 05:03:27
Message: <s20ISAAftBMCFwlY@econym.demon.co.uk>
Wasn't it Mienai who wrote:
>So I've created an isosurface object, unfortunately where it curves down
>(from light to dark) the transition shadow gets real jagged.  I found that
>if I decrease the accuracy to .00001 it gets rid of it, unfortunately my
>object now takes FOREVER.  Is there another way around this?

I think you'll have to tell us the formula that you're using for the
isosurface. I guess it's not a conventional f_sphere() or {x*x + y*y +
z*z - R*R} because they don't do that, and they render quickly with
.00001 accuracy.



-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mienai
Subject: Re: Isosurface self shadow?
Date: 10 Mar 2005 13:40:00
Message: <web.423093d6e6da3c075824183b0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> I think you'll have to tell us the formula that you're using for the
> isosurface. I guess it's not a conventional f_sphere() or {x*x + y*y +
> z*z - R*R} because they don't do that, and they render quickly with
> .00001 accuracy.
>
> --
> Mike Williams
> Gentleman of Leisure

Right now it's not any particular function, there's a few of them but the
all appear to exibit the same problem.  For the image I posted it is just a
f_sphere() and while on it's own doen't take much time with the greater
accuracy, if I start to modify it with something like f_agate() and give it
some reflection as well the render starts to become encumbersome.


Post a reply to this message

From: Slime
Subject: Re: Isosurface self shadow?
Date: 10 Mar 2005 13:46:49
Message: <42309619$1@news.povray.org>
An accuracy of .00001 shouldn't be *that* bad for render times. max_gradient
may also be a factor; if you have it too large, that might slow things down
a lot.

You might want to extract a minimal isosurface object from your scene which
has this speed problem, show it to us, and let us see if we can increase the
accuracy without killing render times.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Mienai
Subject: Re: Isosurface self shadow?
Date: 10 Mar 2005 17:05:02
Message: <web.4230c3f6e6da3c07ab83a5640@news.povray.org>
k, so here's the code to my first object right now, sorry about the mess :).

#local trn=3;
#local r=.25;

union{
 #while (trn>0)
  intersection{
   isosurface{
    function{
     f_helix1 (f_r(x,y,z)-3, f_th(x,y,z), y, 4, 4, .05,
      #if (trn=2)
       -atan(x/(abs(z)+.0000001))/(2*pi)+(.5*trn-r)
      #else
       atan(x/(abs(z)+.0000001))/(2*pi)+(.5*trn-r)
      #end
      , 2, 0, 0)
     - f_agate(x/2,y/2,z/2)*.01
    }
    contained_by{sphere{<0,0,0>,8}}
    #if(trn=1)
     max_gradient 15.0
    #end
    #if (trn=2)
     max_gradient 1.4
    #end
    #if(trn=3)
     max_gradient 3.4
    #end
    max_trace .01 all_intersections
    accuracy .00001
   }
   #if (trn=2)
    plane{-z,0}
   #else
    plane{z,0}
   #end
  }
  #local trn=trn-1;
 #end

 hollow
 pigment {Black}
 finish{
  Phong_Shiny
  reflection{,1}
 }
}

So if you're wondering what I'm trying to do, I've taken the spiral function
and changed it so it's a spiraled torus, but then I modded it again so that
as it wraps around the y-axis, it's minor radius decreases.  The result
looks similar to the MC Escher picture 'Spirals.'  I had to do it in 3
sections because of the nature of the function, so that's why theirs a
loop.  I thought that looked too flat so I subtracted some f_agate() from
it to give it some texture.  All the max_gradients are optimised for the
individual parts, and I added in the max_trace becase I was loosing the
visibility of some portions looking through it.  This is my first run with
the accuracy altered from default but that shadowing problem was evident in
the previous run (which took ~12hrs, picture below) despite being under a
reflective finish, I could still see the shadowing pixelation.

The end result is something that took several hours to render without the
finish on, I don't remember how many.  Right now I'm running it at high
radiosity settings on my dual P3 866MHz machine (2 threads, the image is
split into 2) and is just about pre-rendering @~12hrs.  And I'm sure it may
come up so here's my radiosity settings:
radiosity {
 pretrace_start 0.08
 pretrace_end   0.005
 count 400
 error_bound 0.1
 recursion_limit 1
}

Any thoughts?  I'll post an image when it finishes.


Post a reply to this message


Attachments:
Download 'spirals5.jpg' (78 KB)

Preview of image 'spirals5.jpg'
spirals5.jpg


 

From: Mienai
Subject: Re: Isosurface self shadow?
Date: 10 Mar 2005 17:10:00
Message: <web.4230c4a1e6da3c07ab83a5640@news.povray.org>
Here's an earlier run with out the reflextion and accuracy adjustment, you
can see the shadow better.


Post a reply to this message


Attachments:
Download 'spirals4.jpg' (68 KB)

Preview of image 'spirals4.jpg'
spirals4.jpg


 

From: Slime
Subject: Re: Isosurface self shadow?
Date: 10 Mar 2005 18:20:38
Message: <4230d646$1@news.povray.org>
OK. Here are some tips:

all_intersections (and you can remove max_trace since all_intersections
overrides it) slows things down significantly. I recognize that it can be
necessary when used in an intersection, but your intersections are simple
and they can be eliminated by either changing the isosurface functions (with
max(z, ...) and max(-z, ...)) or by using a box for contained_by which cuts
the isosurface off at the appropriate place. Then only the first
intersection of the isosurface needs to be found which speeds up the render.
I've used the former choice.

The agate function is being evaluated many times and is considerably slowing
things down, yet it only has a very slight effect on the surface. You can
remove it from the function and put it into a normal{} block instead, and
that will probably create almost exactly the same effect while making things
a lot faster. This also may let you decrease the max_gradients (I haven't
bothered to try).

Your contained_by object is a sphere which is much bigger than the object
itself (mostly in the vertical direction). You would probably benefit from
using boxes instead, using a separate, tighter one for each of your three
isosurfaces. (This also lets you remove the max() calls from the function
that I mentioned earlier.)

You can simplify your atan calls to atan2(x,abs(z))

After my changes - I'm not sure if they're what helped or not - I didn't
have any shadow problems with an accuracy of .0001.

union{
 #while (trn>0)
   isosurface{
    function{
     max (
      f_helix1 (f_r(x,y,z)-3, f_th(x,y,z), y, 4, 4, .05,
       #if (trn=2)
        -atan2(x,abs(z))/(2*pi)+(.5*trn-r)
       #else
        atan2(x,abs(z))/(2*pi)+(.5*trn-r)
       #end
       , 2, 0, 0
      )
      #if (trn=2)
       , -z
      #else
       , z
      #end
     )
    }
    contained_by{sphere{<0,0,0>,8}}
    #if(trn=1)
     max_gradient 15.0
    #end
    #if (trn=2)
     max_gradient 1.4
    #end
    #if(trn=3)
     max_gradient 3.4
    #end
    accuracy .0001
   }
  #local trn=trn-1;
 #end

 hollow
 pigment {rgb 1}
 /*finish{
  Phong_Shiny
  reflection{,1}
 }*/
 normal {
  agate .2
  scale .5
 }
}

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Mienai
Subject: Re: Isosurface self shadow?
Date: 12 Mar 2005 02:10:01
Message: <web.42329520e6da3c07d83678c00@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> OK. Here are some tips:
>
>  - Slime
>  [ http://www.slimeland.com/ ]

Thanks for all those, definitely will help in future projects.  As for the
f_agate, I was hoping that it would have more influence than those setting
provided, enought where just a normal wouldn't work, but maybe
pre-rendering with a normal instead to see if it has the level of effect
I'm going for would be a good idea.  This one was mostly me learning to use
isosurfaces.  Thanks again.


Post a reply to this message

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