Module: Rendering::RenderPipeline

Defined in:
lib/engine/rendering/render_pipeline.rb

Class Method Summary collapse

Class Method Details

.add_instance(mesh_renderer) ⇒ Object



15
16
17
# File 'lib/engine/rendering/render_pipeline.rb', line 15

def self.add_instance(mesh_renderer)
  instance_renderers[[mesh_renderer.mesh, mesh_renderer.material]].add_instance(mesh_renderer)
end

.drawObject



5
6
7
8
9
10
11
12
13
# File 'lib/engine/rendering/render_pipeline.rb', line 5

def self.draw
  Engine::GameObject.mesh_renderers.each do |mesh_renderer|
    mesh_renderer.update(0)
  end

  instance_renderers.values.each do |renderer|
    renderer.draw_all
  end
end

.remove_instance(mesh_renderer) ⇒ Object



19
20
21
# File 'lib/engine/rendering/render_pipeline.rb', line 19

def self.remove_instance(mesh_renderer)
  instance_renderers[[mesh_renderer.mesh, mesh_renderer.material]].remove_instance(mesh_renderer)
end

.update_instance(mesh_renderer) ⇒ Object



23
24
25
# File 'lib/engine/rendering/render_pipeline.rb', line 23

def self.update_instance(mesh_renderer)
  instance_renderers[[mesh_renderer.mesh, mesh_renderer.material]].update_instance(mesh_renderer)
end