|
![](/i/fill.gif) |
Hi.
I defined some objects with #define MyObject = etc. These objects have a
finish block including specular and roughness.
when I try to use these definition with the object-command, I also add an
finish-block, including ambient
object {MyObject finish {ambient 1}}
The object is a semi-transparent lamp, and I want to make it glow. But
nothing happens. I am sad :).
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
The Brain wrote:
>Hi.
>
>I defined some objects with #define MyObject = etc. These objects have a
>finish block including specular and roughness.
>
>when I try to use these definition with the object-command, I also add an
>finish-block, including ambient
>object {MyObject finish {ambient 1}}
>The object is a semi-transparent lamp, and I want to make it glow. But
>nothing happens. I am sad :).
>
This is a problem - or feature - of CSG objects. The behaviour is not,
AFAIK, documented, but it looks like this:
---
// Example: 'Hey, this paint doesn't stick!'
#declare RedCar = union { object { Windshield texture { WindowGlass } }
object { CarBody texture { RedPaint } }
}
#declare BlueCar = object { RedCar texture { BluePaint } }
object { BlueCar } // Sorry, car is still red!
---
// Example: Paintable Car
#declare UnfinishedCar = union { object { Windshield texture { WindowGlass }
}
object { CarBody } // no texture yet!
}
#declare RedCar = object { UnfinishedCar texture { RedPaint } }
#declare BlueCar = object { UnfinishedCar texture { BluePaint } }
object { RedCar translate x * -CarWidth } // ooh, red!
object { RedCar translate x * CarWidth } // ooh, blue!
---
// Example: Paintable Car with Default Color
#declare BasicCar = object {
union {
object { Windshield texture { WindowGlass } }
object { CarBody } // No texture yet!
}
texture { RedPaint } // default paint job
}
#declare RedCar = { BasicCar } // that's a red car all right...
#declare BlueCar = { BasicCar texture { BluePaint } } // that's a blue
car...
#declare BadGlowCar = { BasicCar texture { finish { ambient 1 } } /* that's
a
-black- car... by using a 'texture' block we overwrite -all- texture
elements - but -only- for the carbody. WindowGlass is still 'permanent' by
being in the CSG. */
#declare GoodGlowCar = { BasicCar finish { ambient 1 } } // that's a glowing
red car...
---
That should get the idea across, I hope. Another solution is,
---
#macro MkCar(WindowTexture,BodyTexture)
union {
object { Windshield texture { WindowTexture } }
object { CarBody texture { BodyTexture } }
}
#end
#declare RedCar = MkCar(WindowGlass,RedPaint)
#declare BlueCar = MkCar(WindowGlass,BluePaint)
#declare GlowCar = MkCar(GlowGlass,GlowPaint)
// etc...
---
And no, I have no idea if CSG textures work this way on purpose or by
accident, but the net result is, you have to plan ahead - or go back and
recode - when you want to change the texture on a CSG object. On the other
hand, there are advantages to be had (like the way the windows in the
second example won't get colored when you 'repaint' the car...)
The POV-Team - or anyone else - has permission to incorporate this post into
any Povray FAQ or Povray documentation, though someone might check it
for accuracy... ;)
--Chris
Post a reply to this message
|
![](/i/fill.gif) |