|
|
rock <roc### [at] almostbestwebnet> wrote:
> PM 2Ring wrote:
> >
> > Also, isosurfaces can be faster than you might think. I have a sofa object
> > derived from one of Jaime's LightSys demo scenes. The original is built
> > from isosurface{f_rounded_box()}, I converted it to use superellipsoids,
> > but the isosurface version was the faster! IIRC, I posted the scene file in
> > p.b.i a couple of weeks ago; look for the very shiny blue sofa.
> >
>
> well, one sofa is different from many stones: completely
> different from the original picture posted.
Sure they're different, but the point I was making is that isosurfaces can
render faster than a more conventional shape.
> >
> >>I picture something like ... defining 12 different rock shapes.
> >>Then, whenever you place a rock, randomly pick which of the 12
> >>pre-defined rock shapes to place. Rotate it randomly y before
> >>placing it. As each one is placed, randomly texture it.
> >
> >
> > Sure, I can do that:). However, you don't really save memory (in the current
> > version of POV) by doing this, unless you're doing it with mesh objects.
>
> Memory was not the concern of my posting; render time was.
> If I wanted many stones in a single isosurface, my poor
> CPU would kick it's little feet in the air and expire.
> Or at least my patience would. :D
The attached image uses individual isostones, layed out in a slightly
randomized Archimedean spiral pattern (parametrized by arclength). It
renders much more slowly than the equivalent all-in-one isosurface.
> > For an interesting variation on this theme, see my two recent threads,
> > "MultiMesh" in the General area and "Grass using MultiMesh" in p.b.i.
> Errrrr, I can guess that "multimesh" uses MESH objects,
> What does that have to do with isosurface pebbles?
Read the threads & find out, rock. :) The connection is in efficiently
creating large numbers of similar objects, and hiding the fact that you're
using lots of copies of the same thing.
Post a reply to this message
Attachments:
Download 'isoballsh3s.jpg' (162 KB)
Preview of image 'isoballsh3s.jpg'
|
|
|
|
Chris Cason <nos### [at] deletethispovrayorg> wrote:
> This is nice work. Perhaps once you've finished with your tweaks to it you
> may like to consider submitting it (or a variation thereof) for consideration
> as a standard POV-Ray example scene.
Here's my latest polished-up version. Um, I suppose I should ask, how do I
submit it for consideration, Chris? :)
//------------------------------------------------------------
// Persistence of Vision Ray Tracer Scene Description File
// File: IsoStones.pov
// Vers: 3.6
// Desc: Tumbled stones in a square grid using a single isosurface
// Date: 2005.09.03
// Auth: PM 2Ring
//
// -D +A0.1 +AM2 +R2
// -F +A0.6 +AM2 +R2
//
#include "colors.inc"
#include "stones.inc"
#include "functions.inc"
global_settings {
assumed_gamma 1.0
}
//Scene control
#declare Do_Sky = 1; //Render sky sphere
#declare Do_Ground = 1; //Render ground plane
#declare Do_Water = 1; //Make ground plane reflective
#declare Use_SpotLight = 1;
#declare Use_AreaLight = 0;
//Stone parameters
#declare GridSize = 4; //Total number of stones =
GridSize*GridSize
#declare Width = 1/GridSize; //Cell width.
#declare Radius = Width*.70; //Stone radius
#declare DRate = .875/Radius; //Radius deformation rate
#declare Height = .55; //Stone height
//---Functions------------------------------------------------
//Positive modulus: never returns negative values
#declare smod = function(A,B){mod(B + mod(A, B), B)}
//Centred modulus
#declare cmod = function(A,B){smod(A, 2*B) - B}
//2D cells: returns a random value for each unit square
#declare f_cell2D = function(x,z){f_snoise3d(floor(x), 0, floor(z))}
//Noisy modulus. Makes a random centre for each stone
#declare f_modnoise =
function(x,z){cmod(x, Width) + (Width-Radius)*f_cell2D(x*.5/Width,
z*.5/Width)}
//Randomized radius for tumbled stone shape
#declare f_Rad = function{1 + .45*f_snoise3d(x*DRate, y*DRate, z*DRate)}
//Displaced, vertically squashed spheres
#declare f_Stone = function{f_r(f_modnoise(x,z), y/Height,
f_modnoise(-z,x))}
//---Textures-------------------------------------------------
#declare StoneMax=44; //Number of stone textures
//All the textures from stones.inc
#declare T_Stones =
array[StoneMax]{
T_Stone1, T_Stone2, T_Stone3, T_Stone4, T_Stone5,
T_Stone6, T_Stone7, T_Stone8, T_Stone9, T_Stone10,
T_Stone11, T_Stone12, T_Stone13, T_Stone14, T_Stone15,
T_Stone16, T_Stone17, T_Stone18, T_Stone19, T_Stone20,
T_Stone21, T_Stone22, T_Stone23, T_Stone24, T_Stone25,
T_Stone26, T_Stone27, T_Stone28, T_Stone29, T_Stone30,
T_Stone31, T_Stone32, T_Stone33, T_Stone34, T_Stone35,
T_Stone36, T_Stone37, T_Stone38, T_Stone39, T_Stone40,
T_Stone41, T_Stone42, T_Stone43, T_Stone44,
}
//Build a random cellfield of all the stone textures
#declare MultiStone =
texture{
//function{.5+f_cell2D(x,z-7)}
cells translate y*.5
texture_map{
#declare I=0;
#while(I<StoneMax)
[I/StoneMax T_Stones[I]]
[(I+1)/StoneMax T_Stones[I]]
#declare I=I+1;
#end
}
}
//---The scene------------------------------------------------
//The stones. Scaled so that textures appears the same,
//no matter how many stones are done.
isosurface{
function{f_Stone(x,y,z) - Radius*f_Rad(x,y,z)}
//function {f_r(cmod(x, Width), y/Height, cmod(z, Width)) - Radius}
contained_by{box{<-1,-Width*Height,-1>, <1,Width*Height,1>}}
max_gradient 5
accuracy 5e-3
texture{MultiStone scale 2*Width}
//scale 1.7 //Fill view with stones
rotate -3*y
translate <0, .35*Radius*Height-1, 1>
}
#if(Do_Sky)
sky_sphere {
pigment {
gradient y
color_map {
[.4 rgb .1]
[.9 rgb .8]
[1 rgb 1]
}
}
}
#else
background{rgb .5}
#end
#if(Do_Ground)
plane {
y, -1.0001
pigment {rgb <1, .915, .620>}
finish{
ambient 0 diffuse .85
specular .25 roughness 1e-3
#if(Do_Water) diffuse 0.65 reflection{0, .9} #end
}
normal {
ripples .075
turbulence .175
frequency 12
scale .4
translate -1
}
}
#end
camera {
location <.45, 8, -8> * .2
direction z
right x*image_width/image_height up y
look_at y*-.175
angle 40
}
light_source {
<-1, 1, -1> * 30
rgb 120 fade_distance 3 fade_power 2
#if(Use_SpotLight)
spotlight point_at <-1,-1,0> falloff 2.25 radius .35
#end
#if(Use_AreaLight)
area_light 9*x,9*z,7,7 jitter adaptive 1 orient circular
#end
}
//------------------------------------------------------------
Post a reply to this message
|
|