This is an old revision of the document!


Texture Index from Spherical Harmonics Parameters - Version 5

macro Texture_Index(sh, tex)
 {
    if Prm_There(sh##_c20)  {} else {prm sh##_c20 = 0;}
    if Prm_There(sh##_c21p) {} else {prm sh##_c21p = 0;}
    if Prm_There(sh##_c21m) {} else {prm sh##_c21m = 0;}
    if Prm_There(sh##_c22p) {} else {prm sh##_c22p = 0;}
    if Prm_There(sh##_c22m) {} else {prm sh##_c22m = 0;}
    if Prm_There(sh##_c40)  {} else {prm sh##_c40 = 0;}
    if Prm_There(sh##_c41p) {} else {prm sh##_c41p = 0;}
    if Prm_There(sh##_c41m) {} else {prm sh##_c41m = 0;}
    if Prm_There(sh##_c42p) {} else {prm sh##_c42p = 0;}
    if Prm_There(sh##_c42m) {} else {prm sh##_c42m = 0;}
    if Prm_There(sh##_c43p) {} else {prm sh##_c43p = 0;}
    if Prm_There(sh##_c43m) {} else {prm sh##_c43m = 0;}
    if Prm_There(sh##_c44p) {} else {prm sh##_c44p = 0;}
    if Prm_There(sh##_c44m) {} else {prm sh##_c44m = 0;}
    if Prm_There(sh##_c60)  {} else {prm sh##_c60 = 0;}
    if Prm_There(sh##_c61p) {} else {prm sh##_c61p = 0;}
    if Prm_There(sh##_c61m) {} else {prm sh##_c61m = 0;}
    if Prm_There(sh##_c62p) {} else {prm sh##_c62p = 0;}
    if Prm_There(sh##_c62m) {} else {prm sh##_c62m = 0;}
    if Prm_There(sh##_c63p) {} else {prm sh##_c63p = 0;}
    if Prm_There(sh##_c63m) {} else {prm sh##_c63m = 0;}
    if Prm_There(sh##_c64p) {} else {prm sh##_c64p = 0;}
    if Prm_There(sh##_c64m) {} else {prm sh##_c64m = 0;}
    if Prm_There(sh##_c65p) {} else {prm sh##_c65p = 0;}
    if Prm_There(sh##_c65m) {} else {prm sh##_c65m = 0;}
    if Prm_There(sh##_c66p) {} else {prm sh##_c66p = 0;}
    if Prm_There(sh##_c66m) {} else {prm sh##_c66m = 0;}
    if Prm_There(sh##_c80)  {} else {prm sh##_c80 = 0;}
    if Prm_There(sh##_c81p) {} else {prm sh##_c81p = 0;}
    if Prm_There(sh##_c81m) {} else {prm sh##_c81m = 0;}
    if Prm_There(sh##_c82p) {} else {prm sh##_c82p = 0;}
    if Prm_There(sh##_c82m) {} else {prm sh##_c82m = 0;}
    if Prm_There(sh##_c83p) {} else {prm sh##_c83p = 0;}
    if Prm_There(sh##_c83m) {} else {prm sh##_c83m = 0;}
    if Prm_There(sh##_c84p) {} else {prm sh##_c84p = 0;}
    if Prm_There(sh##_c84m) {} else {prm sh##_c84m = 0;}
    if Prm_There(sh##_c85p) {} else {prm sh##_c85p = 0;}
    if Prm_There(sh##_c85m) {} else {prm sh##_c85m = 0;}
    if Prm_There(sh##_c86p) {} else {prm sh##_c86p = 0;}
    if Prm_There(sh##_c86m) {} else {prm sh##_c86m = 0;}
    if Prm_There(sh##_c87p) {} else {prm sh##_c87p = 0;}
    if Prm_There(sh##_c87m) {} else {prm sh##_c87m = 0;}
    if Prm_There(sh##_c88p) {} else {prm sh##_c88p = 0;}
    if Prm_There(sh##_c88m) {} else {prm sh##_c88m = 0;}
    prm = 1 + (1/5 (sh##_c20^2 + sh##_c21p^2 + sh##_c21m^2 + sh##_c22p^2 + sh##_c22m^2) '2nd order
    + 1/9 (sh##_c40^2 + sh##_c41p^2 + sh##_c41m^2 + sh##_c42p^2 + sh##_c42m^2 + sh##_c43p^2 + sh##_c43m^2 + sh##_c44p^2 + sh##_c44m^2)  '4th order
    + 1/13 (sh##_c60^2 + sh##_c61p^2 + sh##_c61m^2 + sh##_c62p^2 + sh##_c62m^2 + sh##_c63p^2 + sh##_c63m^2 + sh##_c64p^2 + sh##_c64m^2 + sh##_c65p^2 + sh##_c65m^2 + sh##_c66p^2 + sh##_c66m^2)   '6th order
    + 1/17 (sh##_c80^2 + sh##_c81p^2 + sh##_c81m^2 + sh##_c82p^2 + sh##_c82m^2 + sh##_c83p^2 + sh##_c83m^2 + sh##_c84p^2 + sh##_c84m^2 + sh##_c85p^2 + sh##_c85m^2 + sh##_c86p^2 + sh##_c86m^2 + sh##_c87p^2 + sh##_c87m^2 + sh##_c88p^2 + sh##_c88m^2));
    : tex
 }

Usage

 str…
    PO_Spherical_Harmonics(sh, 8)
    Texture_Index(sh, 0)

On termination of refinement the second argument of the Texture_Index macro is updated.


Personal Tools