3D rendering view. Includes the main view(s) and any auxiliary views, but not shadow cameras.
More...
Public Member Functions |
| View (Context *context) |
| Construct.
|
virtual | ~View () |
| Destruct.
|
bool | Define (RenderSurface *renderTarget, Viewport *viewport) |
| Define with rendertarget and viewport. Return true if successful.
|
void | Update (const FrameInfo &frame) |
| Update and cull objects and construct rendering batches.
|
void | Render () |
| Render batches.
|
Graphics * | GetGraphics () const |
| Return graphics subsystem.
|
Renderer * | GetRenderer () const |
| Return renderer subsystem.
|
Scene * | GetScene () const |
| Return scene.
|
Octree * | GetOctree () const |
| Return octree.
|
Camera * | GetCamera () const |
| Return camera.
|
RenderSurface * | GetRenderTarget () const |
| Return the rendertarget. 0 if using the backbuffer.
|
const PODVector< Drawable * > & | GetGeometries () const |
| Return geometry objects.
|
const PODVector< Drawable * > & | GetOccluders () const |
| Return occluder objects.
|
const PODVector< Light * > & | GetLights () const |
| Return lights.
|
const Vector< LightBatchQueue > & | GetLightQueues () const |
| Return light batch queues.
|
| Object (Context *context) |
| Construct.
|
virtual | ~Object () |
| Destruct. Clean up self from event sender & receiver structures.
|
virtual ShortStringHash | GetType () const =0 |
| Return type hash.
|
virtual const String & | GetTypeName () const =0 |
| Return type name.
|
virtual void | OnEvent (Object *sender, StringHash eventType, VariantMap &eventData) |
| Handle event.
|
void | SubscribeToEvent (StringHash eventType, EventHandler *handler) |
| Subscribe to an event that can be sent by any sender.
|
void | SubscribeToEvent (Object *sender, StringHash eventType, EventHandler *handler) |
| Subscribe to a specific sender's event.
|
void | UnsubscribeFromEvent (StringHash eventType) |
| Unsubscribe from an event.
|
void | UnsubscribeFromEvent (Object *sender, StringHash eventType) |
| Unsubscribe from a specific sender's event.
|
void | UnsubscribeFromEvents (Object *sender) |
| Unsubscribe from a specific sender's events.
|
void | UnsubscribeFromAllEvents () |
| Unsubscribe from all events.
|
void | UnsubscribeFromAllEventsExcept (const PODVector< StringHash > &exceptions, bool onlyUserData) |
| Unsubscribe from all events except those listed, and optionally only those with userdata (script registered events.)
|
void | SendEvent (StringHash eventType) |
| Send event to all subscribers.
|
void | SendEvent (StringHash eventType, VariantMap &eventData) |
| Send event with parameters to all subscribers.
|
Context * | GetContext () const |
| Return execution context.
|
Object * | GetSubsystem (ShortStringHash type) const |
| Return subsystem by type.
|
Object * | GetEventSender () const |
| Return active event sender. Null outside event handling.
|
EventHandler * | GetEventHandler () const |
| Return active event handler. Null outside event handling.
|
bool | HasSubscribedToEvent (StringHash eventType) const |
| Return whether has subscribed to an event without specific sender.
|
bool | HasSubscribedToEvent (Object *sender, StringHash eventType) const |
| Return whether has subscribed to a specific sender's event.
|
template<class T > |
T * | GetSubsystem () const |
| Template version of returning a subsystem.
|
| RefCounted () |
| Construct. Allocate the reference count structure and set an initial self weak reference.
|
virtual | ~RefCounted () |
| Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
|
void | AddRef () |
| Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
|
void | ReleaseRef () |
| Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
|
int | Refs () const |
| Return reference count.
|
int | WeakRefs () const |
| Return weak reference count.
|
RefCount * | RefCountPtr () |
| Return pointer to the reference count structure.
|
Private Member Functions |
| OBJECT (View) |
void | GetDrawables () |
| Query the octree for drawable objects.
|
void | GetBatches () |
| Construct batches from the drawable objects.
|
void | UpdateGeometries () |
| Update geometries and sort batches.
|
void | GetLitBatches (Drawable *drawable, LightBatchQueue &lightQueue, BatchQueue *alphaQueue, bool useLitBase) |
| Get pixel lit batches for a certain light and drawable.
|
void | ExecuteRenderPathCommands () |
| Execute render commands.
|
void | SetRenderTargets (const RenderPathCommand &command) |
| Set rendertargets for current render command.
|
void | SetTextures (const RenderPathCommand &command) |
| Set textures for current render command.
|
void | RenderQuad (const RenderPathCommand &command) |
| Perform a quad rendering command.
|
bool | CheckViewportRead (const RenderPathCommand &command) |
| Check if a command reads the rendered scene.
|
void | AllocateScreenBuffers () |
| Allocate needed screen buffers.
|
void | BlitFramebuffer (Texture2D *source, RenderSurface *destination, bool depthWrite) |
| Blit the viewport from one surface to another.
|
void | DrawFullscreenQuad (bool nearQuad) |
| Draw a fullscreen quad. Shaders and renderstates must have been set beforehand.
|
void | UpdateOccluders (PODVector< Drawable * > &occluders, Camera *camera) |
| Query for occluders as seen from a camera.
|
void | DrawOccluders (OcclusionBuffer *buffer, const PODVector< Drawable * > &occluders) |
| Draw occluders to occlusion buffer.
|
void | ProcessLight (LightQueryResult &query, unsigned threadIndex) |
| Query for lit geometries and shadow casters for a light.
|
void | ProcessShadowCasters (LightQueryResult &query, const PODVector< Drawable * > &drawables, unsigned splitIndex) |
| Process shadow casters' visibilities and build their combined view- or projection-space bounding box.
|
void | SetupShadowCameras (LightQueryResult &query) |
| Set up initial shadow camera view(s).
|
void | SetupDirLightShadowCamera (Camera *shadowCamera, Light *light, float nearSplit, float farSplit) |
| Set up a directional light shadow camera.
|
void | FinalizeShadowCamera (Camera *shadowCamera, Light *light, const IntRect &shadowViewport, const BoundingBox &shadowCasterBox) |
| Finalize shadow camera view after shadow casters and the shadow map are known.
|
void | QuantizeDirLightShadowCamera (Camera *shadowCamera, Light *light, const IntRect &shadowViewport, const BoundingBox &viewBox) |
| Quantize a directional light shadow camera view to eliminate swimming.
|
bool | IsShadowCasterVisible (Drawable *drawable, BoundingBox lightViewBox, Camera *shadowCamera, const Matrix3x4 &lightView, const Frustum &lightViewFrustum, const BoundingBox &lightViewFrustumBox) |
| Check visibility of one shadow caster.
|
IntRect | GetShadowMapViewport (Light *light, unsigned splitIndex, Texture2D *shadowMap) |
| Return the viewport for a shadow map split.
|
void | FindZone (Drawable *drawable) |
| Find and set a new zone for a drawable when it has moved.
|
Zone * | GetZone (Drawable *drawable) |
| Return the drawable's zone, or camera zone if it has override mode enabled.
|
unsigned | GetLightMask (Drawable *drawable) |
| Return the drawable's light mask, considering also its zone.
|
unsigned | GetShadowMask (Drawable *drawable) |
| Return the drawable's shadow mask, considering also its zone.
|
unsigned long long | GetVertexLightQueueHash (const PODVector< Light * > &vertexLights) |
| Return hash code for a vertex light queue.
|
Technique * | GetTechnique (Drawable *drawable, Material *material) |
| Return material technique, considering the drawable's LOD distance.
|
void | CheckMaterialForAuxView (Material *material) |
| Check if material should render an auxiliary view (if it has a camera attached.)
|
void | AddBatchToQueue (BatchQueue &queue, Batch &batch, Technique *tech, bool allowInstancing=true, bool allowShadows=true) |
| Choose shaders for a batch and add it to queue.
|
void | PrepareInstancingBuffer () |
| Prepare instancing buffer by filling it with all instance transforms.
|
void | SetupLightVolumeBatch (Batch &batch) |
| Set up a light volume rendering batch.
|
void | RenderShadowMap (const LightBatchQueue &queue) |
| Render a shadow map.
|
RenderSurface * | GetDepthStencil (RenderSurface *renderTarget) |
| Return the proper depth-stencil surface to use for a rendertarget.
|
3D rendering view. Includes the main view(s) and any auxiliary views, but not shadow cameras.