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
3
#include "
Actor/Material/Material.h
"
4
#include "
SDL/sdl_interface.h
"
5
6
#include <memory>
7
8
namespace
ph
9
{
10
11
class
SurfaceMaterial;
12
class
VolumeMaterial;
13
14
// TODO: volume material
15
16
class
FullMaterial
final :
public
Material
17
{
18
public
:
19
FullMaterial
();
20
explicit
FullMaterial
(
const
std::shared_ptr<SurfaceMaterial>& surfaceMaterial);
21
22
void
genBehaviors
(
const
CookingContext
& ctx,
PrimitiveMetadata
& metadata)
const override
;
23
24
private
:
25
std::shared_ptr<SurfaceMaterial> m_surfaceMaterial;
26
std::shared_ptr<VolumeMaterial> m_interiorMaterial;
27
std::shared_ptr<VolumeMaterial> m_exteriorMaterial;
28
29
public
:
30
PH_DEFINE_SDL_CLASS
(
TSdlOwnerClass<FullMaterial>
)
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
Material.h
ph::CookingContext
Information about the world being cooked.
Definition
CookingContext.h:24
ph::FullMaterial
Definition
FullMaterial.h:17
ph::FullMaterial::FullMaterial
FullMaterial()
Definition
FullMaterial.cpp:15
ph::FullMaterial::genBehaviors
void genBehaviors(const CookingContext &ctx, PrimitiveMetadata &metadata) const override
Definition
FullMaterial.cpp:28
ph::FullMaterial::PH_DEFINE_SDL_CLASS
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< FullMaterial >)
Definition
FullMaterial.h:30
ph::Material
Definition
Material.h:17
ph::PrimitiveMetadata
Collection of attached components to a primitive. This type effectively "glues" various components th...
Definition
PrimitiveMetadata.h:22
ph::TSdlOwnerClass
SDL binding type for a canonical SDL resource class.
Definition
TSdlOwnerClass.h:23
ph::TSdlReference
A value that points to a SDL resource.
Definition
TSdlReference.h:21
ph::TSdlReference::optional
TSdlReference & optional()
Definition
TSdlReference.ipp:214
ph::TSdlReference::description
TSdlReference & description(std::string descriptionStr)
Definition
TSdlReference.ipp:206
ph
The root for all renderer implementations.
Definition
EEngineProject.h:6
sdl_interface.h
Source
Actor
Material
FullMaterial.h
Generated by
1.11.0