POV-Ray : Newsgroups : povray.general : image based normal maps? : Re: image based normal maps? Server Time
2 May 2024 08:54:22 EDT (-0400)
  Re: image based normal maps?  
From: Bald Eagle
Date: 21 Jan 2019 20:35:01
Message: <web.5c4672dce20dd126765e06870@news.povray.org>
I just got done fiddling with an idea.
First, I'm curious how an internal/predefined function like f_noise3d still need
functions.inc .

Second - here's a noise-based normal function,
S is scale of the pattern
D is a small delta shift for the 3x3 sampling grid

0.01 seems to be where things shift from one weird version to another.
large values give some interesting repeating "ghosts" almost like a repeat warp,
and small values give closer to the native function (D=0) which has very well
defined "rings" which are much softer at D=0.1

Just thought I'd throw this in here to play with and perhaps clipka can explain
what the "rings" are.


#declare BumpMap = function {f_noise3d (x, y, z)};
#declare S=5;
#declare D = 0.01;

#declare CenterWeight = 8/9;
#declare EdgeWeight = 1/9;

box {<0, 0, 0>, <1, 1, 0.1>
  texture {pigment {Blue*0.5} finish {specular 0.4}}
     //normal {function { BumpMap (x, y, z).gray}}
     normal {
      average
      normal_map {

      #for (Y, -D, D, D)
       #for (X, -D, D, D)
        [select (Y*X, EdgeWeight, CenterWeight, EdgeWeight) function { BumpMap
((x-X)*S, (y-Y)*S, z)*3}]
       #end
      #end // end for Y
      }
     }
}


Post a reply to this message

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