POV-Ray : Newsgroups : povray.newusers : any tips on optimising complex textures for speed? Server Time
29 Jul 2024 16:21:06 EDT (-0400)
  any tips on optimising complex textures for speed? (Message 1 to 1 of 1)  
From: Bill Hails
Subject: any tips on optimising complex textures for speed?
Date: 1 May 2005 15:14:42
Message: <42752aa2@news.povray.org>
Hi.
I have a fairly complex texture that renders fast without radiosity,
but with Rad_Settings(Radiosity_Normal, true, false) it takes over
an hour to texture a sphere!
I was wondering if there was any way I might, for instance, combine
Fn_FruitDCa and Fn_FruitDC for a performance improvement, or if layered
textures are the way to go (I usually try to avoid them).

FWIW it's a "sort of" melon skin. I can post a render to p.b.i if it's
any help.

#local FruitD_TexScale = 0.075;

///////// colours

#local CM_FruitD = colour_map {
    [0.0 rgb<0.451, 0.031, 0.000>]
    [0.1 rgb<0.545, 0.125, 0.000>]
    [0.2 rgb<0.643, 0.333, 0.000>]
    [0.3 rgb<0.675, 0.427, 0.000>]
    [0.4 rgb<0.741, 0.506, 0.000>]
    [0.5 rgb<0.773, 0.584, 0.094>]
    [0.6 rgb<0.773, 0.698, 0.192>]
    [0.7 rgb<0.804, 0.698, 0.224>]
    [0.8 rgb<0.804, 0.776, 0.290>]
    [0.9 rgb<0.804, 0.839, 0.675>]
    [1.0 rgb<1.000, 1.000, 0.871>]
}

///////// functions

#local Fn_FruitDCa = function {
    pattern {
        crackle
        sine_wave
        frequency 2
        turbulence 0.1
    }
}

#local Fn_FruitDC = function {
    pattern {
        function { Fn_FruitDCa(x,y,z) }
        poly_wave 4
    }
}

///////// pigments

#local P_FruitD1 = pigment {
    gradient y
    scale 2 / FruitD_TexScale
    colour_map { CM_FruitD }
}

#local P_FruitD2 = pigment {
    gradient y
    scale 6 / FruitD_TexScale
    colour_map { CM_FruitD }
}

///////// normals

#local N_FruitDL = normal {
    granite
    scale 0.5
}

#local N_FruitDC = normal {
    function { Fn_FruitDC(x,y,z) }
}

///////// finishes

#ifndef (RAD)
    #declare RAD = false;
#end

#local Fin_FruitD = finish {
    diffuse 0.7
    #if (RAD)
        ambient 0
    #else
        ambient 0.2
    #end
    specular 0.2
    roughness 0.3
}

///////// textures

#local T_FruitD1 = texture {
    pigment { P_FruitD1 }
    normal { N_FruitDL }
    finish { Fin_FruitD }
}

#local T_FruitD2 = texture {
    pigment { P_FruitD2 }
    normal { N_FruitDC }
    finish { Fin_FruitD }
}

///////// the final texture

#declare T_FruitD = texture {
    function { Fn_FruitDC(x,y,z) }
    scale FruitD_TexScale
    texture_map {
        [0 T_FruitD1]
        [1 T_FruitD2]
    }
    translate -y
}

// sphere { 0, 1 texture { T_FruitD } }

-- 
Bill Hails
http://thyme.homelinux.net/


Post a reply to this message

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