POV-Ray : Newsgroups : povray.newusers : simulating cracks in surface using normals Server Time
29 Jul 2024 06:28:57 EDT (-0400)
  simulating cracks in surface using normals (Message 1 to 8 of 8)  
From: Toon
Subject: simulating cracks in surface using normals
Date: 25 Oct 2006 08:35:00
Message: <web.453f58fd2a0eadd4109a9bf40@news.povray.org>
Hi,

As in the previous post (1. photorealistic play-doh 2. round off at csg
edges) I am trying to create a photorealistic clay surface. In addition to
the bozo normal pattern which gives the clay a smooth moulded look, I want
to add some cracks here and there. I guess something can be done with
layered textures:
texture {MouldedLook}
texture {AddedCracks}
but every time I end up influencing the MouldedLook texture also at places
where there's no crack. Can someone help me on:

1. how to simulate a normal with random cracks here and there (so preferably
without a bump_map)
2. how to declare the texture in such a way that it doesn't mess with the
underlaying MouldedLook texture at places where there's no crack?


Post a reply to this message

From: Penelope20k
Subject: Re: simulating cracks in surface using normals
Date: 25 Oct 2006 09:52:36
Message: <453f6c24$1@news.povray.org>
well , one way is to create your MouldedLook texture and Cracks texture
separatley ..

Then use an average statement by pounding your texture .. this is done like
that

Texture {average
        texture_map {
            [weight_texture1   MouldedLook]
            [weight_texture2    Cracks]
    }
}






news:web.453f58fd2a0eadd4109a9bf40@news.povray.org...
> Hi,
>
> As in the previous post (1. photorealistic play-doh 2. round off at csg
> edges) I am trying to create a photorealistic clay surface. In addition to
> the bozo normal pattern which gives the clay a smooth moulded look, I want
> to add some cracks here and there. I guess something can be done with
> layered textures:
> texture {MouldedLook}
> texture {AddedCracks}
> but every time I end up influencing the MouldedLook texture also at places
> where there's no crack. Can someone help me on:
>
> 1. how to simulate a normal with random cracks here and there (so
preferably
> without a bump_map)
> 2. how to declare the texture in such a way that it doesn't mess with the
> underlaying MouldedLook texture at places where there's no crack?
>
>
>


Post a reply to this message

From: Toon
Subject: Re: simulating cracks in surface using normals
Date: 25 Oct 2006 12:00:01
Message: <web.453f89f584a00c02109a9bf40@news.povray.org>
Hi,

Thanks! I've tried using average; the only problem is that it also averages
the textures at the points where there's no crack. So for example if both
textures have equal weights, the bozo strength of the MouldedLook is
divided by 2. This works fine if I use a bump_map for the crack with the
everything but the crack filled with black pixels; in this case the Crack
texture returns the simple uniform color that is part of both textures. If
I then multiply the bozo in MouldedLook by 2 I get my original texture
back.

However, I would like to use a more random pattern instead of a repeating
crack picture, and was unable to create a normal which returns some random
cracks with a strong normal but leaves everything else unaltered like in
the bump_map. Is there a good way to make such a pattern? Maybe with some
agate or marble pattern like in a pigment with a color_map like the example
on http://library.thinkquest.org/3285/language/pigment.html#agate . Can a
similar thing be done with a normal?


Post a reply to this message

From: Trevor G Quayle
Subject: Re: simulating cracks in surface using normals
Date: 25 Oct 2006 13:15:01
Message: <web.453f9b7184a00c02c150d4c10@news.povray.org>
"Toon" <nomail@nomail> wrote:
> Hi,
>
> Thanks! I've tried using average; the only problem is that it also averages
> the textures at the points where there's no crack. So for example if both
> textures have equal weights, the bozo strength of the MouldedLook is
> divided by 2. This works fine if I use a bump_map for the crack with the
> everything but the crack filled with black pixels; in this case the Crack
> texture returns the simple uniform color that is part of both textures. If
> I then multiply the bozo in MouldedLook by 2 I get my original texture
> back.
>
> However, I would like to use a more random pattern instead of a repeating
> crack picture, and was unable to create a normal which returns some random
> cracks with a strong normal but leaves everything else unaltered like in
> the bump_map. Is there a good way to make such a pattern? Maybe with some
> agate or marble pattern like in a pigment with a color_map like the example
> on http://library.thinkquest.org/3285/language/pigment.html#agate . Can a
> similar thing be done with a normal?

try crackle with a user defined slope_map, you may also need to play with
the form values though the default should be adequate.  See the docs for
more help on the crackle pattern and slope_map.

-tgq


Post a reply to this message

