POV-Ray : Newsgroups : povray.binaries.images : Dirty Glass texture : Dirty Glass texture Server Time
30 Jul 2024 02:27:48 EDT (-0400)
  Dirty Glass texture  
From: s day
Date: 16 Mar 2013 05:55:01
Message: <web.5144408929e5627a4d6e54800@news.povray.org>
Hi,

I am trying to make a texture that looks like old dirty glass.

I am rendering the object using an HDR probe and no lightsources and my test
renders were running fairly quickly until I started using a texture_map with
layered textures.

I noticed that when I apply a texture using a texture_map (e.g. bozo going from
clean to dirty glass) the performance of the radiosity stage is terrible
compared to a single layered texture (about 10 times slower).

Also, I noticed it looks like you can see the dirt on the interior surface (top
image below) which I suppose is expected but not what I wanted.
I figured I could fix this by applying a clean glass material to the interior
object which created the image in the middle (not what I was expecting, is there
a simple explanation for this one that I do not know?) also the performance was
still bad.

Next I tried adding a simple:

texture { pigment { rgbt 1 } }

to the interior object and that produced the bottom image which rendered a lot
quicker.

The question is What woudld the correct approach be to producing such an
object/texture?

If it helps the texture(s)/object code is shown below below:


#declare dirt = texture {
    pigment { bozo scallop_wave turbulence 0.8753 omega 0.775 lambda 3.2 octaves
7
    colour_map {
        [ 0.0 rgbt 1 ]
        [ 0.75 rgbt 1 ]
        [ 0.75 rgbt <0.5, 0.34, 0.25, 1> ]
        [ 0.9 rgbt <0.25, 0.2, 0.15, 0.5> ]
        [ 1.0 rgbt <0.5, 0.34, 0.25, 1.0> ]
    }
    scale 0.02
    }
    normal { granite 0.5 scale 0.001 }
    finish { diffuse albedo 0.81 reflection { 0.001 0.01 fresnel on } }
}

#declare vdirt = texture {
    pigment { bozo scallop_wave turbulence 0.8753 omega 0.775 lambda 3.2 octaves
7
    colour_map {
        [ 0.0 rgbt 1 ]
        [ 0.55 rgbt 1 ]
        [ 0.55 rgbt <0.25, 0.14, 0.09, 1> ]
        [ 0.9 rgbt <0.08, 0.06, 0.045, 0.125> ]
        [ 1.0 rgbt <0.25, 0.14, 0.09, 0.45> ]
    }
    scale 0.02
    }
    normal { granite 0.5 scale 0.001 }
    finish { diffuse albedo 0.75 reflection { 0.001 0.005 fresnel on } }
}


#declare lampGlassTex = texture
{
    pigment {
        rgbf <0.99, 0.96, 0.92, 1>
    }

    finish {
        specular 0
        roughness 0.002
        ambient 0
        diffuse albedo 0.125
        brilliance 4
        reflection {
            0.01, 0.2
            fresnel on
        }
        conserve_energy
    }
    normal { granite 0.01 turbulence 0.5 scale <0.04, 0.1, 0.04> }

}

#declare lampGlassTexDirt = texture
{
lampGlassTex
}
texture { dirt scale 4 }

#declare lampGlassTexVDirt = texture
{
lampGlassTex
}
texture { vdirt scale 4 }


#declare theTex = material{
    texture {
        bozo  scallop_wave turbulence 0.675 omega 0.7
        texture_map {
            [ 0.0 lampGlassTexVDirt ]
            [ 0.15 lampGlassTexDirt ]
            [ 1.0 lampGlassTex ]
        }
        scale 0.22
//        translate <0, -1.1, 0>
    }
  interior {
    ior 1.5
    fade_distance 0.5
    fade_power 1001
  }
  }

difference {
sphere { <3, 2, 0> 1
}
sphere { <3, 2, 0> 0.95
// uncomment either single texture used for interior
// texture { pigment { rgbt 1 } }
//
// or material used for interior
//
//material { texture { lampGlassTex }   interior {
//    ior 1.5
//    fade_distance 0.5
//    fade_power 1001
//  }
//   }

}
material {
 theTex
 }

}


Thanks

Sean


Post a reply to this message


Attachments:
Download 'glass.png' (170 KB)

Preview of image 'glass.png'
glass.png


 

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