Sha256: 082044a9e1faaf8a3d46a1d304a22c5a50054c1d9b953f053a7944f1b0ac010c

Contents?: true

Size: 776 Bytes

Versions: 16

Compression:

Stored size: 776 Bytes

Contents

require 'mittsu/renderers/opengl/materials/opengl_material_basics'

module Mittsu
  class MeshPhongMaterial
    include OpenGLMaterialBasics

    def needs_face_normals?
      false
    end

    def refresh_uniforms(uniforms)
      refresh_uniforms_basic(uniforms)

      uniforms['shininess'].value = shininess

      uniforms['emissive'].value = emissive
      uniforms['specular'].value = specular

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

    def needs_camera_position_uniform?
      true
    end

    def needs_view_matrix_uniform?
      true
    end

    def needs_lights?
      true
    end

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

    def shader_id
      :phong
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mittsu-0.4.1 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.4.0 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.3.3 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.3.2 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.3.1 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.3.0 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.2.4 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.2.3 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.2.2 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.2.1 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.2.0 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.1.7 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.1.6 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.1.5 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.1.4 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb
mittsu-0.1.3 lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb