POV-Ray : Newsgroups : povray.advanced-users : CSG-texture-problems. : Re: CSG-texture-problems. Server Time
30 Jul 2024 04:15:55 EDT (-0400)
  Re: CSG-texture-problems.  
From: Chris Colefax
Date: 28 Mar 2000 17:02:32
Message: <38e12bf8@news.povray.org>
Simen Kvaal <sim### [at] studentmatnatuiono> wrote:
> Given this code (actual sample); why does not MinEllipsoide2 produce
exactly
> the same results? What are the precedence of the textures here? Logically,
> the whole intersection should get the reflective finish, but instead it
gets
> the default. What am I missing?
[snipped code]

Specifying a pigment {}, normal {}, or finish {} is a shortcut for
specifying an entire texture {}.  If you specify less than the three
components, you get the default texture with the changed features you
specified.

Therefore, in your code you have a sphere with a red pigment (i.e. the
default texture with a red pigment), minus a sphere with a white pigment
(again, the default texture, with a white pigment added).  Finally, you
specify a finish for the difference as a whole - this equates to the default
texture with a changed finish, and this texture is only applied to those
children of the CSG that do not have textures of their own.

This explains the behaviour you see, and your first coding example is the
correct method if you want shared texture features (rather than shared
textures) across multiple objects, whether they are children of CSG
operations or not.  To save typing you could predeclare the finish/texture
and apply this to each child:

#declare CSGTexture = texture {finish {....}}

difference {
   sphere {.... texture {CSGTexture pigment {....}}}
   sphere {.... texture {CSGTexture pigment {....}}}
   }


Post a reply to this message

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