mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 18:06:57 +02:00
comment about bit mapping in GraphicsScriptingInterface
This commit is contained in:
parent
9cb29bb3a3
commit
5f0cbe9799
2 changed files with 18 additions and 0 deletions
|
@ -520,84 +520,98 @@ namespace scriptable {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// See the mappings in ProceduralMatericalCache.h
|
// See the mappings in ProceduralMatericalCache.h
|
||||||
|
// SHADE_VAL_BIT = graphics::MaterialKey::FlagBit::UNLIT_VAL_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::UNLIT_VAL_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::UNLIT_VAL_BIT)) {
|
||||||
obj.setProperty("shade", FALLTHROUGH);
|
obj.setProperty("shade", FALLTHROUGH);
|
||||||
} else if (material.key._flags[graphics::MaterialKey::UNLIT_VAL_BIT]) {
|
} else if (material.key._flags[graphics::MaterialKey::UNLIT_VAL_BIT]) {
|
||||||
obj.setProperty("shade", vec3ColorToScriptValue(engine, material.shade));
|
obj.setProperty("shade", vec3ColorToScriptValue(engine, material.shade));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SHADE_MAP_BIT = graphics::MaterialKey::FlagBit::ROUGHNESS_MAP_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::ROUGHNESS_MAP_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::ROUGHNESS_MAP_BIT)) {
|
||||||
obj.setProperty("shadeMap", FALLTHROUGH);
|
obj.setProperty("shadeMap", FALLTHROUGH);
|
||||||
} else if (!material.shadeMap.isEmpty()) {
|
} else if (!material.shadeMap.isEmpty()) {
|
||||||
obj.setProperty("shadeMap", material.shadeMap);
|
obj.setProperty("shadeMap", material.shadeMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SHADING_SHIFT_VAL_BIT = graphics::MaterialKey::FlagBit::METALLIC_VAL_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::METALLIC_VAL_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::METALLIC_VAL_BIT)) {
|
||||||
obj.setProperty("shadingShift", FALLTHROUGH);
|
obj.setProperty("shadingShift", FALLTHROUGH);
|
||||||
} else if (material.key._flags[graphics::MaterialKey::METALLIC_VAL_BIT]) {
|
} else if (material.key._flags[graphics::MaterialKey::METALLIC_VAL_BIT]) {
|
||||||
obj.setProperty("shadingShift", material.shadingShift);
|
obj.setProperty("shadingShift", material.shadingShift);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SHADING_SHIFT_MAP_BIT = graphics::MaterialKey::FlagBit::METALLIC_MAP_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::METALLIC_MAP_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::METALLIC_MAP_BIT)) {
|
||||||
obj.setProperty("shadingShiftMap", FALLTHROUGH);
|
obj.setProperty("shadingShiftMap", FALLTHROUGH);
|
||||||
} else if (!material.shadingShiftMap.isEmpty()) {
|
} else if (!material.shadingShiftMap.isEmpty()) {
|
||||||
obj.setProperty("shadingShiftMap", material.shadingShiftMap);
|
obj.setProperty("shadingShiftMap", material.shadingShiftMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SHADING_TOONY_VAL_BIT = graphics::MaterialKey::FlagBit::GLOSSY_VAL_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::GLOSSY_VAL_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::GLOSSY_VAL_BIT)) {
|
||||||
obj.setProperty("shadingToony", FALLTHROUGH);
|
obj.setProperty("shadingToony", FALLTHROUGH);
|
||||||
} else if (material.key._flags[graphics::MaterialKey::GLOSSY_VAL_BIT]) {
|
} else if (material.key._flags[graphics::MaterialKey::GLOSSY_VAL_BIT]) {
|
||||||
obj.setProperty("shadingToony", material.shadingToony);
|
obj.setProperty("shadingToony", material.shadingToony);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MATCAP_VAL_BIT = graphics::MaterialKey::FlagBit::EXTRA_1_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_1_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_1_BIT)) {
|
||||||
obj.setProperty("matcap", FALLTHROUGH);
|
obj.setProperty("matcap", FALLTHROUGH);
|
||||||
} else if (material.key._flags[graphics::MaterialKey::EXTRA_1_BIT]) {
|
} else if (material.key._flags[graphics::MaterialKey::EXTRA_1_BIT]) {
|
||||||
obj.setProperty("matcap", vec3ColorToScriptValue(engine, material.matcap));
|
obj.setProperty("matcap", vec3ColorToScriptValue(engine, material.matcap));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MATCAP_MAP_BIT = graphics::MaterialKey::FlagBit::OCCLUSION_MAP_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::OCCLUSION_MAP_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::OCCLUSION_MAP_BIT)) {
|
||||||
obj.setProperty("matcapMap", FALLTHROUGH);
|
obj.setProperty("matcapMap", FALLTHROUGH);
|
||||||
} else if (!material.matcapMap.isEmpty()) {
|
} else if (!material.matcapMap.isEmpty()) {
|
||||||
obj.setProperty("matcapMap", material.matcapMap);
|
obj.setProperty("matcapMap", material.matcapMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PARAMETRIC_RIM_VAL_BIT = graphics::MaterialKey::FlagBit::EXTRA_2_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_2_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_2_BIT)) {
|
||||||
obj.setProperty("parametricRim", FALLTHROUGH);
|
obj.setProperty("parametricRim", FALLTHROUGH);
|
||||||
} else if (material.key._flags[graphics::MaterialKey::EXTRA_2_BIT]) {
|
} else if (material.key._flags[graphics::MaterialKey::EXTRA_2_BIT]) {
|
||||||
obj.setProperty("parametricRim", vec3ColorToScriptValue(engine, material.parametricRim));
|
obj.setProperty("parametricRim", vec3ColorToScriptValue(engine, material.parametricRim));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PARAMETRIC_RIM_POWER_VAL_BIT = graphics::MaterialKey::FlagBit::EXTRA_3_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_3_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_3_BIT)) {
|
||||||
obj.setProperty("parametricRimFresnelPower", FALLTHROUGH);
|
obj.setProperty("parametricRimFresnelPower", FALLTHROUGH);
|
||||||
} else if (material.key._flags[graphics::MaterialKey::EXTRA_3_BIT]) {
|
} else if (material.key._flags[graphics::MaterialKey::EXTRA_3_BIT]) {
|
||||||
obj.setProperty("parametricRimFresnelPower", material.parametricRimFresnelPower);
|
obj.setProperty("parametricRimFresnelPower", material.parametricRimFresnelPower);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PARAMETRIC_RIM_LIFT_VAL_BIT = graphics::MaterialKey::FlagBit::EXTRA_4_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_4_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_4_BIT)) {
|
||||||
obj.setProperty("parametricRimLift", FALLTHROUGH);
|
obj.setProperty("parametricRimLift", FALLTHROUGH);
|
||||||
} else if (material.key._flags[graphics::MaterialKey::EXTRA_4_BIT]) {
|
} else if (material.key._flags[graphics::MaterialKey::EXTRA_4_BIT]) {
|
||||||
obj.setProperty("parametricRimLift", material.parametricRimLift);
|
obj.setProperty("parametricRimLift", material.parametricRimLift);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RIM_MAP_BIT = graphics::MaterialKey::FlagBit::SCATTERING_MAP_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::SCATTERING_MAP_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::SCATTERING_MAP_BIT)) {
|
||||||
obj.setProperty("rimMap", FALLTHROUGH);
|
obj.setProperty("rimMap", FALLTHROUGH);
|
||||||
} else if (!material.rimMap.isEmpty()) {
|
} else if (!material.rimMap.isEmpty()) {
|
||||||
obj.setProperty("rimMap", material.rimMap);
|
obj.setProperty("rimMap", material.rimMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RIM_LIGHTING_MIX_VAL_BIT = graphics::MaterialKey::FlagBit::EXTRA_5_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_5_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::EXTRA_5_BIT)) {
|
||||||
obj.setProperty("rimLightingMix", FALLTHROUGH);
|
obj.setProperty("rimLightingMix", FALLTHROUGH);
|
||||||
} else if (material.key._flags[graphics::MaterialKey::EXTRA_5_BIT]) {
|
} else if (material.key._flags[graphics::MaterialKey::EXTRA_5_BIT]) {
|
||||||
obj.setProperty("rimLightingMix", material.rimLightingMix);
|
obj.setProperty("rimLightingMix", material.rimLightingMix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UV_ANIMATION_MASK_MAP_BIT = graphics::MaterialKey::FlagBit::LIGHT_MAP_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::LIGHT_MAP_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::LIGHT_MAP_BIT)) {
|
||||||
obj.setProperty("uvAnimationMaskMap", FALLTHROUGH);
|
obj.setProperty("uvAnimationMaskMap", FALLTHROUGH);
|
||||||
} else if (!material.uvAnimationMaskMap.isEmpty()) {
|
} else if (!material.uvAnimationMaskMap.isEmpty()) {
|
||||||
obj.setProperty("uvAnimationMaskMap", material.uvAnimationMaskMap);
|
obj.setProperty("uvAnimationMaskMap", material.uvAnimationMaskMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UV_ANIMATION_SCROLL_VAL_BIT = graphics::MaterialKey::FlagBit::SCATTERING_VAL_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::SCATTERING_VAL_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::MaterialKey::SCATTERING_VAL_BIT)) {
|
||||||
obj.setProperty("uvAnimationScrollXSpeed", FALLTHROUGH);
|
obj.setProperty("uvAnimationScrollXSpeed", FALLTHROUGH);
|
||||||
obj.setProperty("uvAnimationScrollYSpeed", FALLTHROUGH);
|
obj.setProperty("uvAnimationScrollYSpeed", FALLTHROUGH);
|
||||||
|
@ -608,18 +622,21 @@ namespace scriptable {
|
||||||
obj.setProperty("uvAnimationRotationSpeed", material.uvAnimationRotationSpeed);
|
obj.setProperty("uvAnimationRotationSpeed", material.uvAnimationRotationSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OUTLINE_WIDTH_MODE_VAL_BIT = graphics::Material::ExtraFlagBit::EXTRA_1_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::Material::EXTRA_1_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::Material::EXTRA_1_BIT)) {
|
||||||
obj.setProperty("outlineWidthMode", FALLTHROUGH);
|
obj.setProperty("outlineWidthMode", FALLTHROUGH);
|
||||||
} else {
|
} else {
|
||||||
obj.setProperty("outlineWidthMode", material.outlineWidthMode);
|
obj.setProperty("outlineWidthMode", material.outlineWidthMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OUTLINE_WIDTH_VAL_BIT = graphics::Material::ExtraFlagBit::EXTRA_2_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::Material::EXTRA_2_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::Material::EXTRA_2_BIT)) {
|
||||||
obj.setProperty("outlineWidth", FALLTHROUGH);
|
obj.setProperty("outlineWidth", FALLTHROUGH);
|
||||||
} else {
|
} else {
|
||||||
obj.setProperty("outlineWidth", material.outlineWidth);
|
obj.setProperty("outlineWidth", material.outlineWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OUTLINE_VAL_BIT = graphics::Material::ExtraFlagBit::EXTRA_3_BIT
|
||||||
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::Material::EXTRA_3_BIT)) {
|
if (hasPropertyFallthroughs && material.propertyFallthroughs.at(graphics::Material::EXTRA_3_BIT)) {
|
||||||
obj.setProperty("outline", FALLTHROUGH);
|
obj.setProperty("outline", FALLTHROUGH);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -94,6 +94,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MToonFlagBit {
|
enum MToonFlagBit {
|
||||||
|
// Must match mappings in GraphicsScriptingInterface.cpp
|
||||||
SHADE_MAP_BIT = graphics::MaterialKey::FlagBit::ROUGHNESS_MAP_BIT,
|
SHADE_MAP_BIT = graphics::MaterialKey::FlagBit::ROUGHNESS_MAP_BIT,
|
||||||
SHADING_SHIFT_MAP_BIT = graphics::MaterialKey::FlagBit::METALLIC_MAP_BIT,
|
SHADING_SHIFT_MAP_BIT = graphics::MaterialKey::FlagBit::METALLIC_MAP_BIT,
|
||||||
MATCAP_MAP_BIT = graphics::MaterialKey::FlagBit::OCCLUSION_MAP_BIT,
|
MATCAP_MAP_BIT = graphics::MaterialKey::FlagBit::OCCLUSION_MAP_BIT,
|
||||||
|
|
Loading…
Reference in a new issue