Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
FullMaterial.h
Go to the documentation of this file.
1#pragma once
2
4#include "SDL/sdl_interface.h"
5
6#include <memory>
7
8namespace ph
9{
10
11class SurfaceMaterial;
12class VolumeMaterial;
13
14// TODO: volume material
15
16class FullMaterial final : public Material
17{
18public:
20 explicit FullMaterial(const std::shared_ptr<SurfaceMaterial>& surfaceMaterial);
21
22 void genBehaviors(const CookingContext& ctx, PrimitiveMetadata& metadata) const override;
23
24private:
25 std::shared_ptr<SurfaceMaterial> m_surfaceMaterial;
26 std::shared_ptr<VolumeMaterial> m_interiorMaterial;
27 std::shared_ptr<VolumeMaterial> m_exteriorMaterial;
28
29public:
31 {
32 ClassType clazz("full");
33 clazz.docName("Full Material");
34 clazz.description("A material model that combines surface and volume properties.");
35 clazz.baseOn<Material>();
36
37 TSdlReference<SurfaceMaterial, OwnerType> surfaceMaterial("surface", &OwnerType::m_surfaceMaterial);
38 surfaceMaterial.description("A surface material.");
39 surfaceMaterial.optional();
40 clazz.addField(surfaceMaterial);
41
42 TSdlReference<VolumeMaterial, OwnerType> interiorMaterial("interior", &OwnerType::m_interiorMaterial);
43 interiorMaterial.description("A volume material describing the inside of the surface.");
44 interiorMaterial.optional();
45 clazz.addField(interiorMaterial);
46
47 TSdlReference<VolumeMaterial, OwnerType> exteriorMaterial("exterior", &OwnerType::m_exteriorMaterial);
48 exteriorMaterial.description("A volume material describing the outside of the surface.");
49 exteriorMaterial.optional();
50 clazz.addField(exteriorMaterial);
51
52 return clazz;
53 }
54};
55
56}// end namespace ph
Information about the world being cooked.
Definition CookingContext.h:24
Definition FullMaterial.h:17
FullMaterial()
Definition FullMaterial.cpp:15
void genBehaviors(const CookingContext &ctx, PrimitiveMetadata &metadata) const override
Definition FullMaterial.cpp:28
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< FullMaterial >)
Definition FullMaterial.h:30
Definition Material.h:17
Collection of attached components to a primitive. This type effectively "glues" various components th...
Definition PrimitiveMetadata.h:22
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
TSdlReference & optional()
Definition TSdlReference.ipp:214
TSdlReference & description(std::string descriptionStr)
Definition TSdlReference.ipp:206
The root for all renderer implementations.
Definition EEngineProject.h:6