|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.DefaultImageFunction
cz.cuni.jagrlib.piece.RayCasting
cz.cuni.jagrlib.piece.RayTracing
public class RayTracing
Ray tracing of CSG scenes.
Field Summary | |
---|---|
protected int |
actOrder
Actual sample order. |
protected int |
actTotal
Actual cardinality of sample set. |
protected boolean |
doReflections
Use reflected rays (recursion). |
protected boolean |
doRefractions
Use refracted rays - in case of transparent material (recursion). |
protected static long |
HASH_REFLECT
Hash-multiplier for reflected rays. |
protected static long |
HASH_REFRACT
Hash-multiplier for refracted rays. |
static java.lang.String |
MAX_RECURSION
|
protected int |
maxLevel
Recursion-termination parameter - maximal recursion depth. |
static java.lang.String |
MIN_IMPORTANCE
|
protected double |
minImportance
Recursion-termination parameter - minimal importance value which causes ray reflection and/or refraction. |
static java.lang.String |
REFLECTIONS
|
static java.lang.String |
REFRACTIONS
|
static RegPiece |
reg
Static registration instance for this class. |
Fields inherited from class cz.cuni.jagrlib.piece.RayCasting |
---|
camera, CATEGORY, dataMask, doShading, doShadows, doTextures, HASH_LIGHT, HASH_TEXTURE, inter, scene, SHADING, SHADOWS, TEMPLATE_NAME, TEXTURES, xA, xK, yA, yK |
Fields inherited from class cz.cuni.jagrlib.DefaultImageFunction |
---|
background, time, xMax, xMin, yMax, yMin |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.ImageFunction |
---|
BACKGROUND_COLOR |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
RayTracing()
|
Method Summary | |
---|---|
protected boolean |
assertScene()
Asserts the RayCasting.scene accelerator and
does first-time algorithm setup. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
long |
getSample(double x,
double y,
int order,
int total,
double[] color)
Computes one image sample. |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
protected long |
shade(int level,
double importance,
double[] p0,
double[] p1,
double[] color)
Recursive shading function - computes color contribution of the given ray (shot from the origin p0 into direction vector p1 ). |
Methods inherited from class cz.cuni.jagrlib.piece.RayCasting |
---|
getTime, getTimeInterval, hashLights, setBounds, setTime |
Methods inherited from class cz.cuni.jagrlib.DefaultImageFunction |
---|
getBounds, getSample |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit |
Field Detail |
---|
protected static final long HASH_REFRACT
protected static final long HASH_REFLECT
protected int actOrder
protected int actTotal
protected boolean doReflections
protected boolean doRefractions
protected int maxLevel
minImportance
protected double minImportance
maxLevel
public static final java.lang.String REFLECTIONS
public static final java.lang.String REFRACTIONS
public static final java.lang.String MAX_RECURSION
public static final java.lang.String MIN_IMPORTANCE
public static final RegPiece reg
Constructor Detail |
---|
public RayTracing()
Method Detail |
---|
protected boolean assertScene()
RayCasting.scene
accelerator and
does first-time algorithm setup.
assertScene
in class RayCasting
true
if failed.protected long shade(int level, double importance, double[] p0, double[] p1, double[] color)
p0
into direction vector p1
). Recursion is stopped
by a hybrid method: importance
and level
are checked.
level
- Actual recursion depth.importance
- Importance of the actual ray.p0
- Ray origin.p1
- Direction vector of the ray.color
- Pre-allocated array to hold result color vector (double[1]
for monochrome images, double[3]
for RGB images,
larger arrays can be used for more complex spectral sampling).
minImportance
,
maxLevel
,
RayCasting.scene
,
RayCasting.inter
public long getSample(double x, double y, int order, int total, double[] color)
getSample
in interface ImageFunction
getSample
in class RayCasting
x
- X coordinate of the sample.y
- Y coordinate of the sample.order
- Order of this sample inside the actual pixel.total
- Total number of samples in the actual pixel.color
- Pre-allocated array to hold result color vector (double[1]
for monochrome images, double[3]
for RGB images,
larger arrays can be used for more complex spectral sampling).
DefaultImageFunction.getSample(double,double,double[])
,
DefaultImageFunction.getBounds(double[])
public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class RayCasting
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class RayCasting
key
- Key string.
null
.public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |