POV-Ray : Newsgroups : povray.binaries.images : Triplanar Mapping : Triplanar Mapping Server Time
19 Apr 2024 18:33:10 EDT (-0400)
  Triplanar Mapping  
From: Samuel B 
Date: 14 Jan 2024 18:40:00
Message: <web.65a4705751388f9716bed5696e741498@news.povray.org>
Hi,

The attached image is a preliminary test using both a color map and a
displacement map I found online of some rocks. Scene objects are: plane;
superellipsoid; and a height_field.

Here's a simple triplanar mapping macro:

#macro Triplanar(Pigment)
 pigment_pattern{
  slope x
  triangle_wave
 }
 pigment_map{
  [0 Pigment rotate y*90]
  [1
   pigment_pattern{
    slope y
    triangle_wave
   }
   pigment_map{
    [0 Pigment rotate x*90  translate z*2]
    [1 Pigment rotate z*165 translate x*2]
   }
  ]
 }
#end

It's invoked it like this:

 pigment_pattern{Triplanar(Pigment)}

where 'Pigment' is a 2D pigment oriented along the z axis (e.g. default image
map). You can invoke it the same way in pigment, normal or texture blocks.


Sam


Post a reply to this message


Attachments:
Download 'triplanar6m_02s.jpg' (193 KB)

Preview of image 'triplanar6m_02s.jpg'
triplanar6m_02s.jpg


 

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