7 if (_doubleSided != state) {
14 if (_isRefractive != state) {
15 _isRefractive = state;
16 _needsNewShader =
true;
21 if (_receivesShadows != state) {
22 _receivesShadows = state;
23 _needsNewShader =
true;
28 if (_isStatic != state) {
30 _needsNewShader =
true;
35 if (_isInstanced != state) {
37 _needsNewShader =
true;
42 if (overrides()._ignoreTexDiffuseAlpha != state) {
43 overrides()._ignoreTexDiffuseAlpha = state;
44 _needsNewShader =
true;
49 if (_hardwareSkinning != state) {
50 _hardwareSkinning = state;
51 _needsNewShader =
true;
56 if (_texturesInFragmentStageOnly != state) {
57 _texturesInFragmentStageOnly = state;
58 _needsNewShader =
true;
63 if (overrides()._transparencyEnabled != state) {
64 overrides()._transparencyEnabled = state;
65 _transparencyUpdated =
true;
70 if (overrides()._useAlphaDiscard != state) {
71 overrides()._useAlphaDiscard = state;
72 _needsNewShader =
true;
78 _transparencyUpdated =
true;
82 if (_bumpMethod != newBumpMethod) {
83 _bumpMethod = newBumpMethod;
84 _needsNewShader =
true;
89 if (_shadingMode != mode) {
91 _needsNewShader =
true;
98 pt.put(entryName +
".colour.<xmlattr>.r",
baseColour().r);
99 pt.put(entryName +
".colour.<xmlattr>.g",
baseColour().g);
100 pt.put(entryName +
".colour.<xmlattr>.b",
baseColour().b);
101 pt.put(entryName +
".colour.<xmlattr>.a",
baseColour().a);
103 pt.put(entryName +
".emissive.<xmlattr>.r", emissive().r);
104 pt.put(entryName +
".emissive.<xmlattr>.g", emissive().g);
105 pt.put(entryName +
".emissive.<xmlattr>.b", emissive().b);
107 pt.put(entryName +
".ambient.<xmlattr>.r", ambient().r);
108 pt.put(entryName +
".ambient.<xmlattr>.g", ambient().g);
109 pt.put(entryName +
".ambient.<xmlattr>.b", ambient().b);
111 pt.put(entryName +
".specular.<xmlattr>.r", specular().r);
112 pt.put(entryName +
".specular.<xmlattr>.g", specular().g);
113 pt.put(entryName +
".specular.<xmlattr>.b", specular().b);
114 pt.put(entryName +
".specular.<xmlattr>.a", shininess());
116 pt.put(entryName +
".specular_factor", specGloss().x);
117 pt.put(entryName +
".glossiness_factor", specGloss().y);
119 pt.put(entryName +
".metallic", metallic());
121 pt.put(entryName +
".roughness", roughness());
131 pt.put(entryName +
".parallaxFactor", parallaxFactor());
133 pt.put(entryName +
".transparencyEnabled", overrides().transparencyEnabled());
146 shadingModeFile = shadingModeCrt;
149 shadingMode(shadingModeFile);
151 baseColour(
FColour4(pt.get<
F32>(entryName +
".colour.<xmlattr>.r", baseColour().r),
152 pt.get<
F32>(entryName +
".colour.<xmlattr>.g", baseColour().g),
153 pt.get<
F32>(entryName +
".colour.<xmlattr>.b", baseColour().b),
154 pt.get<
F32>(entryName +
".colour.<xmlattr>.a", baseColour().a)));
156 emissive(
FColour3(pt.get<
F32>(entryName +
".emissive.<xmlattr>.r", emissive().r),
157 pt.get<
F32>(entryName +
".emissive.<xmlattr>.g", emissive().g),
158 pt.get<
F32>(entryName +
".emissive.<xmlattr>.b", emissive().b)));
160 ambient(
FColour3(pt.get<
F32>(entryName +
".ambient.<xmlattr>.r", ambient().r),
161 pt.get<
F32>(entryName +
".ambient.<xmlattr>.g", ambient().g),
162 pt.get<
F32>(entryName +
".ambient.<xmlattr>.b", ambient().b)));
164 specular(
FColour3(pt.get<
F32>(entryName +
".specular.<xmlattr>.r", specular().r),
165 pt.get<
F32>(entryName +
".specular.<xmlattr>.g", specular().g),
166 pt.get<
F32>(entryName +
".specular.<xmlattr>.b", specular().b)));
168 shininess(pt.get<
F32>(entryName +
".specular.<xmlattr>.a", shininess()));
171 pt.get<
F32>(entryName +
".glossiness_factor", specGloss().y)));
173 metallic(pt.get<
F32>(entryName +
".metallic", metallic()));
175 roughness(pt.get<
F32>(entryName +
".roughness", roughness()));
177 parallaxFactor(pt.get<
F32>(entryName +
".parallaxFactor", parallaxFactor()));
179 receivesShadows(pt.get<
bool>(entryName +
".receivesShadows", receivesShadows()));
181 ignoreTexDiffuseAlpha(pt.get<
bool>(entryName +
".ignoreTexDiffuseAlpha", overrides().ignoreTexDiffuseAlpha()));
185 toggleTransparency(pt.get<
bool>(entryName +
".transparencyEnabled", overrides().transparencyEnabled()));
187 useAlphaDiscard(pt.get<
bool>(entryName +
".useAlphaDiscard", overrides().useAlphaDiscard()));
191 doubleSided(pt.get<
bool>(entryName +
".doubleSided", doubleSided()));
vec2< F32 > SpecularGlossiness
bool isRefractive() const noexcept
BumpMethod StringToBumpMethod(std::string_view name)
const char * BumpMethodToString(BumpMethod bumpMethod) noexcept
const char * ShadingModeToString(ShadingMode shadingMode) noexcept
ShadingMode StringToShadingMode(std::string_view name)
Handle console commands that start with a forward slash.
void receivesShadows(bool state) noexcept
void doubleSided(bool state) noexcept
void isRefractive(bool state) noexcept
void texturesInFragmentStageOnly(bool state) noexcept
void isInstanced(bool state) noexcept
void bumpMethod(BumpMethod newBumpMethod) noexcept
void ignoreTexDiffuseAlpha(bool state) noexcept
void hardwareSkinning(bool state) noexcept
void baseColour(const FColour4 &colour) noexcept
void saveToXML(const std::string &entryName, boost::property_tree::ptree &pt) const
void isStatic(bool state) noexcept
void loadFromXML(const std::string &entryName, const boost::property_tree::ptree &pt)
void toggleTransparency(bool state) noexcept
void shadingMode(ShadingMode mode) noexcept
void useAlphaDiscard(bool state) noexcept