From: Leroy
Subject: Re: simulating cracks in surface using normals
Date: 25 Oct 2006 23:41:42
Message: <45402D24.3080008@joplin.com>
Toon wrote:
> Hi,
> 
> Thanks! I've tried using average; the only problem is that it also averages
> the textures at the points where there's no crack. So for example if both
> textures have equal weights, the bozo strength of the MouldedLook is
> divided by 2. This works fine if I use a bump_map for the crack with the
> everything but the crack filled with black pixels; in this case the Crack
> texture returns the simple uniform color that is part of both textures. If
> I then multiply the bozo in MouldedLook by 2 I get my original texture
> back.
> 
> However, I would like to use a more random pattern instead of a repeating
> crack picture, and was unable to create a normal which returns some random
> cracks with a strong normal but leaves everything else unaltered like in
> the bump_map. Is there a good way to make such a pattern? Maybe with some
> agate or marble pattern like in a pigment with a color_map like the example
> on http://library.thinkquest.org/3285/language/pigment.html#agate . Can a
> similar thing be done with a normal?
> 
> 

Pov reference 2.3.4.5  Working With Normal Maps should do the trick.


Post a reply to this message

From: Toon
Subject: Re: simulating cracks in surface using normals
Date: 26 Oct 2006 12:15:00
Message: <web.4540ddd084a00c02109a9bf40@news.povray.org>
> try crackle with a user defined slope_map, you may also need to play with
> the form values though the default should be adequate.  See the docs for
> more help on the crackle pattern and slope_map.
>
> -tgq

Thanks for all the tips, after playing around with crackle and slope_maps, I
can get someting that looks a little like what I want, but not entirely. I
can't seem to get any really deep cracks. Maybe someone can tell me what I
am doing wrong? I'd like to create a scaleable Cracks normal with
AmountOfCracks, CracksDepth and CracksLength settings. Anybody any idea?
(Any other ideas to get the clay more realistic are also welcome!)The code
for some claylike spheres that illustrate the problem is the following:

camera {look_at <0.0,0,0>
        location <-5 , 0.0 , -50>
       }

global_settings {radiosity {}}

#include "colors.inc"

light_source{<1000,1000,-1000>  color rgb 0.5}

sky_sphere {pigment{color rgb 2}}

plane { y, -6 texture {pigment {color rgb <1,1,1>} finish {ambient 0.1
diffuse 0.2}}}

plane {z, 1000 pigment {color rgb 0.5}}

#declare MouldedLook=normal{bozo -8 scale 3 }
#declare Cracks=normal{crackle
                       scale 10
                       turbulence <0.7,0.5,0>
                       slope_map {[0, <-1,0>]
                                  [0.01 <-1,0>]
                                  [0.01 <0,0>]
                                  [1 <0,0>]
                                 }
                      }
#declare NoNormal=normal{bumps 0.00001}
#declare MouldedCracks=normal{average
normal_map{[1,MouldedLook][1,Cracks][-1,NoNormal]}}

sphere { <0,0,0>,6 texture{pigment{color Orange} normal{Cracks} finish
{ambient 0 diffuse 0.6}} translate <-10,0,0> }
sphere { <0,0,0>, 6 texture{pigment{color Orange} normal{MouldedLook}}
finish {ambient 0 diffuse 0.6}translate <0,0,0> }
sphere { <0,0,0>,6 texture{pigment{color Orange} normal{MouldedCracks}}
finish {ambient 0 diffuse 0.6} translate <10,0,0> }


Post a reply to this message

From: Trevor G Quayle
Subject: Re: simulating cracks in surface using normals
Date: 26 Oct 2006 14:25:00
Message: <web.4540fd0e84a00c02c150d4c10@news.povray.org>
"Toon" <nomail@nomail> wrote:
> > try crackle with a user defined slope_map, you may also need to play with
> > the form values though the default should be adequate.  See the docs for
> > more help on the crackle pattern and slope_map.
> >
> > -tgq
>
> Thanks for all the tips, after playing around with crackle and slope_maps, I
> can get someting that looks a little like what I want, but not entirely. I
> can't seem to get any really deep cracks. Maybe someone can tell me what I
> am doing wrong? I'd like to create a scaleable Cracks normal with
> AmountOfCracks, CracksDepth and CracksLength settings. Anybody any idea?
> (Any other ideas to get the clay more realistic are also welcome!)The code
> for some claylike spheres that illustrate the problem is the following:
>
> camera {look_at <0.0,0,0>
>         location <-5 , 0.0 , -50>
>        }
>
> global_settings {radiosity {}}
>
> #include "colors.inc"
>
> light_source{<1000,1000,-1000>  color rgb 0.5}
>
> sky_sphere {pigment{color rgb 2}}
>
> plane { y, -6 texture {pigment {color rgb <1,1,1>} finish {ambient 0.1
> diffuse 0.2}}}
>
> plane {z, 1000 pigment {color rgb 0.5}}
>
> #declare MouldedLook=normal{bozo -8 scale 3 }
> #declare Cracks=normal{crackle
>                        scale 10
>                        turbulence <0.7,0.5,0>
>                        slope_map {[0, <-1,0>]
>                                   [0.01 <-1,0>]
>                                   [0.01 <0,0>]
>                                   [1 <0,0>]
>                                  }
>                       }
> #declare NoNormal=normal{bumps 0.00001}
> #declare MouldedCracks=normal{average
> normal_map{[1,MouldedLook][1,Cracks][-1,NoNormal]}}
>
> sphere { <0,0,0>,6 texture{pigment{color Orange} normal{Cracks} finish
> {ambient 0 diffuse 0.6}} translate <-10,0,0> }
> sphere { <0,0,0>, 6 texture{pigment{color Orange} normal{MouldedLook}}
> finish {ambient 0 diffuse 0.6}translate <0,0,0> }
> sphere { <0,0,0>,6 texture{pigment{color Orange} normal{MouldedCracks}}
> finish {ambient 0 diffuse 0.6} translate <10,0,0> }

