POV-Ray : Newsgroups : povray.beta-test : Povray 3.7 RC7, something strange with parametric surfaces? Server Time
28 Dec 2024 18:16:44 EST (-0500)
  Povray 3.7 RC7, something strange with parametric surfaces? (Message 1 to 6 of 6)  
From: Ryan Budney
Subject: Povray 3.7 RC7, something strange with parametric surfaces?
Date: 27 Feb 2013 14:10:01
Message: <web.512e5917524bb9ec1343b2e50@news.povray.org>
Greetings,

I'm a long-time PoVRay user and I'm encountering a problem with PovRay 3.7 RC7,
when it comes to parametric surfaces.

I have a small scene that renders fine when the surface is *not* in it, but with
the surface, the scene renders to 99% complete (rather quickly, using 8 cores),
but then it just sits there, with only 1 core running (via system monitor) at
100%.    It almost appears as if PovRay is failing to collect a "rogue thread"
but I can't really tell what's happening.   The scene is very small so I've
copied it below.

Are there any known issues with parametric surfaces and the PovRay beta?  I've
seen a post concerning textures but my surface is not textured -- it's just
partially transparent.

Thanks for any information.  The scene is copied below.

***

#version 3.7;

#include "colors.inc"
// #include "chars.inc"

#declare fontdir = "/usr/share/fonts/truetype/lyx/cmr10.ttf";

#declare flat_fin = finish { ambient 0.0 diffuse 1.0 reflection 0.05 };
#declare out_fin = finish { ambient 0.0 diffuse 1.0 reflection 0.0 };

#declare c1 = <1,0,0>; // tet vertices on sphere
#declare c2 = <0,1,0>;
#declare c3 = <0,0,1>;

#declare sr = 0.019; // sphere radius
#declare sc = rgb< 0.8, 0.8, 0.8 >; // sphere color 1
#declare cr = 0.01; // cylinder radius
#declare cc = rgb <1, 1, 1>; // cyl color 1

#declare dc0 = MediumSpringGreen; // dual 0-cell color
#declare dr0 = 0.022; // dual 0-cell radius
#declare dc1 = MediumSpringGreen; // dual 1-cell color
#declare dr1t = 0.013; // dual 1-cell tip radius
#declare dc1t = MediumSpringGreen; // dual 1-cell tip color
#declare dr1 = 0.012; // dual 1-cell radius

#declare textcolour = IndianRed;

#declare dc2a = rgbf <0.1, 0.9, 0.3, 0.6>; // slight green
#declare dc2b = rgbf <0.1, 0.3, 1, 0.6>;   // slight blue
#declare dc2c = rgbf <1, 0.2, 0.2, 0.6>;   // slight red
#declare dc2d = rgbf <0.8, 0.8, 0.1, 0.6>; // slight yellow

#declare tsurfc = rgbf < 0.8, 0.8, 0.8, 0.6 >; // trans surf

#declare dr2 = 0.004; // dual 2-cell outline radius

#declare TTh = 0.2; // text thickness

#declare tc1 = rgbf <0.8, 1, 0.8, 0>; // tetrahedron color 1
#declare tc2 = rgbf <1, 0.4, 0.4, 0>; // tetrahedron color 2

// our hyperboloid coordinate system
#declare C1 = function(r,A,l) { 1.0 - (r*sin(A)/sqrt(sinh(l)*sinh(l) +
cosh(l)*cosh(l))) }
#declare C2 = function(r,A) { r*cos(A) }
#declare Tx = function(r,A,l,T) { sinh(l)*cos(T)*C1(r,A,l) - C2(r,A)*sin(T) }
#declare Ty = function(r,A,l,T) { sinh(l)*sin(T)*C1(r,A,l) + C2(r,A)*cos(T) }
#declare Tz = function(r,A,l,T) { cosh(l)*C1(r,A,l) }

global_settings {
    radiosity {
      pretrace_start 0.08
      pretrace_end   0.04
      count 50

      nearest_count 5
      error_bound 0.2
      recursion_limit 4

      low_error_factor 0.4
      gray_threshold 0.0
      minimum_reuse 0.01
      brightness 1

      adc_bailout 0.01/2
    }
  }

