1
0

__BulbSystem.gml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // HDR references:
  2. // https://www.shadertoy.com/view/WdjSW3
  3. // https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
  4. // https://64.github.io/tonemapping/
  5. // http://slideshare.net/ozlael/hable-john-uncharted2-hdr-renderer
  6. // http://filmicgames.com/archives/75
  7. // http://filmicgames.com/archives/183
  8. // http://filmicgames.com/archives/190
  9. // http://imdoingitwrong.wordpress.com/2010/08/19/why-reinhard-desaturates-my-blacks-3/
  10. // http://mynameismjp.wordpress.com/2010/04/30/a-closer-look-at-tone-mapping/
  11. // http://renderwonk.com/publications/s2010-color-course/
  12. // https://mini.gmshaders.com/p/tonemaps
  13. // http://filmicworlds.com/blog/filmic-tonemapping-operators/
  14. #macro __BULB_ZFAR 1
  15. function __BulbSystem()
  16. {
  17. static _system = undefined;
  18. if (_system != undefined) return _system;
  19. __BulbTrace("Welcome to Bulb by Juju Adams! This is version " + BULB_VERSION + ", " + BULB_DATE);
  20. _system = {};
  21. with(_system)
  22. {
  23. try
  24. {
  25. var _ = surface_rgba16float;
  26. __BulbTrace("HDR available");
  27. __hdrAvailable = true;
  28. }
  29. catch(_error)
  30. {
  31. __BulbTrace("HDR not available");
  32. __hdrAvailable = false;
  33. }
  34. try
  35. {
  36. gpu_get_stencil_ref();
  37. __BulbTrace("GPU stencil functions available");
  38. __hasStencil = true;
  39. }
  40. catch(_error)
  41. {
  42. __BulbTrace("GPU stencil functions not available");
  43. __hasStencil = false;
  44. }
  45. }
  46. return _system;
  47. }