package.path = package.path .. ";./assets/scripts/?.lua"
require "luascape.render"
require "luascape.graphics"
require "luascape.objects"
require "luascape.scene"
require "materials"
require "tinyandbig"

function initMaterial(levelRenderPass, shader)
  local shadowLight = Node()
  local shadowMapPass = materials.getShadowMapRenderPass(levelRenderPass)
  if (shadowMapPass and shadowMapPass.light) then
    shadowLight = shadowMapPass.light
  end
  local shaderProgramState = graphics.createShaderProgramState(
    "tiny_vp.cg", {
      ModelViewProjectionMatrixUniform(),
      ModelMatrixUniform(),
    },
    "tiny_fp.cg", {
    }                   
  )
  shader.shaderProgramState = shaderProgramState

  local shadowTexture = materials.getBlurredShadowTexture(levelRenderPass)
  shader:getOrCreateTextureState():setTexture(1, shadowTexture)
  
  shader:getOrCreateAlphaBlendState().enabled = false
end

function updateMaterial(levelRenderPass, shader)

end

