#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 }
                                             
NAME light PhBHomogeneousSurface {
   edf PhBEDF {
      intensity 10000.
      spectrum USE neutral
      emitter PhBDiffuseEmitter {}
   }
}

PROTO SchlickSurface [
  exposedField SFFloat s  1.
  exposedField SFNode rho NULL
  exposedField SFFloat r  1.    # roughness
  exposedField SFFloat p  1.    # isotropy
] {
   PhBHomogeneousSurface {
#      bsdf PhBFresnelBSDF {
      bsdf PhBSimpleBSDF {
	 intensity IS s
	 spectrum IS rho
	 scatterer PhBSchlickReflector {
	    roughness IS r
	    isotropy IS p
	    selfShadowing FALSE
	 }
      }
   }
}

PROTO QuadFace [
 exposedField MFVec3f points [ ]
] {
   IndexedFaceSet {
      coord Coordinate {
         point IS points
      }
      coordIndex [ 0 1 2 3 ]
      colorPerVertex FALSE
      normalPerVertex FALSE
      solid FALSE
   }
}

NAME blue PhBLxySpectrum { xy 0.260000 0.260000 }

Group {
   children [
      Shape {
	 geometry Sphere { radius 5 }
	 appearance PhBAppearance { 
	    surface SchlickSurface {
	       s 0.5
	       rho USE blue
	       r 0.01
	       p 0.5
	    }
	 }
      },
      Shape {
	 geometry Box { size -24 -24 -24 }
	 appearance PhBAppearance { 
	    surface PhBHomogeneousSurface {
	       bsdf PhBSimpleBSDF {
		  intensity 0.5
		  spectrum USE neutral
		  scatterer PhBDiffuseReflector {}
	       }
	    }
	 }
      },
      Transform {
	 translation 0 0 10
	 children [
	    Shape {
	       geometry QuadFace { 
		  points [  0.2  0.2 0 ,
			    0.2 -0.2 0 ,
			   -0.2 -0.2 0 ,
			   -0.2  0.2 0 ]
	       }
	       appearance PhBAppearance { surface USE light }
	    }
	 ]
      }
   ]
}
