11 #ifndef hifi_LightPayload_h
12 #define hifi_LightPayload_h
15 #include <graphics/Light.h>
16 #include <render/Item.h>
17 #include "LightStage.h"
18 #include "TextureCache.h"
22 using Payload = render::Payload<LightPayload>;
23 using Pointer = Payload::DataPointer;
27 void render(RenderArgs* args);
29 graphics::LightPointer editLight() { _needUpdate =
true;
return _light; }
30 render::Item::Bound& editBound() { _needUpdate =
true;
return _bound; }
32 void setVisible(
bool visible) { _isVisible = visible; }
33 bool isVisible()
const {
return _isVisible; }
36 graphics::LightPointer _light;
37 render::Item::Bound _bound;
38 LightStagePointer _stage;
39 LightStage::Index _index { LightStage::INVALID_INDEX };
40 bool _needUpdate {
true };
41 bool _isVisible{
true };
45 template <>
const ItemKey payloadGetKey(
const LightPayload::Pointer& payload);
46 template <>
const Item::Bound payloadGetBound(
const LightPayload::Pointer& payload, RenderArgs* args);
47 template <>
void payloadRender(
const LightPayload::Pointer& payload, RenderArgs* args);
50 class KeyLightPayload {
52 using Payload = render::Payload<KeyLightPayload>;
53 using Pointer = Payload::DataPointer;
57 void render(RenderArgs* args);
59 graphics::LightPointer editLight() { _needUpdate =
true;
return _light; }
60 render::Item::Bound& editBound() { _needUpdate =
true;
return _bound; }
62 void setVisible(
bool visible) { _isVisible = visible; }
63 bool isVisible()
const {
return _isVisible; }
67 NetworkTexturePointer _ambientTexture;
68 QString _ambientTextureURL;
69 bool _pendingAmbientTexture {
false };
72 graphics::LightPointer _light;
73 render::Item::Bound _bound;
74 LightStagePointer _stage;
75 LightStage::Index _index { LightStage::INVALID_INDEX };
76 bool _needUpdate {
true };
77 bool _isVisible {
true };
81 template <>
const ItemKey payloadGetKey(
const KeyLightPayload::Pointer& payload);
82 template <>
const Item::Bound payloadGetBound(
const KeyLightPayload::Pointer& payload, RenderArgs* args);
83 template <>
void payloadRender(
const KeyLightPayload::Pointer& payload, RenderArgs* args);