Sha256: 105858956690ba424646dab209d6d2f9e2b038fdd521e1eb516515fbff5658d0

Contents?: true

Size: 645 Bytes

Versions: 11

Compression:

Stored size: 645 Bytes

Contents

module Mittsu
  class PointCloudMaterial
    def refresh_uniforms(uniforms)
      uniforms['psColor'].value = color
      uniforms['opacity'].value = opacity
      uniforms['size'].value = size
      # uniforms['scale'].value = _canvas.height / 2.0 # TODO get window height?

      uniforms['map'].value = map

      if !map.nil?
        offset = material.map.offset
        repeat = material.map.repeat

        uniforms['offsetRepeat'].value.set(offset.x, offset.y, repeat.x, repeat.y)
      end
    end

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

    def shader_id
      :particle_basic
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mittsu-0.4.1 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.4.0 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.3.3 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.3.2 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.3.1 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.3.0 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.2.4 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.2.3 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.2.2 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.2.1 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb
mittsu-0.2.0 lib/mittsu/renderers/opengl/materials/point_cloud_material.rb