camera {
         location <-6, 0, 0.5>
         look_at <0,0,0.75>
         angle 50
         sky z
       }

plane
 {
 <1,0,0>, 0
 pigment { checker color White, color White }
 finish { ambient 0 diffuse 1 reflection 0.05 }
 translate <2,0,0>
 }

// true type fonts located in /usr/share/fonts/truetype/jsmath  maybe
jsMath-cmr10.ttf is good?

light_source
{
 <-5, -2, 1 >
 color White
 area_light <0.6,0,0>,<0,0.6,0>,16,16
}


union
 {
    quadric
    {
     <1,1,-1>, <0,0,0>, <0,0,0>, 1
     clipped_by { sphere { <0,0,1>, 2 } }
     texture { pigment { color tsurfc } }
     finish { out_fin }
    }

    quadric
    {
     <1,1,-1>, <0,0,0>, <0,0,0>, 1
     clipped_by { plane { <0,0,-1>, -2 } }
     clipped_by { plane { <0,0,1>, 2.14 } }
     texture { pigment { color tsurfc } }
     finish { out_fin }
    }

    torus
    {
     sqrt(3), 0.02
     rotate <90, 0, 0>
     translate <0,0,2>
     texture { pigment { color dc2d } }
    }
// #declare Tx = function(r,A,l,T)
   parametric
    { // to draw hyperbolas on surface...
     function { Tx(0.1,v,u,0) },
     function { Ty(0.1,v,u,0) },
     function { Tz(0.1,v,u,0) }
     <-1,0>, <1, 2*pi >
     texture { pigment { color dc2d } }
    }

   plane
   {
    <0,0,1>, 0
    texture { pigment { color sc } }
    finish { out_fin }
    clipped_by { sphere { <0,0,0>, 1 } }
   }

    sphere
    {
    <0,0,-1>, 0.04
    texture { pigment { color sc } }
    finish { out_fin }
    }

 }


Post a reply to this message

From: Le Forgeron
Subject: Re: Povray 3.7 RC7, something strange with parametric surfaces?
Date: 27 Feb 2013 18:33:11
Message: <512e97b7$1@news.povray.org>
Le 27/02/2013 20:05, Ryan Budney nous fit lire :
> Greetings,
> 
> I'm a long-time PoVRay user and I'm encountering a problem with PovRay 3.7 RC7,
> when it comes to parametric surfaces.
> 
> I have a small scene that renders fine when the surface is *not* in it, but with
> the surface, the scene renders to 99% complete (rather quickly, using 8 cores),
> but then it just sits there, with only 1 core running (via system monitor) at
> 100%.    It almost appears as if PovRay is failing to collect a "rogue thread"
> but I can't really tell what's happening.   The scene is very small so I've
> copied it below.
> 

Thanks.
in 3.7, image is rendered in small square chunk. What you see is the
last chunk being very long (very very .... very ... very long) to trace.

> Are there any known issues with parametric surfaces and the PovRay beta?  I've
> seen a post concerning textures but my surface is not textured -- it's just
> partially transparent.
> 
> Thanks for any information.  The scene is copied below.
> 

> #declare C1 = function(r,A,l) { 1.0 - (r*sin(A)/sqrt(sinh(l)*sinh(l) +
> cosh(l)*cosh(l))) }

You could speed up a bit by replacing sinh^2(l)+cosh^2(l) with cosh(2l)

(+Q3 went from 28 seconds to 22 seconds with that change)
----------------------------------------------------------------------------
Ray->Shape Intersection          Tests       Succeeded  Percentage
----------------------------------------------------------------------------
Parametric                      119326             477      0.40
Parametric Bound                119326          119326    100.00

Function VM calls:        100309541



  Trace Time:       0 hours  0 minutes 22 seconds (22.167 seconds)

  Trace Time:       0 hours  0 minutes 28 seconds (28.655 seconds)


