BBMOD_BaseRenderer

A constructor defined in BBMOD_BaseRenderer.gml

Implements BBMOD_IDestructible

new BBMOD_BaseRenderer()

Description

Base struct for renderers. Renderers execute render commands created with method render.

Properties

Name Description
ButtonSelect The mouse button used to select instances when edit mode is enabled. Default value is mb_left.
EditMode If true then edit mode is enabled. Default value is false.
EnableMousepick If true then mousepicking of gizmo and instances is enabled. Default value is true.
EnableSSAO Enables screen-space ambient occlusion. This requires the depth buffer. Defaults to false. Enabling this requires the SSAO submodule!
EnableShadows Enables rendering into a shadowmap in the shadows render pass. Defauls to false.
Gizmo A gizmo for transforming instances when BBMOD_BaseRenderer.EditMode is enabled. This is by default undefined.
Height The height of the renderer on the screen. If undefined then the window height is used. Default value is undefined.
InstanceHighlightColor Outline color of instances selected by gizmo. Default value is BBMOD_C_ORANGE.
KeyMultiSelect The keyboard key used to add/remove instances from multiple selection when edit mode is enabled. Default value is vk_shift.
PostProcessor Handles post-processing effects if isn't undefined and BBMOD_BaseRenderer.UseAppSurface is enabled. Default value is undefined.
RenderInstanceIDs If true then rendering of instance IDs into an off-screen surface is enabled. This must be enabled if you would like to use method BBMOD_BaseRenderer.get_instance_id for mouse-picking instances. Default value is false.
RenderScale Resolution multiplier for the application_surface. BBMOD_BaseRenderer.UseAppSurface must be enabled for this to have any effect. Defaults to 1. Use lower values to improve framerate.
Renderables An array of renderable objects and structs. These are automatically rendered in BBMOD_BaseRenderer.render.
SSAOAngleBias SSAO angle bias in radians. Default value is 0.03.
SSAOBlurDepthRange Maximum depth difference over which can be SSAO samples blurred. Defaults to 2.
SSAODepthRange Maximum depth difference of SSAO samples. Samples farther away from the origin than this will not contribute to the effect. Default value is 10.
SSAOPower Strength of the SSAO effect. Should be greater than 0. Default value is 1.
SSAORadius Screen-space radius of SSAO. Default value is 16.
SSAOScale Resolution multiplier for SSAO surface. Defaults to 1.
SSAOSelfOcclusionBias Defaults to 0.01. Increase to fix self-occlusion.
ShadowmapNormalOffset When rendering shadows, offsets vertex position by its normal scaled by this value. Defaults to 1. Increasing the value can remove some artifacts but using too high value could make the objects appear flying above the ground.
UseAppSurface Set to true to enable the application_surface. Use method BBMOD_BaseRenderer.present to draw the application_surface to the screen. Defaults to false.
Width The width of the renderer on the screen. If undefined then the window width is used. Default value is undefined.
X The X position of the renderer on the screen. Default value is 0.
Y The Y position of the renderer on the screen. Default value is 0.

Methods

Name Description
add Adds a renderable object or struct to the renderer.
destroy Frees memory used by the struct.
get_height Retrieves the height of the renderer on the screen.
get_instance_id Retrieves an ID of an instance at given position on the screen.
get_render_height Retrieves the height of the renderer with BBMOD_BaseRenderer.RenderScale applied.
get_render_width Retrieves the width of the renderer with BBMOD_BaseRenderer.RenderScale applied.
get_width Retrieves the width of the renderer on the screen.
present Presents the rendered graphics on the screen, with post-processing applied (if BBMOD_BaseRenderer.PostProcessor is defined).
remove Removes a renderable object or a struct from the renderer.
render Renders all added renderables to the current render target.
set_position Changes the renderer's position on the screen.
set_rectangle Changes the renderer's position and size on the screen.
set_size Changes the renderer's size on the screen.
update Updates the renderer. This should be called in the Step event.

Child structs

BBMOD_DefaultRenderer, BBMOD_DeferredRenderer

Do you find this page helpful?

Copyright © 2024, BlueBurn. Built on January 21, 2024 using GMDoc.