Package org.sunflow.core.renderer
Class MultipassRenderer
- java.lang.Object
-
- org.sunflow.core.renderer.MultipassRenderer
-
- All Implemented Interfaces:
ImageSampler
public class MultipassRenderer extends java.lang.Object implements ImageSampler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
MultipassRenderer.BucketThread
-
Field Summary
Fields Modifier and Type Field Description private int[]
bucketCoords
private int
bucketCounter
private BucketOrder
bucketOrder
private java.lang.String
bucketOrderName
private int
bucketSize
private Display
display
private int
imageHeight
private int
imageWidth
private float
invNumSamples
private int
numSamples
private Scene
scene
private boolean
shadingCache
-
Constructor Summary
Constructors Constructor Description MultipassRenderer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static double
distb1(double x)
boolean
prepare(Options options, Scene scene, int w, int h)
Prepare the sampler for rendering an image of w x h pixelsprivate static double
qpow(double x)
void
render(Display display)
Render the image to the specified display.private void
renderBucket(Display display, int bx, int by, int threadID, IntersectionState istate, ShadingCache cache)
private static double
warpCubic(double x)
Cubic BSpline warping functions.private static float
warpTent(float x)
Tent filter warping function.
-
-
-
Field Detail
-
scene
private Scene scene
-
display
private Display display
-
imageWidth
private int imageWidth
-
imageHeight
private int imageHeight
-
bucketOrderName
private java.lang.String bucketOrderName
-
bucketOrder
private BucketOrder bucketOrder
-
bucketSize
private int bucketSize
-
bucketCounter
private int bucketCounter
-
bucketCoords
private int[] bucketCoords
-
numSamples
private int numSamples
-
invNumSamples
private float invNumSamples
-
shadingCache
private boolean shadingCache
-
-
Method Detail
-
prepare
public boolean prepare(Options options, Scene scene, int w, int h)
Description copied from interface:ImageSampler
Prepare the sampler for rendering an image of w x h pixels- Specified by:
prepare
in interfaceImageSampler
w
- width of the imageh
- height of the image
-
render
public void render(Display display)
Description copied from interface:ImageSampler
Render the image to the specified display. The sampler can assume the display has been opened and that it will be closed after the method returns.- Specified by:
render
in interfaceImageSampler
- Parameters:
display
- Display driver to send image data to
-
renderBucket
private void renderBucket(Display display, int bx, int by, int threadID, IntersectionState istate, ShadingCache cache)
-
warpTent
private static final float warpTent(float x)
Tent filter warping function.- Parameters:
x
- sample in the [0,1) range- Returns:
- warped sample in the [-1,+1) range
-
warpCubic
private static final double warpCubic(double x)
Cubic BSpline warping functions. Formulas from: "Generation of Stratified Samples for B-Spline Pixel Filtering" http://www.cs.utah.edu/~mstark/papers/- Parameters:
x
- samples in the [0,1) range- Returns:
- warped sample in the [-2,+2) range
-
qpow
private static final double qpow(double x)
-
distb1
private static final double distb1(double x)
-
-