postprocess.script 756 B

1234567891011121314151617181920
  1. go.property("invert", resource.material("/example/materials/invert.material"))
  2. go.property("passthrough", resource.material("/example/materials/passthrough.material"))
  3. go.property("scanlines", resource.material("/example/materials/scanlines.material"))
  4. function init(self)
  5. msg.post(".", "acquire_input_focus")
  6. go.set("#quad", "material", self.invert)
  7. end
  8. function on_input(self, action_id, action)
  9. if action_id == hash("key_1") then
  10. go.set("#quad", "material", self.invert)
  11. elseif action_id == hash("key_2") then
  12. go.set("#quad", "material", self.scanlines)
  13. local w, h = window.get_size()
  14. go.set("#quad", "resolution", vmath.vector4(w, h, 0, 0))
  15. elseif action_id == hash("key_3") then
  16. go.set("#quad", "material", self.passthrough)
  17. end
  18. end