|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.j3d.threeD.raytracer.engine.RayTracingEngine
public class RayTracingEngine
The RayTracingEngine class provides static methods for rendering scenes.
| Field Summary | |
|---|---|
static RGB |
black
|
static boolean |
castShadows
Controls wether or not shadow casting will be done during rendering. |
static double |
dropOffDistance
|
static double |
e
A very small value (0.00000001) that is used in '>=' and '<=' operations to account for computational errors. |
static boolean |
inProgress
This value will be set to true when a render method starts and false when all render methods end. |
static boolean |
premultiplyIntensity
Controls wether the color of a point light source will be adjusted based on the intensity of the point light or wether this will be left up to the shader. |
static boolean |
useRouletteFogSamples
Controls the method for rendering fog in areas where no object is in view. |
| Constructor Summary | |
|---|---|
RayTracingEngine()
|
|
| Method Summary | |
|---|---|
static RGB |
ambientLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
AmbientLight light)
Performs the lighting calculations for the specified surface at the specified point of interesection on that surface using the lighting data from the specified AmbientLight object and returns an RGB object that represents the color of the point. |
static double |
calculateAverageBrightness(Scene scene,
int width,
int height,
int itr)
|
static double |
calculateAverageBrightness(Scene scene,
int width,
int height,
int ssWidth,
int ssHeight,
int itr)
|
static double |
calculateAverageBrightness(Scene scene,
int x,
int y,
int dx,
int dy,
int width,
int height,
int ssWidth,
int ssHeight,
int itr)
|
static Intersection |
closestIntersection(Ray ray,
Surface[] surfaces)
Returns an Intersection object that represents the closest intersection (>= RayTracingEngine.e) between a surface in the specified array of Surface objects and the ray represented by the specified Ray object. |
static double |
closestIntersectionAt(Intersection intersect)
Returns the value (>= RayTracingEngine.e) of the closest intersection point of the specified Intersection object If there are no positive intersections, -1.0 is returned. |
static RGB |
directionalAmbientLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
DirectionalAmbientLight light,
Light[] otherLights,
ShaderParameters p)
Performs the lighting calculations for the specified surface at the specified point of interesection on that surface using the lighting data from the specified DirectionalAmbientLight object and returns an RGB object that represents the color of the point. |
static RGB |
lightingCalculation(Ray r,
Surface[] allSurfaces,
Light[] allLights,
RGB fog,
double fd,
double fr,
ShaderParameters p)
Performs intersection and lighting calculations for the specified Ray, Surfaces, and Lights. |
static RGB |
lightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
Light[] lights,
ShaderParameters p)
Performs the lighting calculations for the specified surface at the specified point of intersection on that surface using the lighting data from the specified Light objects and returns an RGB object that represents the color of the point. |
static RGB |
lightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
Light light,
Light[] otherLights,
ShaderParameters p)
Performs the lighting calculations for the specified surface at the specified point of interesection on that surface using the lighting data from the specified Light object and returns an RGB object that represents the color of the point. |
static RGB |
pointLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
PointLight light,
Light[] otherLights,
ShaderParameters p)
Performs the lighting calculations for the specified surface at the specified point of interesection on that surface using the lighting data from the specified PointLight object and returns an RGB object that represents the color of the point. |
static Vector |
reflect(Vector vector,
Vector normal)
Reflects the specified Vector object across the normal vector represented by the second specified Vector object and returns the result. |
static Vector |
refract(Vector vector,
Vector normal,
double ni,
double nr,
boolean v)
Refracts the specified Vector object based on the specified normal vector and 2 specified indices of refraction. |
static RGB[][] |
render(Scene scene,
int x,
int y,
int dx,
int dy,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
|
static RGB[][] |
render(Scene scene,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
Computes all intersection and lighting calculations required to produce an image of the specified width and height that is a rendering of the specified Scene object and returns the image as an array of RGB objects. |
static RGB[][] |
render(Scene scene,
RenderParameters p,
ProgressMonitor monitor)
Renders the specified scene. |
static RGB[][] |
render(Surface[] surfaces,
Camera camera,
Light[] lights,
RenderParameters p,
ProgressMonitor monitor)
Computes all intersection and lighting calculations required to produce an image of the specified width and height that is a rendering of the specified set of Surface objects using the data from the specified Camera and Light object. |
static Light[] |
separateLights(int index,
Light[] allLights)
Removes the Light object at the specified index from the specified Light object array and returns the new array. |
static Surface[] |
separateSurfaces(int index,
Surface[] allSurfaces)
Removes the Surface object at the specified index from the specified Surface object array and returns the new array. |
static Surface[] |
separateSurfaces(Surface surface,
Surface[] allSurfaces)
Removes the specified Surface object from the specified Surface object array and returns the new array. |
static boolean |
shadowCalculation(Vector point,
Surface[] surfaces,
Light light)
Performs the shadow calculations for the specified surfaces at the specified point using the data from the specified Light object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean castShadows
public static boolean premultiplyIntensity
public static boolean inProgress
public static boolean useRouletteFogSamples
public static double dropOffDistance
public static RGB black
public static final double e
| Constructor Detail |
|---|
public RayTracingEngine()
| Method Detail |
|---|
public static RGB[][] render(Scene scene,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
public static RGB[][] render(Scene scene,
int x,
int y,
int dx,
int dy,
int width,
int height,
int ssWidth,
int ssHeight,
ProgressMonitor monitor)
public static RGB[][] render(Scene scene,
RenderParameters p,
ProgressMonitor monitor)
scene - Scene object to render.p - RenderParamters object to use.monitor - ProgressMonitor to use.
public static RGB[][] render(Surface[] surfaces,
Camera camera,
Light[] lights,
RenderParameters p,
ProgressMonitor monitor)
surfaces - Surface objects in scene.camera - Camera object for scene.lights - Light objects in scene.x - X coordinate of upper left corner of image.y - Y coordinate of upper left corner of image.dx - Width of image.dy - Height of image.width - Width of total image.height - Height of total image.ssWidth - Supersample width.ssHeight - Supersample height.monitor - ProgressMonitor instance to use.
public static double calculateAverageBrightness(Scene scene,
int width,
int height,
int itr)
public static double calculateAverageBrightness(Scene scene,
int width,
int height,
int ssWidth,
int ssHeight,
int itr)
public static double calculateAverageBrightness(Scene scene,
int x,
int y,
int dx,
int dy,
int width,
int height,
int ssWidth,
int ssHeight,
int itr)
public static RGB lightingCalculation(Ray r,
Surface[] allSurfaces,
Light[] allLights,
RGB fog,
double fd,
double fr,
ShaderParameters p)
public static RGB lightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
Light[] lights,
ShaderParameters p)
public static RGB lightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
Light light,
Light[] otherLights,
ShaderParameters p)
public static RGB ambientLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
AmbientLight light)
public static RGB directionalAmbientLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
DirectionalAmbientLight light,
Light[] otherLights,
ShaderParameters p)
point - The intersection point on the surface to be shaded.rayDirection - Direction of the ray that intersected the surface to be shaded.surface - The Surface object to use for shading calculations.otherSurfaces - An array of Surface objects that are also in the scene.light - The DirectionalAmbientLight instance to use for shading calculations.otherLights[] - An array of Light objects that are also in the scene.p - A ShaderParameters object that stores all parameters that are persisted
during a single set of ray casting events (reflections, refractions, etc.)
(null accepted).
public static RGB pointLightingCalculation(Vector point,
Vector rayDirection,
Surface surface,
Surface[] otherSurfaces,
PointLight light,
Light[] otherLights,
ShaderParameters p)
public static boolean shadowCalculation(Vector point,
Surface[] surfaces,
Light light)
public static Vector reflect(Vector vector,
Vector normal)
public static Vector refract(Vector vector,
Vector normal,
double ni,
double nr,
boolean v)
vector - A Vector object representing a unit vector in the direction of the incident ray
normal A Vector object respresenting a unit vector that is normal to the surface refracting the ray
ni A double value representing the index of refraction of the incident medium
nr A double value representing the index of refraction of the refracting medium
public static Intersection closestIntersection(Ray ray,
Surface[] surfaces)
public static double closestIntersectionAt(Intersection intersect)
public static Light[] separateLights(int index,
Light[] allLights)
public static Surface[] separateSurfaces(int index,
Surface[] allSurfaces)
public static Surface[] separateSurfaces(Surface surface,
Surface[] allSurfaces)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||