Class: Rendering::TintEffect

Inherits:
Object
  • Object
show all
Includes:
SinglePassEffect
Defined in:
lib/engine/rendering/post_processing/tint_effect.rb

Instance Attribute Summary

Attributes included from SinglePassEffect

#material

Attributes included from Effect

#enabled

Instance Method Summary collapse

Methods included from SinglePassEffect

#apply

Constructor Details

#initialize(color: [1.0, 1.0, 1.0], intensity: 0.5) ⇒ TintEffect

Returns a new instance of TintEffect.



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

def initialize(color: [1.0, 1.0, 1.0], intensity: 0.5)
  @material = Engine::Material.create(
    shader: Engine::Shader.for(
      'fullscreen_vertex.glsl',
      'post_process/tint_frag.glsl',
      source: :engine
    )
  )
  @material.set_vec4("tintColor", [color[0], color[1], color[2], intensity])
end