POV-Ray : Newsgroups : povray.advanced-users : CSG-texture-problems. Server Time
26 Nov 2024 13:40:18 EST (-0500)
  CSG-texture-problems. (Message 1 to 5 of 5)  
From: Simen Kvaal
Subject: CSG-texture-problems.
Date: 27 Mar 2000 13:57:30
Message: <38dfaf1a@news.povray.org>
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?

TIA

Simen.


#declare MinEllipsoide =
difference {
        sphere {
         <0, 0, 0>, 1
         pigment {
          color red 1.0 green 0.3 blue 0.3
         }
               finish {
                        specular 0.7
                        roughness 0.005
                        reflection 0.5
               }
         scale <1.3, 1.0, 0.3>
        }
        sphere { <0, 0, 0>, 0.5
                pigment {
                        color red 1.0 green 1.0 blue 0.0
                }
               finish {
                        specular 0.7
                        roughness 0.005
                        reflection 0.5
               }
        }

        rotate <40, 30, 0>
 translate <-4, 0, 0>
}

#declare MinEllipsoide2 =
difference {
        sphere {
         <0, 0, 0>, 1
         pigment {
          color red 1.0 green 0.3 blue 0.3
         }
         scale <1.3, 1.0, 0.3>
        }
        sphere { <0, 0, 0>, 0.5
                pigment {
                        color red 1.0 green 1.0 blue 0.0
                }
        }
       finish {
                specular 0.7
                roughness 0.005
                reflection 0.5
       }

        rotate <40, 30, 0>
 translate <-4, 0, 0>
}


Post a reply to this message

From: Bob Hughes
Subject: Re: CSG-texture-problems.
Date: 27 Mar 2000 15:00:11
Message: <38dfbdcb@news.povray.org>
I may be wrong but I think it's becoming an interior and no longer has any
finish so the larger (external) sphere is the only one having the finish
applied.  In other words there isn't any exposed "surface" for the smaller
reflection sphere.
I think I too have seen what I'd denote as peculiarities of CSG texturing which
is wholly within an enclosing yet semi-transparent surface.  I'd like to hear
more about it as well if anyone has some insight.

Bob

"Simen Kvaal" <sim### [at] studentmatnatuiono> wrote in message
news:38dfaf1a@news.povray.org...
| 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?
|
| TIA
|
| Simen.
|
|
| #declare MinEllipsoide =
| difference {
|         sphere {
|          <0, 0, 0>, 1
|          pigment {
|           color red 1.0 green 0.3 blue 0.3
|          }
|                finish {
|                         specular 0.7
|                         roughness 0.005
|                         reflection 0.5
|                }
|          scale <1.3, 1.0, 0.3>
|         }
|         sphere { <0, 0, 0>, 0.5
|                 pigment {
|                         color red 1.0 green 1.0 blue 0.0
|                 }
|                finish {
|                         specular 0.7
|                         roughness 0.005
|                         reflection 0.5
|                }
|         }
|
|         rotate <40, 30, 0>
|  translate <-4, 0, 0>
| }
|
| #declare MinEllipsoide2 =
| difference {
|         sphere {
|          <0, 0, 0>, 1
|          pigment {
|           color red 1.0 green 0.3 blue 0.3
|          }
|          scale <1.3, 1.0, 0.3>
|         }
|         sphere { <0, 0, 0>, 0.5
|                 pigment {
|                         color red 1.0 green 1.0 blue 0.0
|                 }
|         }
|        finish {
|                 specular 0.7
|                 roughness 0.005
|                 reflection 0.5
|        }
|
|         rotate <40, 30, 0>
|  translate <-4, 0, 0>
| }
|
|
|


Post a reply to this message

From: Charles Fusner
Subject: Re: CSG-texture-problems.
Date: 27 Mar 2000 19:14:51
Message: <38DFFA03.9D9340FE@enter.net>
Simen Kvaal 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?

My guess would be that "pigment { ... }" all by inself is being 
interpreted as if it were "texture { pigment { ... } }", that is
to say, because you assigned one element of the texture to the 
component, it was read as if it were the full definition of a
texture (or at least as full as you saw fit to assign) so the fact
that that texture had no finish caused it to default. Then,
by the time it reached the stand alone finish at the end, all
the elements already had textures, so the finish at the end 
was ignored since nothing seemed to need it.


Post a reply to this message

From: Margus Ramst
Subject: Re: CSG-texture-problems.
Date: 27 Mar 2000 19:25:38
Message: <38DFEE57.4F12E259@peak.edu.ee>
A pigment block does not exist without a texture block; even though POV allows
you to specify it outside a texture block, a texture block is created and other
texture components get assigned default values.
The CSG parent's texture propagates only to those children who do not already
have a texture assigned.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

From: Chris Colefax
Subject: Re: CSG-texture-problems.
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.