org.osm2world.core.target.jogl
public class JOGLTargetShader extends AbstractJOGLTarget implements JOGLTarget
globalLightingParameters, nonAreaPrimitives, primitiveBuffer, renderer, renderingParameters, textureManager
BOX_TEX_COORDS_1, BOX_TEX_COORDS_2, config
Constructor and Description |
---|
JOGLTargetShader(GL3 gl,
JOGLRenderingParameters renderingParameters,
GlobalLightingParameters globalLightingParameters) |
Modifier and Type | Method and Description |
---|---|
void |
drawBackgoundImage(File backgroundImage,
int startPixelX,
int startPixelY,
int pixelWidth,
int pixelHeight,
JOGLTextureManager textureManager) |
protected void |
drawBoundingBox(Color color,
AxisAlignedBoundingBoxXYZ bb)
Draw the corners of a bounding box as colored lines.
|
protected void |
drawBox(Color color,
VectorXYZ v1,
VectorXYZ v2,
VectorXYZ v3,
VectorXYZ v4)
Draw a colored 2D box as line loop.
|
protected void |
drawLine(Color color,
VectorXYZ v1,
VectorXYZ v2)
Draw a colored line between two points.
|
void |
finish()
gives the target the chance to perform finish/cleanup operations
after all objects have been drawn.
|
void |
renderPart(Camera camera,
Projection projection,
double xStart,
double xEnd,
double yStart,
double yEnd)
similar to
JOGLTarget.render(Camera, Projection) ,
but allows rendering only a part of the "normal" image. |
void |
reset()
discards all accumulated draw calls
|
void |
setShowShadowPerspective(boolean s)
Set whether to use the real camera PMVMatrix or the PMVMatrix normally
used for drawing the shadow map when rendering the world.
|
void |
setXZBoundary(AxisAlignedBoundingBoxXZ boundary)
Set the boundary for the relevant data.
|
static Projection |
updateClippingPlanesForCamera(Camera camera,
Projection projection,
AxisAlignedBoundingBoxXYZ boundingBox)
Calculate tighter near and far planes for the boundingBox around the visible world objects.
|
clearGL, drawLineLoop, drawLineStrip, drawLineStrip, drawPoints, drawPrimitive, freeResources, getRenderableType, isFinished, render, render, setGlobalLightingParameters, setRenderingParameters
drawTriangleFan, drawTriangles, drawTriangleStrip, drawTrianglesWithNormals
beginObject, drawBox, drawColumn, drawConvexPolygon, drawExtrudedShape, drawShape, setConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
drawLineLoop, drawLineStrip, drawLineStrip, drawPoints, freeResources, isFinished, render, setConfiguration, setGlobalLightingParameters, setRenderingParameters
beginObject, drawBox, drawColumn, drawConvexPolygon, drawExtrudedShape, drawShape, drawTriangleFan, drawTriangles, drawTriangleStrip, drawTrianglesWithNormals, getRenderableType, render
public JOGLTargetShader(GL3 gl, JOGLRenderingParameters renderingParameters, GlobalLightingParameters globalLightingParameters)
public void drawBackgoundImage(File backgroundImage, int startPixelX, int startPixelY, int pixelWidth, int pixelHeight, JOGLTextureManager textureManager)
drawBackgoundImage
in interface JOGLTarget
public static Projection updateClippingPlanesForCamera(Camera camera, Projection projection, AxisAlignedBoundingBoxXYZ boundingBox)
camera
- the current camera for which the planes are calculatedprojection
- the current projectionboundingBox
- the bounding box around all visible world objectspublic void renderPart(Camera camera, Projection projection, double xStart, double xEnd, double yStart, double yEnd)
JOGLTarget
JOGLTarget.render(Camera, Projection)
,
but allows rendering only a part of the "normal" image.
For example, with xStart=0, xEnd=0.5, yStart=0 and yEnd=1,
only the left half of the full image will be rendered,
but it will be stretched to cover the available space.
Only supported for orthographic projections!renderPart
in interface JOGLTarget
protected final void drawBoundingBox(Color color, AxisAlignedBoundingBoxXYZ bb)
color
- the color of the linesbb
- the bounding box to drawprotected final void drawLine(Color color, VectorXYZ v1, VectorXYZ v2)
protected final void drawBox(Color color, VectorXYZ v1, VectorXYZ v2, VectorXYZ v3, VectorXYZ v4)
public void finish()
Target
finish
in interface Target<RenderableToJOGL>
finish
in class AbstractTarget<RenderableToJOGL>
public void reset()
JOGLTarget
reset
in interface JOGLTarget
reset
in class AbstractJOGLTarget
public void setXZBoundary(AxisAlignedBoundingBoxXZ boundary)
JOGLTarget
setXZBoundary
in interface JOGLTarget
public void setShowShadowPerspective(boolean s)