POV-Ray : Newsgroups : povray.binaries.images : Smilin' Buddha : Re: Smilin' Buddha Server Time
30 Jul 2024 16:26:34 EDT (-0400)
  Re: Smilin' Buddha  
From: Trevor G Quayle
Date: 30 Mar 2011 09:00:02
Message: <web.4d93286b9bb0a42b81c811d20@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> On 03/29/2011 05:20 PM, Trevor G Quayle wrote:
> > If you want some advice on starting, I usually start testing with a very low
> > resolution (100 or so) to get quick sample results, then fine tune from there.
> > This gives very blocky results, but should give a good indication of the effect.
> > Once you get close, then start fine tuning the resolution.
>
> Your minor change threw me off for a second ... I looked right past the
> revised usage ... doh!
>
> Another tip for anyone exploring your macro ... make the grime pigment
> an obvious color to easily visualize where the effect is showing up ;-)

Good tip, I actually used that method for my testing.

The reason I made the slight usage change was so that the results could be
manipulated.  For example combine with a bozo pattern or other to make the edge
wear intermittent rather than continuos.  See the attached image.

Coincidentally, running this example enabled me to find an error in the way it
was handling faces with vertical (<0,+/-1,0>) normals.  I have corrected it and
posted a revised version.  Thanks!

-tgq

code for attached sample scene for reference:

//START CODE
// File: CreviceExample.pov
// Desc: sample scene for Crevice.inc macro
// Date: March 2011
// Auth: Trevor G Quayle

#version 3.7;

global_settings {
  charset utf8
  assumed_gamma 1.0
  ambient_light 1
  adc_bailout 0.00001
  max_trace_level 25
}

#declare LA=<0,75,0>;
#declare LO=<200,200,200>;

camera{
  up y
  right -x*image_width/image_height
  angle 60
  location LO
  look_at  LA
}

#default{finish{ambient 0 diffuse 0.5}}


light_source {
  <5000,5000,3000>
  rgb 1
}

plane{y,0 pigment{checker rgb 1 rgb 0 scale 15}}

background{rgb 0.3}

//Base object declared and transformed prior to sending to macro, does not need
to be textured
#declare MyObj=
box{-75,75 translate y*75 rotate y*20}

#declare Text_Base=
texture{
  pigment{rgb <0.3451, 0.17647, 0.04706>}
  finish{
    ambient 0
    diffuse 0.5
  }
}

#declare Text_Paint=
texture{
  pigment{rgb 1}
  finish{
    ambient 0
    diffuse 0.5
    conserve_energy
    reflection {0 1 metallic 1 fresnel on}
  }
}

#include "arrays.inc"  //must be included, must be newer one with
ARRAYS_WriteDF3()
#include "Crevice.inc"

//Crevice.inc values to be used as common
#declare CLoc=LO;   //Camera location
#declare Resn=200;  //sample grid resolution. Warning: exponentially increases
parse time!
#declare RLmin=2;   //minimal subsample adapt = 2^2 = 4
#declare RLmax=5;   //maximum subsample adapt = 2^5 = 32
#declare CCnf=0.95; //subsample adapt confidence = 95%

//Edge detection
#declare CAng=-20;  //control angle, negative for edges
#declare CDep=30;   //control depth
#declare SOff=-0.01;//surface offset, negative for edges


#declare FF2=function {pigment{bozo colour_map{[0.25 rgb 0][0.75 rgb 1]} scale
20}};

#declare Text1=
  texture{

function{1-(1-Crevice(MyObj,CLoc,Resn,CAng,CDep,SOff,RLmin,RLmax,CCnf))*FF2(x,y,z).gray}
    poly_wave 0.5
    texture_map{
      [0.5 Text_Base]
      [1.0 Text_Paint]
    }
  }


object{//object placed and material applied
  MyObj
  material{
    texture{Text1}
    interior{ior 1.4}
  }
}
//END CODE


Post a reply to this message


Attachments:
Download 'creviceexample2.jpg' (389 KB)

Preview of image 'creviceexample2.jpg'
creviceexample2.jpg


 

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