>      clipped_by { plane { <0,0,-1>, -2 } }
>      clipped_by { plane { <0,0,1>, 2.14 } }

Double clipped_by ? not sure it does what you expect
Use a single box instead. (but does it only appear at all ? as the
quadric is a duplicate of the previous one, clipped by a sphere)

The parametric can enjoy being clipped_by  sphere { <0,0,1>, 0.4 } }
Parametric                        8776             477      5.44
Parametric Bound                  9500            8776     92.38





You are also using radiosity with a parametric surface and a large area
light (16 x 16!). That's slow. (something like 256 slower)

Last: simplify your formula, C2(r,A)*sin(T) when T=0 is a waste of time
for Tx.
Same for Ty, the sinh(l)*sin(T)*C1(r,A,l) is also 0.
Just dropping these 2 zero rendered in 15 seconds at +Q3. (instead of 22)
And if you comment the cos(T) in Tx & Ty (because cos(0)=1), it drops to
12 seconds (with +Q3).

+Q4 push me at 51 seconds, and going +Q5 is far too long for something
that look like a small sphere at the bottom of the parabola.


Post a reply to this message

From: clipka
Subject: Re: Povray 3.7 RC7, something strange with parametric surfaces?
Date: 27 Feb 2013 19:22:21
Message: <512ea33d@news.povray.org>
Am 27.02.2013 20:05, schrieb Ryan Budney:

> light_source
> {
>   <-5, -2, 1 >
>   color White
>   area_light <0.6,0,0>,<0,0.6,0>,16,16
> }

When using area lights, /always/ make them adaptive. Size should be 
2^N+1 for that, so for example:

   area_light <0.6,0,0>,<0,0.6,0>,17,17
   adaptive 1

I usually also use "circular orient".


Post a reply to this message

From: Ryan Budney
Subject: Re: Povray 3.7 RC7, something strange with parametric surfaces?
Date: 28 Feb 2013 20:05:03
Message: <web.512ffe244ef32a7785b1e6b80@news.povray.org>
Thanks for the comments Forgeron and Clipka.  I didn't think there would be such
a massive change in render times!  Without the parametric surface the scene
renders on my laptop in a couple seconds.

I lowered the quality and got a quick render-time again.

The surface isn't supposed to be that blob, it's supposed to be a small tube
around a hyperbola... It looks like I don't understand how PovRay "functions"
work... but that's something that I should be able to sort out.


Post a reply to this message

From: Ryan Budney
Subject: Re: Povray 3.7 RC7, something strange with parametric surfaces?
Date: 28 Feb 2013 20:20:00
Message: <web.513001214ef32a7785b1e6b80@news.povray.org>
"Ryan Budney" <ryb### [at] uvicca> wrote:
> Thanks for the comments Forgeron and Clipka.  I didn't think there would be such
> a massive change in render times!  Without the parametric surface the scene
> renders on my laptop in a couple seconds.
>
> I lowered the quality and got a quick render-time again.
>
> The surface isn't supposed to be that blob, it's supposed to be a small tube
> around a hyperbola... It looks like I don't understand how PovRay "functions"
> work... but that's something that I should be able to sort out.

Ah! Figured it out.  I hadn't realized parametric objects have a default
contained_by.   My PovRay world is back in order.


Post a reply to this message

From: Alain
Subject: Re: Povray 3.7 RC7, something strange with parametric surfaces?
Date: 28 Feb 2013 22:23:10
Message: <51301f1e$1@news.povray.org>

> Am 27.02.2013 20:05, schrieb Ryan Budney:
>
>> light_source
>> {
>>   <-5, -2, 1 >
>>   color White
>>   area_light <0.6,0,0>,<0,0.6,0>,16,16
>> }
>
> When using area lights, /always/ make them adaptive. Size should be
> 2^N+1 for that, so for example:
>
>    area_light <0.6,0,0>,<0,0.6,0>,17,17
>    adaptive 1
>
> I usually also use "circular orient".
>

For a test render, I usualy use adaptive 0, then, if needed, up this to 
adaptive 1 or 2.


Post a reply to this message

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