Builder/Builder/Common/MaterialSpecular.h
// calculate probability that a ray will be refracted, specularly reflected, diffusely reflected or absorbed
calculate probability that a ray will be refracted, specularly reflected, diffusely reflected or absorbed
calculate probability that a ray will be refracted specularly reflected diffusely reflected or absorbed
inline void calcProbabilities() {
		if (specularReflectance > 0.0f && opacity < 1.0f) {
			probabilityReflection = specularReflectance * 0.5f;
			probabilityRefraction = (1.0f - opacity) * 0.5f;
			probabilityDiffuse = (1.0f - probabilityReflection - probabilityRefraction) * MATERIAL_DIFFUSE_MAXREFLECTANCE;
		}
		else { 
			probabilityReflection = specularReflectance;
			probabilityRefraction = 1.0f - opacity;
			probabilityDiffuse = (1.0f - probabilityReflection - probabilityRefraction) * MATERIAL_DIFFUSE_MAXREFLECTANCE;
		}
	}
inline void calcProbabilities ( ) { if ( specularReflectance > 0.0f && opacity < 1.0f ) { probabilityReflection = specularReflectance * 0.5f ; probabilityRefraction = ( 1.0f - opacity ) * 0.5f ; probabilityDiffuse = ( 1.0f - probabilityReflection - probabilityRefraction ) * MATERIAL_DIFFUSE_MAXREFLECTANCE ; } else { probabilityReflection = specularReflectance ; probabilityRefraction = 1.0f - opacity ; probabilityDiffuse = ( 1.0f - probabilityReflection - probabilityRefraction ) * MATERIAL_DIFFUSE_MAXREFLECTANCE ; } }
calculate probability that a ray will be refracted, specularly reflected, diffusely reflected or absorbed
calculate probability that a ray will be refracted specularly reflected diffusely reflected or absorbed
// refractive AND reflective: // either reflective or refractive: