Module: Rendering::SinglePassEffect

Includes:
Effect
Included in:
DepthDebugEffect, TintEffect
Defined in:
lib/engine/rendering/post_processing/single_pass_effect.rb

Instance Attribute Summary collapse

Attributes included from Effect

#enabled

Instance Method Summary collapse

Instance Attribute Details

#materialObject (readonly)

Returns the value of attribute material.



7
8
9
# File 'lib/engine/rendering/post_processing/single_pass_effect.rb', line 7

def material
  @material
end

Instance Method Details

#apply(input_rt, output_rt, screen_quad) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/engine/rendering/post_processing/single_pass_effect.rb', line 9

def apply(input_rt, output_rt, screen_quad)
  output_rt.bind
  Engine::GL.Clear(Engine::GL::COLOR_BUFFER_BIT)
  Engine::GL.Disable(Engine::GL::DEPTH_TEST)

  material.set_runtime_texture("depthTexture", PostProcessingEffect.depth_texture)
  screen_quad.draw(material, input_rt.color_texture)
  output_rt
end