POV-Ray : Newsgroups : povray.general : Granite with limits? : Re: Granite with limits? Server Time
30 Jul 2024 04:23:28 EDT (-0400)
  Re: Granite with limits?  
From: Alain
Date: 10 Sep 2009 17:57:29
Message: <4aa97649$1@news.povray.org>
Chris B a écrit :
> 
> "SharkD" <mik### [at] gmailcom> wrote in message 
> news:4aa8b949$1@news.povray.org...
>> Is there a way to create a granite-like pigment that is limited to 
>> certain limits? I would like no new "cells" to be created if they will 
>> extend beyond the limits. Sorry if I didn't explain this well enough...
>>
> 
> I think you should be able to achieve this using either layered textures 
> or texture_map transitions. The optimum approach depends on exactly the 
> result you're trying to achieve.
> 
> If you want a plain texture with a granite-like pigment appearing within 
> a certain zone you can use a multi-layered texture where the top layer 
> contains a transparent 'hole' of the desired shape that lets the 
> required parts of the granite layer beneath show through. You can 
> readily create well-defined edges of any shape you want using the object 
> pigment.
> 
> If you want fuzzy/blurred edges you would probably need to use pigments 
> that support color_map transitions, such as gradient or onion, but you 
> can use multiple layers to create some reasonably sophisticated 'holes'. 
> For example you could use 4 copies of a gradient texture rotated through 
> 90 degrees each time to create a blurry-edged square hole.
> 
> If you want a granite-like texture within the required limits and 
> everything to be totally transparent beyond those limits, you can use a 
> pigment_map or a texture_map to transition between the granite texture 
> and a totally transparent texture.
> 
> OTOH The bit of the question about new "cells" not being created implies 
> you might wish to avoid chopping through discrete splodges of texture in 
> the granite pattern. For example, cutting around the bright areas and 
> avoiding cutting through any dark patches. I can't think of an easy way 
> of doing that using only POV-Ray, although it's conceivable you could 
> use the eval_pigment function to chart a route through the bright bits 
> without venturing into the dark bits. You could then build a prism 
> object to follow that route and use it as an object pigment to create a 
> top layer with a transparent hole of the required shape. Lots of work 
> though!
> 
> Regards,
> Chris B.

If you want a single square hole, you can use the boxed pattern.

pigment{boxed color_map{[0.0 rgb 1][0.01 granite]}}

Will give you a square area with a granite pigment, and the rest been 
white. There is a narrow transition. Set both to 0.0 to get no transition.

pigment{boxed color_map{[0.0 rgb 1][0.3 granite]}}

Same, but with a mush broader transotion.

If you want a circular hole, replace the boxed by spherical.

A stripe can be obtained with the planar or cylindrical patterns.


Alain


Post a reply to this message

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