Class PathTracerHelper
java.lang.Object
com.marginallyclever.ro3.apps.pathtracer.PathTracerHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic javax.vecmath.Vector3d
getRandomCosineWeightedHemisphere
(HaltonWithMemory halton, javax.vecmath.Vector3d normal) Get a random direction on the hemisphere defined by the normal, with cosine-weighted distribution.static javax.vecmath.Vector3d
getRandomUnitHemisphere
(HaltonWithMemory halton, javax.vecmath.Vector3d normal) Get a random direction on the hemisphere defined by the normal.static javax.vecmath.Vector3d
getRandomUnitVector
(HaltonWithMemory halton)
-
Constructor Details
-
PathTracerHelper
public PathTracerHelper()
-
-
Method Details
-
getRandomUnitVector
- Returns:
- a random vector on the unit sphere
-
getRandomCosineWeightedHemisphere
public static javax.vecmath.Vector3d getRandomCosineWeightedHemisphere(HaltonWithMemory halton, javax.vecmath.Vector3d normal) Get a random direction on the hemisphere defined by the normal, with cosine-weighted distribution. This is used for diffuse reflection.- Parameters:
halton
-normal
-- Returns:
-
getRandomUnitHemisphere
public static javax.vecmath.Vector3d getRandomUnitHemisphere(HaltonWithMemory halton, javax.vecmath.Vector3d normal) Get a random direction on the hemisphere defined by the normal.
This is used for diffuse reflection.
- Parameters:
normal
- the normal of the surface at the hit point- Returns:
- a random direction on the hemisphere defined by the normal
-