baked_light_instance.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef BAKED_LIGHT_INSTANCE_H
  2. #define BAKED_LIGHT_INSTANCE_H
  3. #include "scene/3d/visual_instance.h"
  4. #include "scene/resources/baked_light.h"
  5. class BakedLightBaker;
  6. class BakedLightInstance : public VisualInstance {
  7. OBJ_TYPE(BakedLightInstance,VisualInstance);
  8. Ref<BakedLight> baked_light;
  9. protected:
  10. static void _bind_methods();
  11. public:
  12. RID get_baked_light_instance() const;
  13. void set_baked_light(const Ref<BakedLight>& baked_light);
  14. Ref<BakedLight> get_baked_light() const;
  15. virtual AABB get_aabb() const;
  16. virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const;
  17. BakedLightInstance();
  18. };
  19. class BakedLightSampler : public VisualInstance {
  20. OBJ_TYPE(BakedLightSampler,VisualInstance);
  21. public:
  22. enum Param {
  23. PARAM_RADIUS=VS::BAKED_LIGHT_SAMPLER_RADIUS,
  24. PARAM_STRENGTH=VS::BAKED_LIGHT_SAMPLER_STRENGTH,
  25. PARAM_ATTENUATION=VS::BAKED_LIGHT_SAMPLER_ATTENUATION,
  26. PARAM_DETAIL_RATIO=VS::BAKED_LIGHT_SAMPLER_DETAIL_RATIO,
  27. PARAM_MAX=VS::BAKED_LIGHT_SAMPLER_MAX
  28. };
  29. protected:
  30. RID base;
  31. float params[PARAM_MAX];
  32. int resolution;
  33. static void _bind_methods();
  34. public:
  35. virtual AABB get_aabb() const;
  36. virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const;
  37. void set_param(Param p_param,float p_value);
  38. float get_param(Param p_param) const;
  39. void set_resolution(int p_resolution);
  40. int get_resolution() const;
  41. BakedLightSampler();
  42. ~BakedLightSampler();
  43. };
  44. VARIANT_ENUM_CAST( BakedLightSampler::Param );
  45. #endif // BAKED_LIGHT_H