Class: Mittsu::OpenGLMeshLambertMaterial

Inherits:
OpenGLMeshBasicMaterial show all
Defined in:
lib/mittsu/renderers/opengl/materials/opengl_mesh_lambert_material.rb

Instance Attribute Summary

Attributes inherited from OpenGLMaterial

#shader, #shadow_pass, #uniforms_list

Instance Method Summary collapse

Methods inherited from OpenGLMaterial

#clear_custom_attributes, #custom_attributes_dirty?, #init, #initialize, #needs_camera_position_uniform?, #needs_face_normals?, #set

Constructor Details

This class inherits a constructor from Mittsu::OpenGLMaterial

Instance Method Details

#init_shaderObject



21
22
23
# File 'lib/mittsu/renderers/opengl/materials/opengl_mesh_lambert_material.rb', line 21

def init_shader
  @shader = ShaderLib.create_shader(shader_id)
end

#needs_lights?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/mittsu/renderers/opengl/materials/opengl_mesh_lambert_material.rb', line 17

def needs_lights?
  true
end

#needs_view_matrix_uniform?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/mittsu/renderers/opengl/materials/opengl_mesh_lambert_material.rb', line 13

def needs_view_matrix_uniform?
  true
end

#refresh_uniforms(uniforms) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/mittsu/renderers/opengl/materials/opengl_mesh_lambert_material.rb', line 3

def refresh_uniforms(uniforms)
  super

  uniforms['emissive'].value = @material.emissive

  if @material.wrap_around
    uniforms['wrapRGB'].value.copy(@material.wrap_rgb)
  end
end

#shader_idObject



25
26
27
# File 'lib/mittsu/renderers/opengl/materials/opengl_mesh_lambert_material.rb', line 25

def shader_id
  :lambert
end