Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
AIesAttenuatedLight.h
Go to the documentation of this file.
1#pragma once
2
6#include "SDL/sdl_interface.h"
9
10#include <memory>
11
12namespace ph
13{
14
16{
17public:
18 PreCookReport preCook(const CookingContext& ctx) const override;
19 TransientVisualElement cook(const CookingContext& ctx, const PreCookReport& report) const override;
20
21 void setSource(const std::shared_ptr<ALight>& source);
22 void setIesFile(const Path& iesFile);
23
24private:
25 TransientVisualElement getSourceVisualElement(const CookingContext& ctx) const;
26 std::shared_ptr<TTexture<math::Spectrum>> loadAttenuationTexture() const;
27
28 std::shared_ptr<ALight> m_source;
29 ResourceIdentifier m_iesFile;
30
31public:
33 {
34 ClassType clazz("ies-attenuated-light");
35 clazz.docName("IES-Attenuated Light Actor");
36 clazz.description(
37 "Attenuating energy emitting strength of a light with an IES profile.");
38 clazz.baseOn<ALight>();
39
40 TSdlReference<ALight, OwnerType> source("source", &OwnerType::m_source);
41 source.description("The light source that will be attenuated.");
42 source.optional();
43 clazz.addField(source);
44
45 TSdlResourceIdentifier<OwnerType> iesFile("ies-file", &OwnerType::m_iesFile);
46 iesFile.description("The IES file.");
47 iesFile.required();
48 clazz.addField(iesFile);
49
50 return clazz;
51 }
52};
53
54}// end namespace ph
Definition AIesAttenuatedLight.h:16
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< AIesAttenuatedLight >)
Definition AIesAttenuatedLight.h:32
TransientVisualElement cook(const CookingContext &ctx, const PreCookReport &report) const override
Definition AIesAttenuatedLight.cpp:48
void setIesFile(const Path &iesFile)
Definition AIesAttenuatedLight.cpp:146
void setSource(const std::shared_ptr< ALight > &source)
Definition AIesAttenuatedLight.cpp:141
PreCookReport preCook(const CookingContext &ctx) const override
Cooking supplemental data before cook(). This method allows user to specify additional configurations...
Definition AIesAttenuatedLight.cpp:23
Definition ALight.h:10
Information about the world being cooked.
Definition CookingContext.h:24
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
Definition PreCookReport.h:13
An general identifier that points to some resource. This is the most general form of a resource ident...
Definition ResourceIdentifier.h:20
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
A value that points to a SDL resource.
Definition TSdlReference.h:21
A field class that binds a resource identifier member. Though the member type that is binded by defau...
Definition TSdlResourceIdentifier.h:28
TSdlValue & description(std::string descriptionStr)
Definition TSdlValue.ipp:95
TSdlValue & required()
Definition TSdlValue.ipp:117
A group of cooked data that represent the visible part of the scene at a specific time....
Definition TransientVisualElement.h:19
The root for all renderer implementations.
Definition EEngineProject.h:6