de.grogra.ray2.antialiasing
Class StochasticSupersampling
java.lang.Object
de.grogra.ray2.tracing.ProcessorBase
de.grogra.ray2.antialiasing.NoAntialiasing
de.grogra.ray2.antialiasing.StochasticSupersampling
- All Implemented Interfaces:
- Antialiasing, java.lang.Cloneable
public class StochasticSupersampling
- extends NoAntialiasing
This class implements a stratified stochastic supersampling strategy.
Each pixel rectangle is divided into a square grid of strata, for each
stratum a random ray is generated and its color determined.
- Author:
- Michael Tauer, Ole Kniemeyer
Method Summary |
protected void |
appendStatisticsImpl(java.lang.StringBuffer stats)
|
void |
getColorOfRectangle(double x,
double y,
double width,
double height,
Color4f color,
java.util.Random random)
This method has to return a color value determined for a given
rectangular region on the image plane. |
void |
initialize(PixelwiseRenderer tracer,
Scene scene)
Initializes the antialiasing method using the data available
through the renderer . |
protected void |
initLocals()
|
void |
setGridSize(int size)
Sets the grid size for supersampling. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CURRENT_I
public static int CURRENT_I
CURRENT_J
public static int CURRENT_J
DEBUG_I
public static int DEBUG_I
DEBUG_J
public static int DEBUG_J
GRID_SIZE
public static final java.lang.String GRID_SIZE
- See Also:
- Constant Field Values
StochasticSupersampling
public StochasticSupersampling()
appendStatisticsImpl
protected void appendStatisticsImpl(java.lang.StringBuffer stats)
- Overrides:
appendStatisticsImpl
in class NoAntialiasing
getColorOfRectangle
public void getColorOfRectangle(double x,
double y,
double width,
double height,
Color4f color,
java.util.Random random)
- Description copied from interface:
Antialiasing
- This method has to return a color value determined for a given
rectangular region on the image plane. The coordinates are understood
as
uv
coordinates for the
Sensor
which represents the camera.
- Specified by:
getColorOfRectangle
in interface Antialiasing
- Overrides:
getColorOfRectangle
in class NoAntialiasing
- Parameters:
x
- Describes the x position of the lower left corner of
the rectangle.y
- Describes the y position of the lower left corner of
the rectangle.width
- width of the rectangleheight
- height of the of the rectanglecolor
- The determined color of the rectangle will be
stored in this parameter.random
- pseudorandom generator
initialize
public void initialize(PixelwiseRenderer tracer,
Scene scene)
- Description copied from interface:
Antialiasing
- Initializes the antialiasing method using the data available
through the
renderer
.
- Specified by:
initialize
in interface Antialiasing
- Overrides:
initialize
in class NoAntialiasing
- Parameters:
tracer
- the renderer which provides the needed informationscene
- the scene which is rendered
initLocals
protected void initLocals()
- Overrides:
initLocals
in class NoAntialiasing
setGridSize
public void setGridSize(int size)
- Sets the grid size for supersampling. A square grid
of
size
by size
strata will be used
to generate the random rays.
- Parameters:
size
- size of the grid edges