Class: Mittsu::ShaderLib

Inherits:
Object
  • Object
show all
Defined in:
lib/mittsu/renderers/shaders/shader_lib.rb

Class Method Summary collapse

Class Method Details

.[](id) ⇒ Object



39
40
41
# File 'lib/mittsu/renderers/shaders/shader_lib.rb', line 39

def self.[](id)
  SHADER_LIB_HASH[id]
end

.create_shader(id, options = {}) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/mittsu/renderers/shaders/shader_lib.rb', line 30

def self.create_shader(id, options={})
  shader = self[id]
  {
    uniforms: UniformsUtils.clone(shader.uniforms),
    vertex_shader: shader.vertex_shader,
    fragment_shader: shader.fragment_shader
  }.merge(options)
end