19 SdlEnumType sdlEnum(
"surface-material-mix-mode");
20 sdlEnum.description(
"Specify how surface materials are mixed.");
22 sdlEnum.addEntry(EnumType::Lerp,
"lerp");
35 std::shared_ptr<SurfaceMaterial> material0,
36 std::shared_ptr<SurfaceMaterial> material1);
39 void setFactor(std::shared_ptr<Image> factor);
43 std::shared_ptr<SurfaceMaterial> m_material0;
44 std::shared_ptr<SurfaceMaterial> m_material1;
45 std::shared_ptr<Image> m_factor;
50 ClassType clazz(
"binary-mixed-surface");
51 clazz.docName(
"Binary Mixed Surface");
52 clazz.description(
"Mixing two surface materials in various ways.");
56 mode.description(
"Specify how two materials are mixed.");
62 material0.
description(
"The first material that participates the mixing process.");
64 clazz.addField(material0);
67 material1.
description(
"The second material that participates the mixing process.");
69 clazz.addField(material1);
73 "Factor that controls the contribution from each material. Basically, the final material "
74 "would be \"material-0 * factor + material-1 * (1 - factor)\".");
76 clazz.addField(factor);
Definition BinaryMixedSurfaceMaterial.h:28
void setMaterials(std::shared_ptr< SurfaceMaterial > material0, std::shared_ptr< SurfaceMaterial > material1)
Definition BinaryMixedSurfaceMaterial.cpp:61
void setMode(ESurfaceMaterialMixMode mode)
Definition BinaryMixedSurfaceMaterial.cpp:56
void genSurface(const CookingContext &ctx, SurfaceBehavior &behavior) const override
Definition BinaryMixedSurfaceMaterial.cpp:17
void setFactor(real factor)
Definition BinaryMixedSurfaceMaterial.cpp:69
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< BinaryMixedSurfaceMaterial >)
Definition BinaryMixedSurfaceMaterial.h:48
Information about the world being cooked.
Definition CookingContext.h:24
Definition SurfaceBehavior.h:15
Definition SurfaceMaterial.h:15
Definition TSdlEnumField.h:23
SDL enum implementation with common features. Enum value and string mapping are done in a brute-force...
Definition TSdlGeneralEnum.h:26
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 & required()
Definition TSdlReference.ipp:228
TSdlReference & description(std::string descriptionStr)
Definition TSdlReference.ipp:206
The root for all renderer implementations.
Definition EEngineProject.h:6
ESurfaceMaterialMixMode
Definition BinaryMixedSurfaceMaterial.h:13
#define PH_DEFINE_SDL_ENUM(...)
Define a SDL enum with function-like syntax.
Definition sdl_interface.h:142