POV-Ray : Newsgroups : povray.binaries.images : using 'object pattern' as media Server Time
7 Jul 2022 00:18:28 EDT (-0400)
  using 'object pattern' as media (Message 11 to 20 of 23)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>
From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 30 Apr 2022 13:30:00
Message: <web.626d70edac9c0ae18d86850a6e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>
> > My understanding of mesh/mesh2 objects and bicubic_patch objects is that they
> > are *both* just zero-thickness 'shells' -- so I still don't quite
> > understand why one works as an object pattern, while the other does not...
>
> The issue isn't whether it's closed or not, it's what takes
> place under-the-hood in POV-Ray.  Meshes are geared toward
> making "solid" objects by defining the
> object's surface, and has the code to support such an extrapolation.  Bicubic
> patches are only ever interpreted as surfaces, no matter what you do.

Oh, I get it now.

There are two aspects of this problem that initially threw me off: The docs
about bezier_patches repeatedly refer to 'triangles', as if the patch or model
is converted to a smooth-triangle mesh 'under the hood'. At least, that's what I
took to be the meaning there... which is probably a misconception on my part(?).
The other odd thing during my render trials is that POV-ray *seems* to be
evaluating my bicubic_patch model 'successfully' in the same way it treats the
Bunny model-- that is, the render likewise slows down while evaluating the media
container shape, and the render times are about identical. Except that no
media-effect is produced. This behavior made me blame the problem simply on the
'missing inside_vector.'
>
> What you'll likely have to do is take the control points of your patches, and
> run them through the Bernstein polynomial stuff that TOK, and later I did
> to get the <x, y, z> of any point on the surface of the patch.
>
> Then you can use the points and the normals, and make a mesh object.
>

I'll take a look at the files you sent; thanks!


Post a reply to this message

From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 30 Apr 2022 17:25:00
Message: <web.626da6deac9c0ae18d86850a6e066e29@news.povray.org>
This object-pattern/media technique has another interesting use, a practical
one: It can show where a mesh or mesh2 object has any 'holes' in it (i.e., not a
completely 'closed' mesh.)

I used the mesh2 Bunny model again to show this effect. I removed my intersected
box object that I applied to seal up its few holes on the bottom, then rotated
the model to better show what happens.

The direction of the 'extra' media sticking out from the bottom is oriented
along the inside_vector that I chose, <1,1,1>. The faint sphere is my overall
media container.

I used scattering media here, but emission media performs just as well, and
renders much faster.

In effect, the object pattern can be thought of as a 'leaking-gas detector' ;-)


Post a reply to this message


Attachments:
Download 'object_pattern_as_mesh_hole_detector.jpg' (29 KB)

Preview of image 'object_pattern_as_mesh_hole_detector.jpg'
object_pattern_as_mesh_hole_detector.jpg


 

From: Bald Eagle
Subject: Re: using 'object pattern' as media
Date: 30 Apr 2022 18:10:00
Message: <web.626db3a3ac9c0ae11f9dae3025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
 Oh, I get it now.
>
> There are two aspects of this problem that initially threw me off: The docs
> about bezier_patches repeatedly refer to 'triangles', as if the patch or model
> is converted to a smooth-triangle mesh 'under the hood'. At least, that's what I
> took to be the meaning there... which is probably a misconception on my part(?).

It converts it to smooth triangles, but not a mesh object.

One has to remember that the path through the code to the render is different
for each and every type of primitive.  They may look the same, they may be
thought of as functionally equivalent, but they are separate and distinct
things.

I've run into that fast-and-loose "they're the same in my head" issue myself:
https://news.povray.org/povray.binaries.scene-files/message/%3C57b5bf9c%241%40news.povray.org%3E/#%3C57b5bf9c%241%40new
s.povray.org%3E

So, if you read the monograph (thread), William Pokorny confirms that POV-Ray
does indeed convert the bicubic patch object into smooth triangles at some point
in the processing, but it does not get converted into a proper mesh {} object.

Which is why I knew we'd have to go about this "the manual way".

- Walker, New Hampshire Ranger


Post a reply to this message

From: Thomas de Groot
Subject: Re: using 'object pattern' as media
Date: 1 May 2022 02:08:21
Message: <626e23d5$1@news.povray.org>
Op 30/04/2022 om 23:20 schreef Kenneth:
> 
> In effect, the object pattern can be thought of as a 'leaking-gas detector' ;-)
> 

Yes, very good. By itself, this image has a very high surrealistic 
(Magritte!) flavour. :-)

-- 
Thomas


Post a reply to this message

From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 1 May 2022 06:55:00
Message: <web.626e6645ac9c0ae18d86850a6e066e29@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> Op 30/04/2022 om 23:20 schreef Kenneth:
> >
> > In effect, the object pattern can be thought of as a 'leaking-gas detector'
>
> Yes, very good. By itself, this image has a very high surrealistic
> (Magritte!) flavour. :-)
>

Ha! You're right, and I did not even 'see' that-- the usual problem of being
'too close' to one's own work. :-\

