POV-Ray : Newsgroups : povray.binaries.images : using 'object pattern' as media : using 'object pattern' as media Server Time
7 Jul 2022 00:03:15 EDT (-0400)
  using 'object pattern' as media  
From: Kenneth
Date: 28 Apr 2022 17:35:00
Message: <web.626b05efc2e3b4cf8d86850a6e066e29@news.povray.org>
POV-ray's 'object pattern' is a really useful feature-- but the single 'pigment'
example in the docs does not do it justice, IMO. It can instead be used as
density for media, which is not mentioned there. Searching through newsgroup
posts from the past, I could not find a reference to such a use. For months, I
have been experimenting and testing this 'discovery'.

The object pattern is fully volumetric. Give it an object-- just about any kind
of object or CSG construction -- and it creates a 3-D pattern of the shape's
overall surface, which can then be manipulated like any other pattern (using
warp{...} for example). For mesh and mesh2 objects, the model requires an
inside_vector for the media to show up. Unfortunately, bicubic_patch objects
either don't work or don't show the media.

The really neat thing about this technique is that the media is no longer
confined 'within' the model, but can occupy the area outside it (as large as the
overall required media container shape.) The object pattern is placed inside the

Once I started playing around with this, my first thought was using it for
clouds that look like objects. It has many more interesting media uses as well--
and different methods of setting-up the code when pigments{...} or image_maps
are used for the volumetric density-- but here is a basic cloud example using a
single scattering media. For the object, I used James Holsenback's Stanford
Bunny mesh2 model from October 2014, then heavily warped the resulting pattern
and media. The background is a simple image_map, and I adjusted the lights'
colors on the media to try and match the look.

The only drawback with this particular example was the *long* render time, even
on my Core I7 8 core/16 thread machine: These 640X480 renders took an average of
20 minutes each (without AA or radiosity!), possibly due to the model being a
triangle mesh, and the use of two light_sources. Media's samples value was 109.

(I had intended to run a 200-frame animation of this 'Bunny cloud' at 800X600,
to show the increase of the warping-- but I calculated that it would take about
85 hours to render!)

Post a reply to this message

Download 'object_pattern_as_media_1.jpg' (117 KB)

Preview of image 'object_pattern_as_media_1.jpg'


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