POV-Ray : Newsgroups : povray.newusers : Isosurface problem : Re: Isosurface problem Server Time
14 May 2024 14:55:30 EDT (-0400)
  Re: Isosurface problem  
From: Alain
Date: 30 Jan 2014 16:43:27
Message: <52eac77f$1@news.povray.org>

> Doctor John <j.g### [at] gmailcom> wrote:
>> On 30/01/14 12:20, William F Pokorny wrote:
>>> John & John,
>>> I believe we found previously that if you render the isosurface NOT
>>> wrapped in an object, the maximum gradient warning is issued in 3.7. I
>>> thought the idea was to document this issue, but I admit I lost track.
>>>
>>> When you get warnings it was the case in 3.7, unless running one thread,
>>> the value might not be the absolute maximum seen because values are
>>> getting overwritten by differing threads.
>>>
>>> Bill P.
>>
>> Thanks for that, Bill.
>>
>> So, John, the thing is to do a test run on your (naked) isosurface
>> without any CSG operations then, when you've got max_gradient right,
>> proceed to your full CSG modified scene.
>>
>> BTW Christoph Hormann has some good information regarding isosurface CSG
>> in http://www.imagico.de/pov/ic/index.php
>>
>> John
>> --
>> Protect the Earth
>> It was not given to you by your parents
>> You hold it in trust for your children
>
> Thanks for all the above. I will try and digest it in the next week.
>
> John Greenwood
>
>

To help speed up the rendering of isosurfaces, you can use the evaluate 
option instead of using max_gradient.

You do this as follow:

#declare min_factor=0.6; // good general satrting value

In the isosurface, where max_gradient is located, replace max_gradient 
with the following:
evaluate Found_Max_Gradient*min_factor sqrt(1/min_factor) 0.7

This will usualy make the isosurface render faster. It's very usefull if 
you #declare an isosurface and use several instances of it with slight 
variations.
Something like this (actual working code):

#include "functions.inc"
#declare Num=8;
#declare P=Num;
#declare Stp=360/Num;
#declare min_factor=0.6;
union{
#while(P>0)
		#declare Ofx=rand(R)*100;
		#declare Ofy=rand(R)*100;
		#declare Ofz=rand(R)*100;
// this shift the denting in a random fashion 
isosurface{function{-f_superellipsoid(x,y,z,0.11,0.11)+f_dents(x+Ofz,y+Ofy,z+Ofz)*0.0219}
	evaluate 1*min_factor sqrt(1/min_factor) 0.7
	contained_by{box{-1 1}}
	rotate<rand(R) rand(R) rand(R)>*360
	pigment{rgb <0.51, 0.45, 0.56>}
	scale 0.47
	translate<10,2.032,0> rotate ((Stp)*P+rand(R)*Stp/4)*y
// Add some jitter to the objects position
			photons{target reflection on}
	}
#end
finish{
	reflection{0.6 metallic}
	specular albedo 1 metallic
	roughness 0.001
	diffuse albedo 0.17
	brilliance 1.97
	irid{0.18 thickness 0.1}
	}
}
Here, the f_dents function is randomly shifted for each iterations 
making all objects different.


Alain


Post a reply to this message

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