28 #define SL_MAXTRACE 15
53 SLRay* rayFromHitPoint);
163 (
hitMat->transmission().g > 0.0f) ||
164 (
hitMat->transmission().b > 0.0f)); }
SLRayType
SLRayType enumeration for specifying ray type in ray tracing.
Defines a standard CG material with textures and a shader program.
void specular(const SLCol4f &spec)
void diffuse(const SLCol4f &diff)
Ray class with ray and intersection properties.
SLfloat tmax
max. dist. of last AABB intersection
SLint sign[3]
Sign of invDir for fast AABB hit in WS.
SLVec3f origin
Vector to the origin of ray in WS.
static SLint depthReached
depth reached for a primary ray
static SLuint intersections
NO. of intersection.
bool reflectMC(SLRay *reflected, const SLMat3f &rotMat) const
SLfloat lightDist
Distance to light for shadow rays.
static SLuint tirRays
NO. of TIR refraction rays.
SLRayType type
PRIMARY, REFLECTED, REFRACTED, SHADOW.
SLCol4f hitTexCol
Texture color at intersection point.
static SLuint tests
NO. of intersection tests.
SLbool isOutside
Flag if ray is inside of a material.
SLFace * originTria
Points to the triangle at ray origin.
static SLuint reflectedRays
NO. of reflected rays.
SLint depth
Recursion depth for ray tracing.
SLMaterial * hitMat
Points to material of intersected node.
SLVec3f dir
Direction vector of ray in WS.
SLShape * originShape
Points to the shape at ray origin.
SLFace * hitTriangle
Points to the intersected triangle.
SLVec3f invDirOS
Inverse ray dir for fast AABB hit in OS.
void setDirOS(SLVec3f Dir)
void refract(SLRay *refracted)
SLfloat tmin
min. dist. of last AABB intersection
SLShape * hitShape
Points to the intersected shape.
static SLint maxDepthReached
max. depth reached for all rays
static SLuint refractedRays
NO. of refracted rays.
static SLlong emittedPhotons
NO. of emitted photons from all lightsources.
SLfloat length
length from origin to an intersection
SLfloat contrib
Current contribution of ray to color.
static SLuint subsampledPixels
NO. of of subsampled pixels.
SLVec3f hitPoint
Point of intersection.
void diffuseMC(SLRay *scattered) const
static SLlong diffusePhotons
NO. of diffusely scattered photons on surfaces.
SLbool nodeTransparency()
SLVec3f dirOS
Direction vector of ray in OS.
static SLlong tirPhotons
NO. of total internal refraction photons.
static SLlong refractedPhotons
NO. of refracted photons;.
static SLfloat avgDepth
average depth reached
static SLfloat minContrib
Min. contibution to color (1/256)
void reflect(SLRay *reflected) const
SLint signOS[3]
Sign of invDir for fast AABB hit in OS.
static SLuint subsampledRays
NO. of of subsampled rays.
static SLbool ignoreLights
flag for gloss sampling
SLfloat y
Pixel position for primary rays.
SLVec3f invDir
Inverse ray dir for fast AABB hit in WS.
static TRanrotBGenerator * random
Random generator.
SLMaterial * originMat
Points to appearance at ray origin.
SLVec3f originOS
Vector to the origin of ray in OS.
void refractMC(SLRay *refracted, const SLMat3f &rotMat) const
static SLuint shadowRays
NO. of shadow rays.
SLVec3f hitNormal
Surface normal at intersection point.
static SLlong reflectedPhotons
NO. of reflected photons;.
static SLint maxDepth
Max. recursion depth.
SLfloat hitV
barycentric coords in hit triangle