Sha256: 71cb8003072ff606b8e73d5d209c988d1d27e40870e8222acb72171288683582
Contents?: true
Size: 876 Bytes
Versions: 16
Compression:
Stored size: 876 Bytes
Contents
module Mittsu class OpenGLLightRenderer attr_accessor :lights_need_update, :cache LIGHT_CLASSES = [ AmbientLight, DirectionalLight, PointLight, SpotLight, HemisphereLight ] LIGHT_TYPES = LIGHT_CLASSES.map { |klass| klass::TYPE } def initialize(renderer) @renderer = renderer @lights_need_update = true @cache = {} LIGHT_CLASSES.each { |klass| @cache[klass::TYPE] = klass::Cache.new } end def setup(lights) @cache.values.each(&:reset) lights.each do |light| next if light.only_shadow light.setup(self) end LIGHT_CLASSES.each do |klass| cache = @cache[klass::TYPE] klass.null_remaining_lights(cache) end @lights_need_update = false end def reset @lights_need_update = true end end end
Version data entries
16 entries across 16 versions & 1 rubygems