java.lang.Object
de.grogra.ray2.tracing.ProcessorBase
de.grogra.ray2.antialiasing.NoAntialiasing
de.grogra.ray2.antialiasing.StochasticSupersampling
- All Implemented Interfaces:
Antialiasing,Cloneable
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
-
Field Summary
FieldsFields inherited from class de.grogra.ray2.antialiasing.NoAntialiasing
processor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendStatisticsImpl(StringBuffer stats) voidgetColorOfRectangle(double x, double y, double width, double height, Color4f color, Random random) This method has to return a color value determined for a given rectangular region on the image plane.voidinitialize(PixelwiseRenderer tracer, Scene scene) Initializes the antialiasing method using the data available through therenderer.protected voidvoidsetGridSize(int size) Sets the grid size for supersampling.Methods inherited from class de.grogra.ray2.antialiasing.NoAntialiasing
dup, setPixelXYMethods inherited from class de.grogra.ray2.tracing.ProcessorBase
appendStatistics, clone, mergeStatisticsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.grogra.ray2.antialiasing.Antialiasing
appendStatistics
-
Field Details
-
GRID_SIZE
- See Also:
-
DEBUG_I
public static int DEBUG_I -
DEBUG_J
public static int DEBUG_J -
CURRENT_I
public static int CURRENT_I -
CURRENT_J
public static int CURRENT_J
-
-
Constructor Details
-
StochasticSupersampling
public StochasticSupersampling()
-
-
Method Details
-
initLocals
protected void initLocals()- Overrides:
initLocalsin classNoAntialiasing
-
initialize
Description copied from interface:AntialiasingInitializes the antialiasing method using the data available through therenderer.- Specified by:
initializein interfaceAntialiasing- Overrides:
initializein classNoAntialiasing- Parameters:
tracer- the renderer which provides the needed informationscene- the scene which is rendered
-
setGridSize
public void setGridSize(int size) Sets the grid size for supersampling. A square grid ofsizebysizestrata will be used to generate the random rays.- Parameters:
size- size of the grid edges
-
getColorOfRectangle
public void getColorOfRectangle(double x, double y, double width, double height, Color4f color, Random random) Description copied from interface:AntialiasingThis method has to return a color value determined for a given rectangular region on the image plane. The coordinates are understood asuvcoordinates for theSensorwhich represents the camera.- Specified by:
getColorOfRectanglein interfaceAntialiasing- Overrides:
getColorOfRectanglein classNoAntialiasing- 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
-
appendStatisticsImpl
- Overrides:
appendStatisticsImplin classNoAntialiasing
-