POV-Ray : Newsgroups : povray.pov4.discussion.general : Suggest new v4.0 'lean' normal{} perturbation. (yuqk R15 v0.6.9.0) : Suggest new v4.0 'lean' normal{} perturbation. (yuqk R15 v0.6.9.0) Server Time
27 Jul 2024 12:11:32 EDT (-0400)
  Suggest new v4.0 'lean' normal{} perturbation. (yuqk R15 v0.6.9.0)  
From: William F Pokorny
Date: 31 May 2024 14:00:02
Message: <665a1022$1@news.povray.org>
The perturbation leans / bends incoming normals (or already perturbed 
normals) toward the 3D vector specified by 'ip_direction'.

It uses a 'type' keyword with values of 0 or 1.  When 0, 'lean' acts 
like most normal perturbation patterns in perturbing the raw surface 
normal. When the type is 1 however, the code starts with the previous 
perturbed normal and makes it lean toward ip_direction.

Part of the thinking is this leaning capability might be useful in a 
sort of 'radiosity importance' kind of way. Something where each shape's 
normals could be bent toward the most important lighting for it. 
Radiosity would need to have 'normals on', of course. How well the it 
might work in practice, I do not know. There's a small pile of 
trade-offs in play.

It might be on some thought, that it would make sense to add the type 1 
chaining of normal perturbations to other normal{} block specific 
patterns, but that's something for another day. It wouldn't work for 
some patterns, but maybe there is some value with others.

In the attached image the columns are using lean ip_direction vectors 
of: <0,0,0>, <0,+1,0> and <0,-1,0>.

The top row shows just the type 0 lean pattern results.

The middle row again using type 0, averages 'lean' and 'quilted' raw 
perturbed normals in a traditional way.

The bottom row now using type 1, chains the quilted and lean patterns 
one after the other using the average infrastructure with slightly 
different weighting. It amounts to raw normal -> perturb -> perturb -> 
perturb...

Bill P.


// SDL code excerpt. Requires yuqk release 15 or later.

#declare WestSide = srgb <1,0.56863,0.05882>;
#declare Pig99 = pigment { WestSide }
#declare Fin99 = finish { brilliance 2 phong 0.5 phong_size 50 }

#declare  DirY = -1;

#declare NrmLean = normal {
     lean type 0 ip_direction <0,DirY,0> bump_size 0.5
}
#declare NrmAve0 = normal {
     average
     normal_map {
          [1 quilted bump_size 0.5 scale 1/8]
          [1 lean type 0 ip_direction <0,DirY,0> bump_size 0.5]
     }
}
#declare NrmAve1 = normal {
     average
     normal_map {
          [0 quilted bump_size 0.5 scale 1/8]
          [1 lean type 1 ip_direction <0,DirY,0> bump_size 0.5]
     }
}

#declare Txt99 = texture {
     pigment { Pig99 }
   //normal { NrmLean }  // Top row     Col DirYs = 0 +1 -1
   //normal { NrmAve0 }  // Middle row  Col DirYs = 0 +1 -1
     normal { NrmAve1 }  // Borrom row  Col DirYs = 0 +1 -1
     finish { Fin99 }
}
#declare Obj99 = object { Iso99 texture { Txt99 } }


Post a reply to this message


Attachments:
Download 'leanstory.png' (186 KB)

Preview of image 'leanstory.png'
leanstory.png


 

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