You can try adding a float value behind crackle ("crackle c"), you can use
this to scale the apparent depth

However, the normals are just surface normal and faked, so there will be
some limitation on how deep they can actually appear, especially with
radiosity on.  Looks like you have the general idea now though, keep at it.

-tgq


Post a reply to this message

From: Chris B
Subject: Re: simulating cracks in surface using normals
Date: 27 Oct 2006 06:44:37
Message: <4541e315@news.povray.org>
"Toon" <nomail@nomail> wrote in message 
news:web.4540ddd084a00c02109a9bf40@news.povray.org...
>
> Thanks for all the tips, after playing around with crackle and slope_maps, 
> I
> can get someting that looks a little like what I want, but not entirely. I
> can't seem to get any really deep cracks.
> ... snip ...
>

Hi Toon,

As Trevor mentioned, the normals you apply are just faking it.

One way of faking it a little bit more is to overlay your own darkening of 
the cracks using a colour pattern.
The 'NewCracks' texture below uses the crackle as a pigment instead of a 
normal.
'NewCracks2' uses a slightly smaller crackle as a pigment and combines it 
with the original crackle normal to emphasise the highlights on the rims. It 
also takes the 'darkened' Orange color right down to 0 to give a really deep 
dark centre.

Hope this helps.

Regards,
Chris B.


camera {look_at <0.0,0,0>
        location <-5 , 0.0 , -20>
       }

global_settings {radiosity {}}

#include "colors.inc"

light_source{<1000,1000,-1000>  color rgb 0.5}

sky_sphere {pigment{color rgb 2}}

plane { y, -6 texture {pigment {color rgb <1,1,1>} finish {ambient 0.1
diffuse 0.2}}}

plane {z, 1000 pigment {color rgb 0.5}}

#declare MouldedLook=normal{bozo -8 scale 3 }
#declare Cracks=normal{crackle
                       scale 10
                       turbulence <0.7,0.5,0>
                       slope_map {[0, <-1,0>]
                                  [0.01 <-1,0>]
                                  [0.01 <0,0>]
                                  [1 <0,0>]
                                 }
}

#declare NoNormal=normal{bumps 0.00001}
#declare MouldedCracks=normal{average
normal_map{[1,MouldedLook][1,Cracks][-1,NoNormal]}}

#declare NewCracks = texture {
  pigment{
    crackle
    scale 10
    turbulence <0.7,0.5,0>
    color_map {
      [0    rgbt 0.8*Orange]
      [0.0003 rgbt 0.5*Orange]
      [0.01 rgbt 0.8*Orange]
      [0.01 rgbt Orange]
      [1    rgbt Orange]
    }
  }
  normal{bozo 8 scale 3}
}

#declare NewCracks2 = texture {
  pigment{
    crackle
    scale 10
    turbulence <0.7,0.5,0>
    color_map {
      [0      rgbt 0.8*Orange]
      [0.0003 rgbt 0*Orange]
      [0.009  rgbt 0.8*Orange]
      [0.009  rgbt Orange]
      [1      rgbt Orange]
    }
  }
  normal{average normal_map{[1,MouldedLook][1,Cracks][-1,NoNormal]}}
}

sphere { <0,0,0>,6 texture{pigment{color Orange} normal{Cracks} finish
{ambient 0 diffuse 0.6}} translate <-10,0,0> }
sphere { <0,0,0>, 6 texture{NewCracks}
finish {ambient 0 diffuse 0.6}translate <0,0,0> }
sphere { <0,0,0>,6 texture{NewCracks2}
finish {ambient 0 diffuse 0.6} translate <10,0,0> }


Post a reply to this message

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