It just needs a man wearing a suit plus a bowler hat... :-P


Post a reply to this message

From: Alain Martel
Subject: Re: using 'object pattern' as media
Date: 1 May 2022 10:21:51
Message: <626e977f$1@news.povray.org>
Le 2022-04-29 à 12:32, Kenneth a écrit :
> Here is another example, using a different and more complex set-up of the code--
> with 'solid' high-density emission + absorption medias rather than scattering.
> 
> This one uses the object pattern as a 'pigment' (not a density)-- with some
> 'Bunny artwork' as the main pigment there. Some image-to-functions-to-pigment
> operations were required for its final use in the media, mainly because I used
> the 'once' keyword for the artwork image_map.
> 
> For the art, I found a photo on Google that looked *somewhat* like the pose of
> the Stanford Bunny, then used my paint.net app to clone and shift various parts
> around so that the image covered the model as projected from the front. Even
> though the art is just a 2-D image_map, it projects through the entire media, so
> its colors are 'in depth' throughout the Bunny. Then I added a fake shadow under
> the model :-)
> 
> BTW, the Stanford Bunny mesh2 model is not quite a closed mesh-- it has some
> holes on its bottom surface-- so I simply made an intersection of it with a
> larger and well-placed box object, which solidified those holes. Interestingly,
> this also eliminated the need for the model to have an inside_vector (for the
> media appearance.)
> 
> I made several animations of this example which I will post at
> binaries.animation; they rendered *much* faster than my aborted scattering-media
> version, in about 1/10 the time (but with no lighting interaction of course).
> 
> 
> 
> 
Bottom two images... Poor bunny.


Post a reply to this message

From: Alain Martel
Subject: Re: using 'object pattern' as media
Date: 1 May 2022 10:31:03
Message: <626e99a7$1@news.povray.org>
Le 2022-04-30 à 13:25, Kenneth a écrit :

> 
> There are two aspects of this problem that initially threw me off: The docs
> about bezier_patches repeatedly refer to 'triangles', as if the patch or model
> is converted to a smooth-triangle mesh 'under the hood'. At least, that's what I
> took to be the meaning there... which is probably a misconception on my part(?).
> The other odd thing during my render trials is that POV-ray *seems* to be
> evaluating my bicubic_patch model 'successfully' in the same way it treats the
> Bunny model-- that is, the render likewise slows down while evaluating the media
> container shape, and the render times are about identical. Except that no
> media-effect is produced. This behavior made me blame the problem simply on the
> 'missing inside_vector.'

The patch IS converted into smooth triangles, but, as an union of 
triangles, not as a mesh.
The various triangles do not have any inside, they are just infinitely 
thin surfaces.


Post a reply to this message

From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 7 May 2022 17:00:00
Message: <web.6276dab9ac9c0ae12eadabda6e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

>
> I plan to post the basic code for these examples...

Here are the basics for the most simple kind of example, using just scattering
media. A light_source is required to show this type of media in the best way, of
course.

BTW, the docs says that the object used for the object pattern must not have a
texture, but that does not matter. The texture is simply ignored.

...............
#declare OBJ = ...object...  // to be used as the object pattern. Mesh and mesh2
require an inside_vector. CSG works too, but all of the parts should be
'merged' rather than in a union.

#declare OBJ_PATTERN =
density{
   object{
         OBJ

        // For the following two entries, full pigments are not allowed when
        //'density' is used for the pattern:

        // FIRST entry: everywhere OUTSIDE the 'object' shape
        rgb 0.0 // 0 means NO media density-- i.e., no visible media there

        // SECOND entry: INSIDE the object shape
        rgb 1.0  // 1 means 'full density' in the media
         }
                warp{turbulence...}
 }

// the required media container
sphere{...  // or box, etc.
hollow
pigment{rgbt 1} // or rgb 1 transmit 1
interior{
     media{
           scattering{1, multiplier * <...color...> extinction...}
        // I used 16*<1,1,1> extinction 0.5

        // emission ...
        // absorption ...

        //method 3
        //intervals 1
          samples ...
          aa_level ... // 4 is the default
          density{OBJ_PATTERN}
         }
       }
rotate ...
translate...
} // end of container object


Post a reply to this message

From: Kenneth
Subject: Re: using 'object pattern' as media
Date: 7 May 2022 17:10:00
Message: <web.6276dfe8ac9c0ae12eadabda6e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

>
> Here are the basics for the most simple kind of example...

Be aware that the object pattern can reproduce an object that is anywhere in
space-- but will then create the pattern *at* that location. So it is probably
best to center your object at the origin, create the pattern and media in the
container there, *then* translate the whole thing.


Post a reply to this message

From: Paolo Gibellini
Subject: Re: using 'object pattern' as media
Date: 11 May 2022 17:55:31
Message: <627c30d3$1@news.povray.org>
Il 28/04/2022 23:29, Kenneth ha scritto:
 > 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'.
 >
[...]

I absolutely love this technique. I tried something similar a few years 
a go, but my results were not convincing so I had given up.

Very very interesting,
   Paolo


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>

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