org.ogre4j
Class RenderSystem

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.RenderSystem
All Implemented Interfaces:
IAllocatedObject<IRenderSysAllocPolicy>, IRenderSysAllocatedObject, IRenderSystem, INativeObject

public class RenderSystem
extends NativeObject
implements IRenderSystem


Nested Class Summary
protected static class RenderSystem.HardwareOcclusionQueryList
           
static class RenderSystem.Listener
           
protected static class RenderSystem.ListenerList
           
static class RenderSystem.RenderTargetIterator
           
 
Nested classes/interfaces inherited from interface org.ogre4j.IRenderSystem
IRenderSystem.IHardwareOcclusionQueryList, IRenderSystem.IListener, IRenderSystem.IListenerList, IRenderSystem.IRenderTargetIterator
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  RenderSystem(InstancePointer p)
          This constructor is public for internal useage only!
protected RenderSystem(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  RenderSystem(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 void _applyObliqueDepthProjection(IMatrix4 matrix, IPlane plane, boolean forGpuProgram)
          Update a perspective projection matrix to use 'oblique depth projection'.
 void _beginFrame()
          Signifies the beginning of a frame, i.e. the start of rendering on a single viewport.
 void _beginGeometryCount()
          The will keep a count of tris rendered, this resets the count.
 void _convertProjectionMatrix(IMatrix4 matrix, IMatrix4 dest, boolean forGpuProgram)
          Converts a uniform projection matrix to suitable for this render system.
 IRenderWindow _createRenderWindow(java.lang.String name, long width, long height, boolean fullScreen, INameValuePairList miscParams)
          Creates a new rendering window.
 void _disableTextureUnit(int texUnit)
          Turns off a texture unit.
 void _disableTextureUnitsFrom(int texUnit)
          Disables all texture units from the given unit upwards
 void _endFrame()
          Ends rendering of a frame to the current viewport.
 long _getBatchCount()
          Reports the number of batches rendered since the last _beginGeometryCount call.
 CullingMode _getCullingMode()
           
 long _getFaceCount()
          Reports the number of tris rendered since the last _beginGeometryCount call.
 long _getVertexCount()
          Reports the number of vertices passed to the renderer since the last _beginGeometryCount call.
 IViewport _getViewport()
          Get the current active viewport for rendering.
 IRenderWindow _initialise(boolean autoCreateWindow, java.lang.String windowTitle)
          Start up the renderer using the settings selected (Or the defaults if none have been selected).
 void _initRenderTargets()
          Utility method for initialising all render targets attached to this rendering system.
 void _makeOrthoMatrix(IRadian fovy, float aspect, float nearPlane, float farPlane, IMatrix4 dest, boolean forGpuProgram)
          Builds an orthographic projection matrix suitable for this render system.
 void _makeProjectionMatrix(float left, float right, float bottom, float top, float nearPlane, float farPlane, IMatrix4 dest, boolean forGpuProgram)
          Builds a perspective projection matrix for the case when frustum is not centered around camera.
 void _makeProjectionMatrix(IRadian fovy, float aspect, float nearPlane, float farPlane, IMatrix4 dest, boolean forGpuProgram)
          Builds a perspective projection matrix suitable for this render system.
 void _notifyCameraRemoved(ICamera cam)
          Utility method to notify all render targets that a camera has been removed, in case they were referring to it as their viewer.
 void _render(IRenderOperation op)
          Render something to the active viewport.
 void _setAlphaRejectSettings(CompareFunction func, short value, boolean alphaToCoverage)
          Sets the global alpha rejection approach for future renders.
 void _setColourBufferWriteEnabled(boolean red, boolean green, boolean blue, boolean alpha)
          Sets whether or not colour buffer writing is enabled, and for which channels.
 void _setCullingMode(CullingMode mode)
          Sets the culling mode for the render system based on the 'vertex winding'.
 void _setDepthBias(float constantBias, float slopeScaleBias)
          Sets the depth bias, NB you should use the version of this.
 void _setDepthBufferCheckEnabled(boolean enabled)
          Sets whether or not the depth buffer check is performed before a pixel write.
 void _setDepthBufferFunction(CompareFunction func)
          Sets the comparison function for the depth buffer check.
 void _setDepthBufferParams(boolean depthTest, boolean depthWrite, CompareFunction depthFunction)
          Sets the mode of operation for depth buffer tests from this point onwards.
 void _setDepthBufferWriteEnabled(boolean enabled)
          Sets whether or not the depth buffer is updated after a pixel write.
 void _setFog(FogMode mode, IColourValue colour, float expDensity, float linearStart, float linearEnd)
          Sets the fogging mode for future geometry.
 void _setPointParameters(float size, boolean attenuationEnabled, float constant, float linear, float quadratic, float minSize, float maxSize)
          Sets the size of points and how they are attenuated with distance.
 void _setPointSpritesEnabled(boolean enabled)
          Sets whether or not rendering points using OT_POINT_LIST will render point sprites (textured quads) or plain points.
 void _setPolygonMode(PolygonMode level)
          Sets how to rasterise triangles, as points, wireframe or solid polys.
 void _setProjectionMatrix(IMatrix4 m)
          Sets the projection transform matrix
 void _setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor)
          Sets the global blending factors for combining subsequent renders with the existing frame contents.
 void _setSeparateSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendFactor sourceFactorAlpha, SceneBlendFactor destFactorAlpha)
          Sets the global blending factors for combining subsequent renders with the existing frame contents.
 void _setSurfaceParams(IColourValue ambient, IColourValue diffuse, IColourValue specular, IColourValue emissive, float shininess, int tracking)
          Sets the surface properties to be used for future rendering.
 void _setTexture(int unit, boolean enabled, ITexturePtr texPtr)
          Sets the texture to bind to a given texture unit.
 void _setTexture(int unit, boolean enabled, java.lang.String texname)
          Sets the texture to bind to a given texture unit.
 void _setTextureAddressingMode(int unit, ITextureUnitState.IUVWAddressingMode uvw)
          Sets the texture addressing mode for a texture unit.
 void _setTextureBlendMode(int unit, ILayerBlendModeEx bm)
          Sets the texture blend modes from a record.
 void _setTextureBorderColour(int unit, IColourValue colour)
          Sets the texture border colour for a texture unit.
 void _setTextureCoordCalculation(int unit, TexCoordCalcMethod m, IFrustum frustum)
          Sets a method for automatically calculating texture coordinates for a stage.
 void _setTextureCoordSet(int unit, int index)
          Sets the texture coordinate set to use for a texture unit.
 void _setTextureLayerAnisotropy(int unit, long maxAnisotropy)
          Sets the maximal anisotropy for the specified texture unit.
 void _setTextureMatrix(int unit, IMatrix4 xform)
          Sets the texture coordinate transformation matrix for a texture unit.
 void _setTextureMipmapBias(int unit, float bias)
          Sets the mipmap bias value for a given texture unit.
 void _setTextureProjectionRelativeTo(boolean enabled, IVector3 pos)
          Notify the rendersystem that it should adjust texture projection to be relative to a different origin.
 void _setTextureUnitFiltering(int unit, FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter)
          Sets the filtering options for a given texture unit.
 void _setTextureUnitFiltering(int unit, FilterType ftype, FilterOptions filter)
          Sets a single filter for a given texture unit.
 void _setTextureUnitSettings(int texUnit, ITextureUnitState tl)
          Utility function for setting all the properties of a texture unit at once.
 void _setVertexTexture(int unit, ITexturePtr tex)
          Binds a texture to a vertex sampler.
 void _setViewMatrix(IMatrix4 m)
          Sets the view transform matrix
 void _setViewport(IViewport vp)
          Sets the provided viewport as the active one for future rendering operations.
 void _setWorldMatrices(IMatrix4 m, int count)
          Sets multiple world matrices (vertex blending).
 void _setWorldMatrix(IMatrix4 m)
          Sets the world transform matrix.
 void _swapAllRenderTargetBuffers(boolean waitForVsync)
          Internal method for swapping all the buffers on all render targets, if _updateAllRenderTargets was called with a 'false' parameter.
 void _updateAllRenderTargets(boolean swapBuffers)
          Internal method for updating all render targets attached to this rendering system.
 void _useLights(ILightList lights, int limit)
          Tells the rendersystem to use the attached set of lights (and no others) up to the number specified (this allows the same list to be used with different count limits)
 void addClipPlane(float A, float B, float C, float D)
          Add a user clipping plane.
 void addClipPlane(IPlane p)
          Add a user clipping plane.
 void addListener(IRenderSystem.IListener l)
          Adds a listener to the custom events that this render system can raise.
 void attachRenderTarget(IRenderTarget target)
          Attaches the passed render target to the render system.
 void bindGpuProgram(IGpuProgram prg)
          Binds a given (but not the parameters).
 void bindGpuProgramParameters(GpuProgramType gptype, IGpuProgramParametersSharedPtr params)
          Bind Gpu program parameters.
 void bindGpuProgramPassIterationParameters(GpuProgramType gptype)
          Only binds Gpu program parameters used for passes that have more than one iteration rendering
 void clearFrameBuffer(long buffers, IColourValue colour, float depth, int stencil)
          Clears one or more frame buffers on the active render target.
 void convertColourValue(IColourValue colour, LongPointer pDest)
          Generates a packed data version of the passed in suitable for use as with this .
 IHardwareOcclusionQuery createHardwareOcclusionQuery()
          Create an object for performing hardware occlusion queries.
 IMultiRenderTarget createMultiRenderTarget(java.lang.String name)
          Create a , which is a render target that renders to multiple RenderTextures at once.
 IRenderSystemCapabilities createRenderSystemCapabilities()
          Query the real capabilities of the GPU and driver in the
 void delete()
          Deletes the corresponding C++ object.
 void destroyHardwareOcclusionQuery(IHardwareOcclusionQuery hq)
          Destroy a hardware occlusion query object.
 void destroyRenderTarget(java.lang.String name)
          Destroys a render target of any sort
 void destroyRenderTexture(java.lang.String name)
          Destroys a render texture
 void destroyRenderWindow(java.lang.String name)
          Destroys a render window
 IRenderTarget detachRenderTarget(java.lang.String name)
          Detaches the render target with the passed name from the render system and returns a pointer to it.
 void finalize()
           
 IRenderSystemCapabilities getCapabilities()
          Gets the capabilities of the render system.
 VertexElementType getColourVertexElementType()
          Get the native VertexElementType for a compact 32-bit colour value for this rendersystem.
 IConfigOptionMap getConfigOptions()
          Returns the details of this API's configuration options
 IDriverVersion getDriverVersion()
          Returns the driver version.
 java.lang.String getErrorDescription(long errorNumber)
          Returns a description of an error code.
 float getHorizontalTexelOffset()
          Returns the horizontal texel offset value required for mapping texel origins to pixel origins in this rendersystem.
 float getMaximumDepthInputValue()
          Gets the maximum (farthest) depth value to be used when rendering using identity transforms.
 float getMinimumDepthInputValue()
          Gets the minimum (closest) depth value to be used when rendering using identity transforms.
 java.lang.String getName()
          Returns the name of the rendering system.
 IStringVector getRenderSystemEvents()
          Gets a list of the rendersystem specific events that this rendersystem can raise.
 IRenderTarget getRenderTarget(java.lang.String name)
          Returns a pointer to the render target with the passed name, or NULL if that render target cannot be found.
 void getRenderTargetIterator(IRenderSystem.IRenderTargetIterator returnValue)
          Returns a specialised over all render targets attached to the .
 float getVerticalTexelOffset()
          Returns the vertical texel offset value required for mapping texel origins to pixel origins in this rendersystem.
 boolean getWaitForVerticalBlank()
          Returns true if the system is synchronising frames with the monitor vertical blank.
 boolean getWBufferEnabled()
          Returns true if the renderer will try to use W-buffers when avalible.
 boolean isGpuProgramBound(GpuProgramType gptype)
          Returns whether or not a Gpu program of the given type is currently bound.
 void postExtraThreadsStarted()
           
 void preExtraThreadsStarted()
          Tell the rendersystem to perform any prep tasks it needs to directly before other threads which might access the rendering API are registered.
 void registerThread()
          Register the an additional thread which may make calls to rendersystem-related objects.
 void reinitialise()
          Restart the renderer (normally following a change in settings).
 void removeListener(IRenderSystem.IListener l)
          Remove a listener to the custom events that this render system can raise.
 void resetClipPlanes()
          Clears the user clipping region.
 void setAmbientLight(float r, float g, float b)
          Sets the colour & strength of the ambient (global directionless) light in the world.
 void setClipPlanes(IPlaneList clipPlanes)
          Sets the user clipping region.
 void setConfigOption(java.lang.String name, java.lang.String value)
          Sets an option for this API
 void setCurrentPassIterationCount(int count)
          set the current multi pass count value.
 void setDeriveDepthBias(boolean derive, float baseValue, float multiplier, float slopeScale)
          Tell the render system whether to derive a depth bias on its own based on the values passed to it in setCurrentPassIterationCount.
 void setInvertVertexWinding(boolean invert)
          Sets whether or not vertex windings set should be inverted; this can be important for rendering reflections.
 void setLightingEnabled(boolean enabled)
          Sets whether or not dynamic lighting is enabled.
 void setNormaliseNormals(boolean normalise)
          Sets whether or not normals are to be automatically normalised.
 void setScissorTest(boolean enabled, int left, int top, int right, int bottom)
          Sets the 'scissor region' ie the region of the target in which rendering can take place.
 void setShadingType(ShadeOptions so)
          Sets the type of light shading required (default = Gouraud).
 void setStencilBufferParams(CompareFunction func, long refValue, long mask, StencilOperation stencilFailOp, StencilOperation depthFailOp, StencilOperation passOp, boolean twoSidedOperation)
          This method allows you to set all the stencil buffer parameters in one call.
 void setStencilCheckEnabled(boolean enabled)
          Turns stencil buffer checking on or off.
 void setVertexBufferBinding(IVertexBufferBinding binding)
          Sets the current vertex buffer binding state.
 void setVertexDeclaration(IVertexDeclaration decl)
          Sets the current vertex declaration, ie the source of vertex data.
 void setWaitForVerticalBlank(boolean enabled)
          Defines whether or now fullscreen render windows wait for the vertical blank before flipping buffers.
 void setWBufferEnabled(boolean enabled)
          Sets whether or not W-buffers are enabled if they are available for this renderer.
 void shutdown()
          Shutdown the renderer and cleanup resources.
 void unbindGpuProgram(GpuProgramType gptype)
          Unbinds GpuPrograms of a given GpuProgramType.
 void unregisterThread()
          Unregister an additional thread which may make calls to rendersystem-related objects.
 void useCustomRenderSystemCapabilities(IRenderSystemCapabilities capabilities)
          Force the render system to use the special capabilities.
 java.lang.String validateConfigOptions()
          Validates the options set for the rendering system, returning a message if there are problems.
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

