Render module¶
To use the entire render module, add the following line to your project file:
``require engine.render_core`` or ``require engine.core``
The render engine used in EdenSpark features an advanced multidraw indirect rendering pipeline with GPU culling for all geometry rendering. The render system gathers all nodes with Mesh ( LODSelector ) and sorts them by their material and mesh. After that, only the modified data is submitted to the GPU, which then performs GPU culling and gathers draw calls.
You should have at least one active Camera in your scene to render it.
Note
If you have more than one active camera in your scene, the scene will be rendered for all of them. Be careful and turn off the cameras you don’t need.
We provide a set of components to help you set up rendering in your scene:
ShadowSettings: Shadows are based on the cascaded shadow maps technique.
AmbientSettings: Ambient lights can be set either with a constant color or with a sky color.
Tonemap: Global color grading.
Sky: Allows you to set a material for the sky (e.g., a skybox, a panorama image, or a procedural shader).
AntiAliasing: Anti-aliasing settings (FXAA, MSAA).
To use it:
let renderSettings = create_render_settings("RenderSettings")
// AntiAliasing and Tonemap are disabled by default
get_component(renderSettings) $(var settings : ShadowSettings?) {
// set up the shadows
}
get_component(renderSettings) $(var settings : AmbientSettings?) {
// set up the ambient color
}
get_component(renderSettings) $(var settings : Tonemap?) {
// set up the tonemap
}
get_component(renderSettings) $(var settings : AntiAliasing?) {
// set up anti-aliasing
}
get_component(renderSettings) $(var settings : Sky?) {
// set up the sky
}
To add lighting to your scenes, you can use the following light sources:
DirectionalLight: Represents a directional light, or sunlight; it emits light in a single direction.
SpotLight: Represents a spotlight source; it emits light in a cone shape.
PointLight: Represents a point source of light; it emits light in all directions within a certain radius.
Functions¶
- create_base_render_settings(name: string = "render_settings"): NodeId¶
Creates base render settings, without any components attached (such as ShadowSettings, Tonemap, etc.). It is useful for creating custom render settings.
- Arguments:
name : string
- create_render_settings(name: string = "render_settings"): NodeId¶
Creates default render settings with the preset chosen according to the project settings (either for HD Renderer or for Standard Renderer). Render settings allow you to configure shadows, sky, tonemapping, bloom and other rendering features. If you need a specific configuration, it may be better to use create_base_render_settings() and add only the needed components manually.
- Arguments:
name : string - the name of the render settings
- set_panorama(node: NodeId; texture: TextureId)¶
Set a panorama texture as the skybox
- Arguments:
- set_skybox(node: NodeId; cubemap: TextureId)¶
Set a skybox texture as the skybox. See CubeMap (SkyBox).