class Eagle::Renderer3D

Overview

The forward renderer: shadow pass, sky, opaque meshes, then transparent meshes.

The scene tree drives it through Scene3D.render. Call #render directly to draw meshes without nodes, for tools and special effects.

Defined in:

eagle/graphics3d/renderer3d.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(environment : Environment = Environment.new) #

Creates a renderer.


Instance Method Detail

def dispose : Nil #

Frees GPU resources.


def draw_calls : Int32 #

def environment : Environment #

The settings used when rendering.


def environment=(environment : Environment) #

The settings used when rendering.


def light_matrix : Mat4 #

The light-space matrix used for shadows.


def render(camera : CameraView, items : Array(DrawItem), lights : Array(LightData), target_size : Vec2, flip_y : Bool = false, clear : Bool = true) : Nil #

Renders items lit by lights from camera into the current target. Set flip_y when rendering into a Canvas, and clear to clear color and depth first.


def shadow_texture : Texture | Nil #

The shadow map from the last render, for debugging.


def stats_draw_calls : Int32 #

Draw calls in the last render.