#VRML V2.0 utf8  

Viewpoint {
   position 0 0 10
   orientation 0 0 1 0
   fieldOfView 0.785398
   description "ViewPoint"
}
 
NAME neutral PhBXYZSpectrum { xyz 1 1 1 }

PROTO fresnelmirror [
 exposedField SFFloat s 1.
 exposedField SFNode rho NULL
 exposedField SFFloat n 10.
] {
   PhBHomogeneousSurface {
      bsdf PhBFresnelBSDF {
	 intensity IS s
	 spectrum IS rho
	 scatterer PhBPerfectSpecularReflector {}
      }
   }
}

PROTO fresnelward [
 exposedField SFFloat s 1.
 exposedField SFNode rho NULL
 exposedField SFFloat alphax 0.2
 exposedField SFFloat alphay 0.2
] {
   PhBHomogeneousSurface {
      bsdf PhBFresnelBSDF {
	 intensity IS s
	 spectrum IS rho
	 scatterer PhBWardReflector {
	    standardDeviationX IS alphax
	    standardDeviationY IS alphay
	 }
      }
   }
}

PROTO phong [
 exposedField SFFloat s 1.
 exposedField SFNode rho NULL
 exposedField SFFloat n 10.
] {
   PhBHomogeneousSurface {
      bsdf PhBSimpleBSDF {
	 intensity IS s
	 spectrum IS rho
	 scatterer PhBPerfectSpecularReflector {}
      }
   }
}

NAME red PhBXYZSpectrum { xyz   0.514145 0.265106 0.024101    }
NAME green PhBXYZSpectrum { xyz   0.323884 0.670106 0.122853    }
NAME blue PhBXYZSpectrum { xyz    0.161971 0.064788 0.853047   }
NAME yellow PhBXYZSpectrum { xyz     0.838029 0.935212 0.146953  }
NAME magenta PhBXYZSpectrum { xyz    0.676116 0.329894 0.877147   }
NAME turquoise PhBXYZSpectrum { xyz    0.485855 0.734894 0.975899   }
NAME white PhBXYZSpectrum { xyz   1 1 1   }
NAME black PhBXYZSpectrum { xyz   0 0 0   }

PROTO diffuse [
  exposedField SFNode color NULL
] {
   PhBHomogeneousSurface {
      bsdf PhBSimpleBSDF {
	 intensity 1.
	 spectrum IS color
	 scatterer PhBDiffuseReflector {}
      }
   }
}

PROTO RGBImageTexturedSurface [
  exposedField MFString url []
] {
   PhBTexturedSurface {
      texture PhBImageTexture {
	 url IS url
      }
      surfaces [
	diffuse { color DEF red PhBXYZSpectrum { xyz 0.514145 0.265106 0.024101 }} ,
        diffuse { color DEF green PhBXYZSpectrum { xyz 0.323884 0.670106 0.122853 }} ,
	diffuse { color DEF blue PhBXYZSpectrum { xyz 0.161971 0.064788 0.853047 }}
      ]
   }
}

PhBTexturedBackground {
}

Group {
   children [
      Shape {
	 geometry Sphere { radius 5 }
	 appearance PhBAppearance {
	    surface fresnelmirror {} 
	 }
      }
   ]
}