RenderSystem

public RenderSystem(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


RenderSystem

protected RenderSystem(InstancePointer p,
                       boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


RenderSystem

public RenderSystem(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

getName

public java.lang.String getName()
Returns the name of the rendering system.

Specified by:
getName in interface IRenderSystem

getConfigOptions

public IConfigOptionMap getConfigOptions()
Returns the details of this API's configuration options

Specified by:
getConfigOptions in interface IRenderSystem

setConfigOption

public void setConfigOption(java.lang.String name,
                            java.lang.String value)
Sets an option for this API

Specified by:
setConfigOption in interface IRenderSystem

createHardwareOcclusionQuery

public IHardwareOcclusionQuery createHardwareOcclusionQuery()
Create an object for performing hardware occlusion queries.

Specified by:
createHardwareOcclusionQuery in interface IRenderSystem

destroyHardwareOcclusionQuery

public void destroyHardwareOcclusionQuery(IHardwareOcclusionQuery hq)
Destroy a hardware occlusion query object.

Specified by:
destroyHardwareOcclusionQuery in interface IRenderSystem

validateConfigOptions

public java.lang.String validateConfigOptions()
Validates the options set for the rendering system, returning a message if there are problems.

Specified by:
validateConfigOptions in interface IRenderSystem

_initialise

public IRenderWindow _initialise(boolean autoCreateWindow,
                                 java.lang.String windowTitle)
Start up the renderer using the settings selected (Or the defaults if none have been selected).

Specified by:
_initialise in interface IRenderSystem

createRenderSystemCapabilities

public IRenderSystemCapabilities createRenderSystemCapabilities()
Query the real capabilities of the GPU and driver in the

Specified by:
createRenderSystemCapabilities in interface IRenderSystem

useCustomRenderSystemCapabilities

public void useCustomRenderSystemCapabilities(IRenderSystemCapabilities capabilities)
Force the render system to use the special capabilities. Can only be called before the render system has been fully initializer (before createWindow is called)

Specified by:
useCustomRenderSystemCapabilities in interface IRenderSystem

reinitialise

public void reinitialise()
Restart the renderer (normally following a change in settings).

Specified by:
reinitialise in interface IRenderSystem

shutdown

public void shutdown()
Shutdown the renderer and cleanup resources.

Specified by:
shutdown in interface IRenderSystem

setAmbientLight

public void setAmbientLight(float r,
                            float g,
                            float b)
Sets the colour & strength of the ambient (global directionless) light in the world.

Specified by:
setAmbientLight in interface IRenderSystem

setShadingType

public void setShadingType(ShadeOptions so)
Sets the type of light shading required (default = Gouraud).

Specified by:
setShadingType in interface IRenderSystem

setLightingEnabled

public void setLightingEnabled(boolean enabled)
Sets whether or not dynamic lighting is enabled.

Specified by:
setLightingEnabled in interface IRenderSystem

setWBufferEnabled

public void setWBufferEnabled(boolean enabled)
Sets whether or not W-buffers are enabled if they are available for this renderer.

Specified by:
setWBufferEnabled in interface IRenderSystem

getWBufferEnabled

public boolean getWBufferEnabled()
Returns true if the renderer will try to use W-buffers when avalible.

Specified by:
getWBufferEnabled in interface IRenderSystem

_createRenderWindow

public IRenderWindow _createRenderWindow(java.lang.String name,
                                         long width,
                                         long height,
                                         boolean fullScreen,
                                         INameValuePairList miscParams)
Creates a new rendering window. Key: "title" Description: The title of the window that will appear in the title bar Values: string Default: name Key: "colourDepth" Description: Colour depth of the resulting rendering window; only applies if fullScreen is set. Values: 16 or 32 Default: desktop depth Notes: [W32 specific] Key: "left" Description: screen x coordinate from left Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen Key: "top" Description: screen y coordinate from top Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen Key: "depthBuffer" [DX9 specific] Description: Use depth buffer Values: false or true Default: true Key: "externalWindowHandle" [API specific] Description: External window handle, for embedding the OGRE context Values: positive integer for W32 (HWND handle) poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) for GLX Default: 0 (None) Key: "externalGLControl" [Win32 OpenGL specific] Description: Let the external window control OpenGL i.e. don't select a pixel format for the window, do not change v-sync and do not swap buffer. When set to true, the calling application is responsible of OpenGL initialization and buffer swapping. It should also create an OpenGL context for its own rendering, will create one for its use. Then the calling application must also enable OpenGL context before calling any function and restore its OpenGL context after these calls. The OpenGL context can be retrieved after initialisation by calling wglGetCurrentDC() and wglGetCurrentContext(). It is only used when the externalWindowHandle parameter is used. Values: true, false Default: false Key: "externalGLContext" [Win32 OpenGL specific] Description: Use an externally created GL context Values: =""> Default: 0 (create own context) Key: "parentWindowHandle" [API specific] Description: Parent window handle, for embedding the OGRE context Values: positive integer for W32 (HWND handle) poslong:posint:poslong for GLX (display*:screen:windowHandle) Default: 0 (None) Key: "FSAA" Description: Full screen antialiasing factor Values: 0,2,4,6,... Default: 0 Key: "displayFrequency" Description: Display frequency rate, for fullscreen mode Values: 60...? Default: Desktop vsync rate Key: "vsync" Description: Synchronize buffer swaps to vsync Values: true, false Default: 0 Key: "border" Description: The type of window border (in windowed mode) Values: none, fixed, resize Default: resize Key: "outerDimensions" Description: Whether the width/height is expressed as the size of the outer window, rather than the content area Values: true, false Default: false Key: "useNVPerfHUD" [DX9 specific] Description: Enable the use of nVidia NVPerfHUD Values: true, false Default: false Key: "gamma" Description: Enable hardware conversion from linear colour space to gamma colour space on rendering to the window. Values: true, false Default: false

Specified by:
_createRenderWindow in interface IRenderSystem

createMultiRenderTarget

public IMultiRenderTarget createMultiRenderTarget(java.lang.String name)
Create a , which is a render target that renders to multiple RenderTextures at once. Surfaces can be bound and unbound at will. This fails if mCapabilities->getNumMultiRenderTargets() is smaller than 2.

Specified by:
createMultiRenderTarget in interface IRenderSystem

destroyRenderWindow

public void destroyRenderWindow(java.lang.String name)
Destroys a render window

Specified by:
destroyRenderWindow in interface IRenderSystem

destroyRenderTexture

public void destroyRenderTexture(java.lang.String name)
Destroys a render texture

Specified by:
destroyRenderTexture in interface IRenderSystem

destroyRenderTarget

public void destroyRenderTarget(java.lang.String name)
Destroys a render target of any sort

Specified by:
destroyRenderTarget in interface IRenderSystem

attachRenderTarget

public void attachRenderTarget(IRenderTarget target)
Attaches the passed render target to the render system.

Specified by:
attachRenderTarget in interface IRenderSystem

getRenderTarget

public IRenderTarget getRenderTarget(java.lang.String name)
Returns a pointer to the render target with the passed name, or NULL if that render target cannot be found.

Specified by:
getRenderTarget in interface IRenderSystem

detachRenderTarget

public IRenderTarget detachRenderTarget(java.lang.String name)
Detaches the render target with the passed name from the render system and returns a pointer to it.

Specified by:
detachRenderTarget in interface IRenderSystem

getRenderTargetIterator

public void getRenderTargetIterator(IRenderSystem.IRenderTargetIterator returnValue)
Returns a specialised over all render targets attached to the .

Specified by:
getRenderTargetIterator in interface IRenderSystem

getErrorDescription

public java.lang.String getErrorDescription(long errorNumber)
Returns a description of an error code.

Specified by:
getErrorDescription in interface IRenderSystem

setWaitForVerticalBlank

public void setWaitForVerticalBlank(boolean enabled)
Defines whether or now fullscreen render windows wait for the vertical blank before flipping buffers.

Specified by:
setWaitForVerticalBlank in interface IRenderSystem

getWaitForVerticalBlank

public boolean getWaitForVerticalBlank()
Returns true if the system is synchronising frames with the monitor vertical blank.

Specified by:
getWaitForVerticalBlank in interface IRenderSystem

_useLights

public void _useLights(ILightList lights,
                       int limit)
Tells the rendersystem to use the attached set of lights (and no others) up to the number specified (this allows the same list to be used with different count limits)

Specified by:
_useLights in interface IRenderSystem

_setWorldMatrix

public void _setWorldMatrix(IMatrix4 m)
Sets the world transform matrix.

Specified by:
_setWorldMatrix in interface IRenderSystem

_setWorldMatrices

public void _setWorldMatrices(IMatrix4 m,
                              int count)
Sets multiple world matrices (vertex blending).

Specified by:
_setWorldMatrices in interface IRenderSystem

_setViewMatrix

public void _setViewMatrix(IMatrix4 m)
Sets the view transform matrix

Specified by:
_setViewMatrix in interface IRenderSystem

_setProjectionMatrix

public void _setProjectionMatrix(IMatrix4 m)
Sets the projection transform matrix

Specified by:
_setProjectionMatrix in interface IRenderSystem

_setTextureUnitSettings

public void _setTextureUnitSettings(int texUnit,
                                    ITextureUnitState tl)
Utility function for setting all the properties of a texture unit at once. This method is also worth using over the individual texture unit settings because it only sets those settings which are different from the current settings for this unit, thus minimising render state changes.

Specified by:
_setTextureUnitSettings in interface IRenderSystem

_disableTextureUnit

public void _disableTextureUnit(int texUnit)
Turns off a texture unit.

Specified by:
_disableTextureUnit in interface IRenderSystem

_disableTextureUnitsFrom

public void _disableTextureUnitsFrom(int texUnit)
Disables all texture units from the given unit upwards

Specified by:
_disableTextureUnitsFrom in interface IRenderSystem

_setSurfaceParams

public void _setSurfaceParams(IColourValue ambient,
                              IColourValue diffuse,
                              IColourValue specular,
                              IColourValue emissive,
                              float shininess,
                              int tracking)
Sets the surface properties to be used for future rendering. This method sets the the properties of the surfaces of objects to be rendered after it. In this context these surface properties are the amount of each type of light the object reflects (determining it's colour under different types of light), whether it emits light itself, and how shiny it is. Textures are not dealt with here, see the _setTetxure method for details. This method is used by _setMaterial so does not need to be called direct if that method is being used.

Specified by:
_setSurfaceParams in interface IRenderSystem

_setPointSpritesEnabled

public void _setPointSpritesEnabled(boolean enabled)
Sets whether or not rendering points using OT_POINT_LIST will render point sprites (textured quads) or plain points.

Specified by:
_setPointSpritesEnabled in interface IRenderSystem

_setPointParameters

public void _setPointParameters(float size,
                                boolean attenuationEnabled,
                                float constant,
                                float linear,
                                float quadratic,
                                float minSize,
                                float maxSize)
Sets the size of points and how they are attenuated with distance.

Specified by:
_setPointParameters in interface IRenderSystem

_setTexture

public void _setTexture(int unit,
                        boolean enabled,
                        ITexturePtr texPtr)
Sets the texture to bind to a given texture unit. User processes would not normally call this direct unless rendering primitives themselves.

Specified by:
_setTexture in interface IRenderSystem

_setTexture

public void _setTexture(int unit,
                        boolean enabled,
                        java.lang.String texname)
Sets the texture to bind to a given texture unit. User processes would not normally call this direct unless rendering primitives themselves.

Specified by:
_setTexture in interface IRenderSystem

_setVertexTexture

public void _setVertexTexture(int unit,
                              ITexturePtr tex)
Binds a texture to a vertex sampler.

Specified by:
_setVertexTexture in interface IRenderSystem

_setTextureCoordSet

public void _setTextureCoordSet(int unit,
                                int index)
Sets the texture coordinate set to use for a texture unit. Meant for use internally - not generally used directly by apps - the and classes let you manage textures far more easily.

Specified by:
_setTextureCoordSet in interface IRenderSystem

_setTextureCoordCalculation

public void _setTextureCoordCalculation(int unit,
                                        TexCoordCalcMethod m,
                                        IFrustum frustum)
Sets a method for automatically calculating texture coordinates for a stage. Should not be used by apps - for use by only.

Specified by:
_setTextureCoordCalculation in interface IRenderSystem

_setTextureBlendMode

public void _setTextureBlendMode(int unit,
                                 ILayerBlendModeEx bm)
Sets the texture blend modes from a record. Meant for use internally only - apps should use the and classes.

Specified by:
_setTextureBlendMode in interface IRenderSystem

_setTextureUnitFiltering

public void _setTextureUnitFiltering(int unit,
                                     FilterOptions minFilter,
                                     FilterOptions magFilter,
                                     FilterOptions mipFilter)
Sets the filtering options for a given texture unit.

Specified by:
_setTextureUnitFiltering in interface IRenderSystem

_setTextureUnitFiltering

public void _setTextureUnitFiltering(int unit,
                                     FilterType ftype,
                                     FilterOptions filter)
Sets a single filter for a given texture unit.

Specified by:
_setTextureUnitFiltering in interface IRenderSystem

_setTextureLayerAnisotropy

public void _setTextureLayerAnisotropy(int unit,
                                       long maxAnisotropy)
Sets the maximal anisotropy for the specified texture unit.

Specified by:
_setTextureLayerAnisotropy in interface IRenderSystem

_setTextureAddressingMode

public void _setTextureAddressingMode(int unit,
                                      ITextureUnitState.IUVWAddressingMode uvw)
Sets the texture addressing mode for a texture unit.

Specified by:
_setTextureAddressingMode in interface IRenderSystem

_setTextureBorderColour

public void _setTextureBorderColour(int unit,
                                    IColourValue colour)
Sets the texture border colour for a texture unit.

Specified by:
_setTextureBorderColour in interface IRenderSystem

_setTextureMipmapBias

public void _setTextureMipmapBias(int unit,
                                  float bias)
Sets the mipmap bias value for a given texture unit.

Specified by:
_setTextureMipmapBias in interface IRenderSystem

_setTextureMatrix

public void _setTextureMatrix(int unit,
                              IMatrix4 xform)
Sets the texture coordinate transformation matrix for a texture unit.

Specified by:
_setTextureMatrix in interface IRenderSystem

_setSceneBlending

public void _setSceneBlending(SceneBlendFactor sourceFactor,
                              SceneBlendFactor destFactor)
Sets the global blending factors for combining subsequent renders with the existing frame contents. The result of the blending operation is: final = (texture * sourceFactor) + (pixel * destFactor) Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor enumerated type.

Specified by:
_setSceneBlending in interface IRenderSystem

_setSeparateSceneBlending

public void _setSeparateSceneBlending(SceneBlendFactor sourceFactor,
                                      SceneBlendFactor destFactor,
                                      SceneBlendFactor sourceFactorAlpha,
                                      SceneBlendFactor destFactorAlpha)
Sets the global blending factors for combining subsequent renders with the existing frame contents. The result of the blending operation is: final = (texture * sourceFactor) + (pixel * destFactor) Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor enumerated type.

Specified by:
_setSeparateSceneBlending in interface IRenderSystem

_setAlphaRejectSettings

public void _setAlphaRejectSettings(CompareFunction func,
                                    short value,
                                    boolean alphaToCoverage)
Sets the global alpha rejection approach for future renders. By default images are rendered regardless of texture alpha. This method lets you change that.

Specified by:
_setAlphaRejectSettings in interface IRenderSystem

_setTextureProjectionRelativeTo

public void _setTextureProjectionRelativeTo(boolean enabled,
                                            IVector3 pos)
Notify the rendersystem that it should adjust texture projection to be relative to a different origin.

Specified by:
_setTextureProjectionRelativeTo in interface IRenderSystem

_beginFrame

public void _beginFrame()
Signifies the beginning of a frame, i.e. the start of rendering on a single viewport. Will occur several times per complete frame if multiple viewports exist.

Specified by:
_beginFrame in interface IRenderSystem

_endFrame

public void _endFrame()
Ends rendering of a frame to the current viewport.

Specified by:
_endFrame in interface IRenderSystem

_setViewport

public void _setViewport(IViewport vp)
Sets the provided viewport as the active one for future rendering operations. This viewport is aware of it's own camera and render target. Must be implemented by subclass.

Specified by:
_setViewport in interface IRenderSystem

_getViewport

public IViewport _getViewport()
Get the current active viewport for rendering.

Specified by:
_getViewport in interface IRenderSystem

_setCullingMode

public void _setCullingMode(CullingMode mode)
Sets the culling mode for the render system based on the 'vertex winding'. A typical way for the rendering engine to cull triangles is based on the 'vertex winding' of triangles. Vertex winding refers to the direction in which the vertices are passed or indexed to in the rendering operation as viewed from the camera, and will wither be clockwise or anticlockwise (that's 'counterclockwise' for you Americans out there ;) The default is CULL_CLOCKWISE i.e. that only triangles whose vertices are passed/indexed in anticlockwise order are rendered - this is a common approach and is used in 3D studio models for example. You can alter this culling mode if you wish but it is not advised unless you know what you are doing. You may wish to use the CULL_NONE option for mesh data that you cull yourself where the vertex winding is uncertain.

Specified by:
_setCullingMode in interface IRenderSystem

_getCullingMode

public CullingMode _getCullingMode()
Specified by:
_getCullingMode in interface IRenderSystem

_setDepthBufferParams

public void _setDepthBufferParams(boolean depthTest,
                                  boolean depthWrite,
                                  CompareFunction depthFunction)
Sets the mode of operation for depth buffer tests from this point onwards. Sometimes you may wish to alter the behaviour of the depth buffer to achieve special effects. Because it's unlikely that you'll set these options for an entire frame, but rather use them to tweak settings between rendering objects, this is an internal method (indicated by the '_' prefix) which will be used by a implementation rather than directly from the client application. If this method is never called the settings are automatically the same as the default parameters.

Specified by:
_setDepthBufferParams in interface IRenderSystem

_setDepthBufferCheckEnabled

public void _setDepthBufferCheckEnabled(boolean enabled)
Sets whether or not the depth buffer check is performed before a pixel write.

Specified by:
_setDepthBufferCheckEnabled in interface IRenderSystem

_setDepthBufferWriteEnabled

public void _setDepthBufferWriteEnabled(boolean enabled)
Sets whether or not the depth buffer is updated after a pixel write.

Specified by:
_setDepthBufferWriteEnabled in interface IRenderSystem

_setDepthBufferFunction

public void _setDepthBufferFunction(CompareFunction func)
Sets the comparison function for the depth buffer check. Advanced use only - allows you to choose the function applied to compare the depth values of new and existing pixels in the depth buffer. Only an issue if the deoth buffer check is enabled (see _setDepthBufferCheckEnabled)

Specified by:
_setDepthBufferFunction in interface IRenderSystem

_setColourBufferWriteEnabled

public void _setColourBufferWriteEnabled(boolean red,
                                         boolean green,
                                         boolean blue,
                                         boolean alpha)
Sets whether or not colour buffer writing is enabled, and for which channels.

Specified by:
_setColourBufferWriteEnabled in interface IRenderSystem

_setDepthBias

public void _setDepthBias(float constantBias,
                          float slopeScaleBias)
Sets the depth bias, NB you should use the version of this.

Specified by:
_setDepthBias in interface IRenderSystem

_setFog

public void _setFog(FogMode mode,
                    IColourValue colour,
                    float expDensity,
                    float linearStart,
                    float linearEnd)
Sets the fogging mode for future geometry.

Specified by:
_setFog in interface IRenderSystem

_beginGeometryCount

public void _beginGeometryCount()
The will keep a count of tris rendered, this resets the count.

Specified by:
_beginGeometryCount in interface IRenderSystem

_getFaceCount

public long _getFaceCount()
Reports the number of tris rendered since the last _beginGeometryCount call.

Specified by:
_getFaceCount in interface IRenderSystem

_getBatchCount

public long _getBatchCount()
Reports the number of batches rendered since the last _beginGeometryCount call.

Specified by:
_getBatchCount in interface IRenderSystem

_getVertexCount

public long _getVertexCount()
Reports the number of vertices passed to the renderer since the last _beginGeometryCount call.

Specified by:
_getVertexCount in interface IRenderSystem

convertColourValue

public void convertColourValue(IColourValue colour,
                               LongPointer pDest)
Generates a packed data version of the passed in suitable for use as with this .

Specified by:
convertColourValue in interface IRenderSystem

getColourVertexElementType

public VertexElementType getColourVertexElementType()
Get the native VertexElementType for a compact 32-bit colour value for this rendersystem.

Specified by:
getColourVertexElementType in interface IRenderSystem

_convertProjectionMatrix

public void _convertProjectionMatrix(IMatrix4 matrix,
                                     IMatrix4 dest,
                                     boolean forGpuProgram)
Converts a uniform projection matrix to suitable for this render system.

Specified by:
_convertProjectionMatrix in interface IRenderSystem

_makeProjectionMatrix

public void _makeProjectionMatrix(IRadian fovy,
                                  float aspect,
                                  float nearPlane,
                                  float farPlane,
                                  IMatrix4 dest,
                                  boolean forGpuProgram)
Builds a perspective projection matrix suitable for this render system.

Specified by:
_makeProjectionMatrix in interface IRenderSystem

_makeProjectionMatrix

public void _makeProjectionMatrix(float left,
                                  float right,
                                  float bottom,
                                  float top,
                                  float nearPlane,
                                  float farPlane,
                                  IMatrix4 dest,
                                  boolean forGpuProgram)
Builds a perspective projection matrix for the case when frustum is not centered around camera.

Specified by:
_makeProjectionMatrix in interface IRenderSystem

_makeOrthoMatrix

public void _makeOrthoMatrix(IRadian fovy,
                             float aspect,
                             float nearPlane,
                             float farPlane,
                             IMatrix4 dest,
                             boolean forGpuProgram)
Builds an orthographic projection matrix suitable for this render system.

Specified by:
_makeOrthoMatrix in interface IRenderSystem

_applyObliqueDepthProjection

public void _applyObliqueDepthProjection(IMatrix4 matrix,
                                         IPlane plane,
                                         boolean forGpuProgram)
Update a perspective projection matrix to use 'oblique depth projection'.

Specified by:
_applyObliqueDepthProjection in interface IRenderSystem

_setPolygonMode

public void _setPolygonMode(PolygonMode level)
Sets how to rasterise triangles, as points, wireframe or solid polys.

Specified by:
_setPolygonMode in interface IRenderSystem

setStencilCheckEnabled

public void setStencilCheckEnabled(boolean enabled)
Turns stencil buffer checking on or off.

Specified by:
setStencilCheckEnabled in interface IRenderSystem

setStencilBufferParams

public void setStencilBufferParams(CompareFunction func,
                                   long refValue,
                                   long mask,
                                   StencilOperation stencilFailOp,
                                   StencilOperation depthFailOp,
                                   StencilOperation passOp,
                                   boolean twoSidedOperation)
This method allows you to set all the stencil buffer parameters in one call.

Specified by:
setStencilBufferParams in interface IRenderSystem

setVertexDeclaration

public void setVertexDeclaration(IVertexDeclaration decl)
Sets the current vertex declaration, ie the source of vertex data.

Specified by:
setVertexDeclaration in interface IRenderSystem

setVertexBufferBinding

public void setVertexBufferBinding(IVertexBufferBinding binding)
Sets the current vertex buffer binding state.

Specified by:
setVertexBufferBinding in interface IRenderSystem

setNormaliseNormals

public void setNormaliseNormals(boolean normalise)
Sets whether or not normals are to be automatically normalised.

Specified by:
setNormaliseNormals in interface IRenderSystem

_render

public void _render(IRenderOperation op)
Render something to the active viewport. Low-level rendering interface to perform rendering operations. Unlikely to be used directly by client applications, since the and various support classes will be responsible for calling this method. Can only be called between _beginScene and _endScene

Specified by:
_render in interface IRenderSystem

getCapabilities

public IRenderSystemCapabilities getCapabilities()
Gets the capabilities of the render system.

Specified by:
getCapabilities in interface IRenderSystem

getDriverVersion

public IDriverVersion getDriverVersion()
Returns the driver version.

Specified by:
getDriverVersion in interface IRenderSystem

bindGpuProgram

public void bindGpuProgram(IGpuProgram prg)
Binds a given (but not the parameters).

Specified by:
bindGpuProgram in interface IRenderSystem

bindGpuProgramParameters

public void bindGpuProgramParameters(GpuProgramType gptype,
                                     IGpuProgramParametersSharedPtr params)
Bind Gpu program parameters.

Specified by:
bindGpuProgramParameters in interface IRenderSystem

bindGpuProgramPassIterationParameters

public void bindGpuProgramPassIterationParameters(GpuProgramType gptype)
Only binds Gpu program parameters used for passes that have more than one iteration rendering

Specified by:
bindGpuProgramPassIterationParameters in interface IRenderSystem

unbindGpuProgram

public void unbindGpuProgram(GpuProgramType gptype)
Unbinds GpuPrograms of a given GpuProgramType.

Specified by:
unbindGpuProgram in interface IRenderSystem

isGpuProgramBound

public boolean isGpuProgramBound(GpuProgramType gptype)
Returns whether or not a Gpu program of the given type is currently bound.

Specified by:
isGpuProgramBound in interface IRenderSystem

setClipPlanes

public void setClipPlanes(IPlaneList clipPlanes)
Sets the user clipping region.

Specified by:
setClipPlanes in interface IRenderSystem

addClipPlane

public void addClipPlane(IPlane p)
Add a user clipping plane.

Specified by:
addClipPlane in interface IRenderSystem

addClipPlane

public void addClipPlane(float A,
                         float B,
                         float C,
                         float D)
Add a user clipping plane.

Specified by:
addClipPlane in interface IRenderSystem

resetClipPlanes

public void resetClipPlanes()
Clears the user clipping region.

Specified by:
resetClipPlanes in interface IRenderSystem

_initRenderTargets

public void _initRenderTargets()
Utility method for initialising all render targets attached to this rendering system.

Specified by:
_initRenderTargets in interface IRenderSystem

_notifyCameraRemoved

public void _notifyCameraRemoved(ICamera cam)
Utility method to notify all render targets that a camera has been removed, in case they were referring to it as their viewer.

Specified by:
_notifyCameraRemoved in interface IRenderSystem

_updateAllRenderTargets

public void _updateAllRenderTargets(boolean swapBuffers)
Internal method for updating all render targets attached to this rendering system.

Specified by:
_updateAllRenderTargets in interface IRenderSystem

_swapAllRenderTargetBuffers

public void _swapAllRenderTargetBuffers(boolean waitForVsync)
Internal method for swapping all the buffers on all render targets, if _updateAllRenderTargets was called with a 'false' parameter.

Specified by:
_swapAllRenderTargetBuffers in interface IRenderSystem

setInvertVertexWinding

public void setInvertVertexWinding(boolean invert)
Sets whether or not vertex windings set should be inverted; this can be important for rendering reflections.

Specified by:
setInvertVertexWinding in interface IRenderSystem

setScissorTest

public void setScissorTest(boolean enabled,
                           int left,
                           int top,
                           int right,
                           int bottom)
Sets the 'scissor region' ie the region of the target in which rendering can take place.

Specified by:
setScissorTest in interface IRenderSystem

clearFrameBuffer

public void clearFrameBuffer(long buffers,
                             IColourValue colour,
                             float depth,
                             int stencil)
Clears one or more frame buffers on the active render target.

Specified by:
clearFrameBuffer in interface IRenderSystem

getHorizontalTexelOffset

public float getHorizontalTexelOffset()
Returns the horizontal texel offset value required for mapping texel origins to pixel origins in this rendersystem.

Specified by:
getHorizontalTexelOffset in interface IRenderSystem

getVerticalTexelOffset

public float getVerticalTexelOffset()
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this rendersystem.

Specified by:
getVerticalTexelOffset in interface IRenderSystem

getMinimumDepthInputValue

public float getMinimumDepthInputValue()
Gets the minimum (closest) depth value to be used when rendering using identity transforms.

Specified by:
getMinimumDepthInputValue in interface IRenderSystem

getMaximumDepthInputValue

public float getMaximumDepthInputValue()
Gets the maximum (farthest) depth value to be used when rendering using identity transforms.

Specified by:
getMaximumDepthInputValue in interface IRenderSystem

setCurrentPassIterationCount

public void setCurrentPassIterationCount(int count)
set the current multi pass count value. This must be set prior to calling if multiple renderings of the same pass state are required.

Specified by:
setCurrentPassIterationCount in interface IRenderSystem

setDeriveDepthBias

public void setDeriveDepthBias(boolean derive,
                               float baseValue,
                               float multiplier,
                               float slopeScale)
Tell the render system whether to derive a depth bias on its own based on the values passed to it in setCurrentPassIterationCount. The depth bias set will be baseValue + iteration * multiplier

Specified by:
setDeriveDepthBias in interface IRenderSystem

addListener

public void addListener(IRenderSystem.IListener l)
Adds a listener to the custom events that this render system can raise.

Specified by:
addListener in interface IRenderSystem

removeListener

public void removeListener(IRenderSystem.IListener l)
Remove a listener to the custom events that this render system can raise.

Specified by:
removeListener in interface IRenderSystem

getRenderSystemEvents

public IStringVector getRenderSystemEvents()
Gets a list of the rendersystem specific events that this rendersystem can raise.

Specified by:
getRenderSystemEvents in interface IRenderSystem

preExtraThreadsStarted

public void preExtraThreadsStarted()
Tell the rendersystem to perform any prep tasks it needs to directly before other threads which might access the rendering API are registered.

Specified by:
preExtraThreadsStarted in interface IRenderSystem

postExtraThreadsStarted

public void postExtraThreadsStarted()
Specified by:
postExtraThreadsStarted in interface IRenderSystem

registerThread

public void registerThread()
Register the an additional thread which may make calls to rendersystem-related objects.

Specified by:
registerThread in interface IRenderSystem

unregisterThread

public void unregisterThread()
Unregister an additional thread which may make calls to rendersystem-related objects.

Specified by:
unregisterThread in interface IRenderSystem


Copyright © 2007 netAllied GmbH. All Rights Reserved.