POV-Ray : Newsgroups : povray.beta-test : problem with normals/functions: crash! Server Time
30 Jul 2024 12:32:43 EDT (-0400)
  problem with normals/functions: crash! (Message 1 to 3 of 3)  
From: Lutz-Peter Hooge
Subject: problem with normals/functions: crash!
Date: 30 Nov 2001 19:34:41
Message: <MPG.16724448f4beb4ad9896c3@news.povray.org>
Hi everybody

This scene causes PovRay for Windows, Beta 8, to report a
"Rendering Error: Maximum function evaluation recursion level reached.",
and crash in the same moment.

When inserting the function explictly everywhere, instaead of #declaring 
it, it starts to render but is extremely slow.

The same thing works flawlessly in beta 7.

#version 3.5;

camera{location <0,4,-5>*.8 look_at <0,.5,0> angle 50}        

light_source{<1,2,1.5>*100 color rgb 1}

#declare sinxsin=function{min(abs(sin(x*pi/2)),abs(sin(z*pi/2)))}

#declare n0=
normal
{
	function{sinxsin(x,y,z)}
	slope_map{[0.0 <0,1>][0.1 <1,0>][0.5 <0.9,0>][0.51 <1,0>][1.0 
<1,0>]}
}

#declare n1=
normal
{
	average normal_map{[1.0 n0][1.0 granite -.1 scale .5]}
}  

#declare n2=
normal
{
	function{sinxsin(x,y,z)}
	normal_map
	{
		[0.5 n0]
		[0.6 n1]
	}
}

plane
{
	y,0
	texture
	{
		pigment{checker color rgb 1 color rgb 0 scale 2}              

		finish{specular 1}
		normal{n2}
	}        
	rotate -y*20
}


Post a reply to this message

From: Lutz-Peter Hooge
Subject: Re: problem with normals/functions: crash!
Date: 30 Nov 2001 20:28:21
Message: <MPG.167250dd4c006ce89896c4@news.povray.org>
In article <MPG.16724448f4beb4ad9896c3@news.povray.org>, lpv### [at] gmxde 
says...

> #declare sinxsin=function{min(abs(sin(x*pi/2)),abs(sin(z*pi/2)))}

It does work when I #declare min2=function(x,y){select(x-y,x,y)}
and then replace min with min2.

So something concerning the min/max functions is broken.

I think it is related to Suzuki's isosurface bug, because when I replace 
min with & or | the behavior is the same, but if i replace it with a 
different function (for example sin(x*pi/2)*sin(z)*pi/2)) it works as 
expected.

Lutz-Peter


Post a reply to this message

From: Mike Williams
Subject: Re: problem with normals/functions: crash!
Date: 1 Dec 2001 03:58:49
Message: <byIxDHAimJC8EwIk@econym.demon.co.uk>
Wasn't it Lutz-Peter Hooge who wrote:
>Hi everybody
>
>This scene causes PovRay for Windows, Beta 8, to report a
>"Rendering Error: Maximum function evaluation recursion level reached.",
>and crash in the same moment.
>
>When inserting the function explictly everywhere, instaead of #declaring 
>it, it starts to render but is extremely slow.

I confirm.

Here's a really weird work round. 

Near the top of the scene file add:-

sky_sphere { pigment {
    function{abs(y)}
    color_map { [0.0 color blue 0.6] [1.0 color rgb 1] } 
  }
}

With this sky sphere it doesn't crash, and renders in a few seconds. 

All the scenes in my isosurface tutorial just happen to have this as a
background. They all render if the background is there and crash if it
it's absent.


I think that the key factor here is that if an isosurface is the first
function parsed, then things go horribly wrong (crashes, slow renders
and hangs). But if the isosurface is the second function in the scene,
it's all OK. E.g. adding "#declare foo=function{0}" at the top of the
scene file avoids the problem.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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