mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 18:24:08 +02:00
Finalizing the renaming from Skinned to Deformed
This commit is contained in:
parent
09dae5aee3
commit
b5a47b2e76
7 changed files with 77 additions and 90 deletions
|
@ -315,7 +315,7 @@ static QTimer pingTimer;
|
||||||
static bool DISABLE_WATCHDOG = true;
|
static bool DISABLE_WATCHDOG = true;
|
||||||
#else
|
#else
|
||||||
static const QString DISABLE_WATCHDOG_FLAG{ "HIFI_DISABLE_WATCHDOG" };
|
static const QString DISABLE_WATCHDOG_FLAG{ "HIFI_DISABLE_WATCHDOG" };
|
||||||
static bool DISABLE_WATCHDOG = true || nsightActive() || QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG);
|
static bool DISABLE_WATCHDOG = nsightActive() || QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_GLES)
|
#if defined(USE_GLES)
|
||||||
|
|
|
@ -20,15 +20,11 @@ using namespace gpu;
|
||||||
Material::Material() :
|
Material::Material() :
|
||||||
_key(0),
|
_key(0),
|
||||||
_schemaBuffer(),
|
_schemaBuffer(),
|
||||||
// _texMapArrayBuffer(),
|
|
||||||
_textureMaps()
|
_textureMaps()
|
||||||
{
|
{
|
||||||
// created from nothing: create the Buffer to store the properties
|
// created from nothing: create the Buffer to store the properties
|
||||||
Schema schema;
|
Schema schema;
|
||||||
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema));
|
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema));
|
||||||
|
|
||||||
// TexMapArraySchema TexMapArraySchema;
|
|
||||||
// _texMapArrayBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(TexMapArraySchema), (const gpu::Byte*) &TexMapArraySchema));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Material::Material(const Material& material) :
|
Material::Material(const Material& material) :
|
||||||
|
@ -40,10 +36,6 @@ Material::Material(const Material& material) :
|
||||||
Schema schema;
|
Schema schema;
|
||||||
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema));
|
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema));
|
||||||
_schemaBuffer.edit<Schema>() = material._schemaBuffer.get<Schema>();
|
_schemaBuffer.edit<Schema>() = material._schemaBuffer.get<Schema>();
|
||||||
|
|
||||||
// TexMapArraySchema texMapArraySchema;
|
|
||||||
// _texMapArrayBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(TexMapArraySchema), (const gpu::Byte*) &texMapArraySchema));
|
|
||||||
// _texMapArrayBuffer.edit<TexMapArraySchema>() = material._texMapArrayBuffer.get<TexMapArraySchema>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Material& Material::operator= (const Material& material) {
|
Material& Material::operator= (const Material& material) {
|
||||||
|
@ -60,10 +52,6 @@ Material& Material::operator= (const Material& material) {
|
||||||
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema));
|
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema));
|
||||||
_schemaBuffer.edit<Schema>() = material._schemaBuffer.get<Schema>();
|
_schemaBuffer.edit<Schema>() = material._schemaBuffer.get<Schema>();
|
||||||
|
|
||||||
// TexMapArraySchema texMapArraySchema;
|
|
||||||
// _texMapArrayBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(TexMapArraySchema), (const gpu::Byte*) &texMapArraySchema));
|
|
||||||
// _texMapArrayBuffer.edit<TexMapArraySchema>() = material._texMapArrayBuffer.get<TexMapArraySchema>();
|
|
||||||
|
|
||||||
return (*this);
|
return (*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,8 +181,8 @@ void DrawHighlightMask::run(const render::RenderContextPointer& renderContext, c
|
||||||
args->_batch = &batch;
|
args->_batch = &batch;
|
||||||
|
|
||||||
auto maskPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder);
|
auto maskPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder);
|
||||||
auto maskSkinnedPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder.withSkinned());
|
auto maskDeformedPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder.withDeformed());
|
||||||
auto maskSkinnedDQPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder.withSkinned().withDualQuatSkinned());
|
auto maskDeformedDQPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder.withDeformed().withDualQuatSkinned());
|
||||||
|
|
||||||
// Setup camera, projection and viewport for all items
|
// Setup camera, projection and viewport for all items
|
||||||
batch.setViewportTransform(args->_viewport);
|
batch.setViewportTransform(args->_viewport);
|
||||||
|
@ -190,37 +190,37 @@ void DrawHighlightMask::run(const render::RenderContextPointer& renderContext, c
|
||||||
batch.setProjectionJitter(jitter.x, jitter.y);
|
batch.setProjectionJitter(jitter.x, jitter.y);
|
||||||
batch.setViewTransform(viewMat);
|
batch.setViewTransform(viewMat);
|
||||||
|
|
||||||
std::vector<ShapeKey> skinnedShapeKeys;
|
std::vector<ShapeKey> deformedShapeKeys;
|
||||||
std::vector<ShapeKey> skinnedDQShapeKeys;
|
std::vector<ShapeKey> deformedDQShapeKeys;
|
||||||
|
|
||||||
// Iterate through all inShapes and render the unskinned
|
// Iterate through all inShapes and render the unskinned
|
||||||
args->_shapePipeline = maskPipeline;
|
args->_shapePipeline = maskPipeline;
|
||||||
batch.setPipeline(maskPipeline->pipeline);
|
batch.setPipeline(maskPipeline->pipeline);
|
||||||
for (const auto& items : inShapes) {
|
for (const auto& items : inShapes) {
|
||||||
itemBounds.insert(itemBounds.end(), items.second.begin(), items.second.end());
|
itemBounds.insert(itemBounds.end(), items.second.begin(), items.second.end());
|
||||||
if (items.first.isSkinned() && items.first.isDualQuatSkinned()) {
|
if (items.first.isDeformed() && items.first.isDualQuatSkinned()) {
|
||||||
skinnedDQShapeKeys.push_back(items.first);
|
deformedDQShapeKeys.push_back(items.first);
|
||||||
} else if (items.first.isSkinned()) {
|
} else if (items.first.isDeformed()) {
|
||||||
skinnedShapeKeys.push_back(items.first);
|
deformedShapeKeys.push_back(items.first);
|
||||||
} else {
|
} else {
|
||||||
renderItems(renderContext, items.second);
|
renderItems(renderContext, items.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reiterate to render the skinned
|
// Reiterate to render the skinned
|
||||||
if (skinnedShapeKeys.size() > 0) {
|
if (deformedShapeKeys.size() > 0) {
|
||||||
args->_shapePipeline = maskSkinnedPipeline;
|
args->_shapePipeline = maskDeformedPipeline;
|
||||||
batch.setPipeline(maskSkinnedPipeline->pipeline);
|
batch.setPipeline(maskDeformedPipeline->pipeline);
|
||||||
for (const auto& key : skinnedShapeKeys) {
|
for (const auto& key : deformedShapeKeys) {
|
||||||
renderItems(renderContext, inShapes.at(key));
|
renderItems(renderContext, inShapes.at(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reiterate to render the DQ skinned
|
// Reiterate to render the DQ skinned
|
||||||
if (skinnedDQShapeKeys.size() > 0) {
|
if (deformedDQShapeKeys.size() > 0) {
|
||||||
args->_shapePipeline = maskSkinnedDQPipeline;
|
args->_shapePipeline = maskDeformedDQPipeline;
|
||||||
batch.setPipeline(maskSkinnedDQPipeline->pipeline);
|
batch.setPipeline(maskDeformedDQPipeline->pipeline);
|
||||||
for (const auto& key : skinnedDQShapeKeys) {
|
for (const auto& key : deformedDQShapeKeys) {
|
||||||
renderItems(renderContext, inShapes.at(key));
|
renderItems(renderContext, inShapes.at(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,10 +352,10 @@ void ModelMeshPartPayload::setShapeKey(bool invalidateShapeKey, bool isWireframe
|
||||||
bool hasLightmap = drawMaterialKey.isLightmapMap();
|
bool hasLightmap = drawMaterialKey.isLightmapMap();
|
||||||
bool isUnlit = drawMaterialKey.isUnlit();
|
bool isUnlit = drawMaterialKey.isUnlit();
|
||||||
|
|
||||||
bool isSkinned = _isBlendShaped || _isSkinned;
|
bool isDeformed = _isBlendShaped || _isSkinned;
|
||||||
|
|
||||||
if (isWireframe) {
|
if (isWireframe) {
|
||||||
isTranslucent = hasTangents = hasLightmap = isSkinned = false;
|
isTranslucent = hasTangents = hasLightmap = isDeformed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShapeKey::Builder builder;
|
ShapeKey::Builder builder;
|
||||||
|
@ -373,13 +373,13 @@ void ModelMeshPartPayload::setShapeKey(bool invalidateShapeKey, bool isWireframe
|
||||||
if (isUnlit) {
|
if (isUnlit) {
|
||||||
builder.withUnlit();
|
builder.withUnlit();
|
||||||
}
|
}
|
||||||
if (isSkinned) {
|
if (isDeformed) {
|
||||||
builder.withSkinned();
|
builder.withDeformed();
|
||||||
}
|
}
|
||||||
if (isWireframe) {
|
if (isWireframe) {
|
||||||
builder.withWireframe();
|
builder.withWireframe();
|
||||||
}
|
}
|
||||||
if (isSkinned && useDualQuaternionSkinning) {
|
if (isDeformed && useDualQuaternionSkinning) {
|
||||||
builder.withDualQuatSkinned();
|
builder.withDualQuatSkinned();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,60 +146,60 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
||||||
|
|
||||||
// matrix palette skinned
|
// matrix palette skinned
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned(),
|
Key::Builder().withMaterial().withDeformed(),
|
||||||
deformed_model, nullptr, nullptr);
|
deformed_model, nullptr, nullptr);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withTangents(),
|
Key::Builder().withMaterial().withDeformed().withTangents(),
|
||||||
deformed_model_normal_map, nullptr, nullptr);
|
deformed_model_normal_map, nullptr, nullptr);
|
||||||
// Same thing but with Fade on
|
// Same thing but with Fade on
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withFade(),
|
Key::Builder().withMaterial().withDeformed().withFade(),
|
||||||
deformed_model_fade, batchSetter, itemSetter);
|
deformed_model_fade, batchSetter, itemSetter);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withTangents().withFade(),
|
Key::Builder().withMaterial().withDeformed().withTangents().withFade(),
|
||||||
deformed_model_normal_map_fade, batchSetter, itemSetter);
|
deformed_model_normal_map_fade, batchSetter, itemSetter);
|
||||||
// matrix palette skinned and translucent
|
// matrix palette skinned and translucent
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withTranslucent(),
|
Key::Builder().withMaterial().withDeformed().withTranslucent(),
|
||||||
deformed_model_translucent, nullptr, nullptr);
|
deformed_model_translucent, nullptr, nullptr);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withTangents(),
|
Key::Builder().withMaterial().withDeformed().withTranslucent().withTangents(),
|
||||||
deformed_model_normal_map_translucent, nullptr, nullptr);
|
deformed_model_normal_map_translucent, nullptr, nullptr);
|
||||||
// Same thing but with Fade on
|
// Same thing but with Fade on
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withFade(),
|
Key::Builder().withMaterial().withDeformed().withTranslucent().withFade(),
|
||||||
deformed_model_translucent_fade, batchSetter, itemSetter);
|
deformed_model_translucent_fade, batchSetter, itemSetter);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withTangents().withFade(),
|
Key::Builder().withMaterial().withDeformed().withTranslucent().withTangents().withFade(),
|
||||||
deformed_model_normal_map_translucent_fade, batchSetter, itemSetter);
|
deformed_model_normal_map_translucent_fade, batchSetter, itemSetter);
|
||||||
|
|
||||||
// dual quaternion skinned
|
// dual quaternion skinned
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withDualQuatSkinned(),
|
Key::Builder().withMaterial().withDeformed().withDualQuatSkinned(),
|
||||||
deformed_model_dq, nullptr, nullptr);
|
deformed_model_dq, nullptr, nullptr);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withDualQuatSkinned().withTangents(),
|
Key::Builder().withMaterial().withDeformed().withDualQuatSkinned().withTangents(),
|
||||||
deformed_model_normal_map_dq, nullptr, nullptr);
|
deformed_model_normal_map_dq, nullptr, nullptr);
|
||||||
// Same thing but with Fade on
|
// Same thing but with Fade on
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withDualQuatSkinned().withFade(),
|
Key::Builder().withMaterial().withDeformed().withDualQuatSkinned().withFade(),
|
||||||
deformed_model_fade_dq, batchSetter, itemSetter);
|
deformed_model_fade_dq, batchSetter, itemSetter);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withDualQuatSkinned().withTangents().withFade(),
|
Key::Builder().withMaterial().withDeformed().withDualQuatSkinned().withTangents().withFade(),
|
||||||
deformed_model_normal_map_fade_dq, batchSetter, itemSetter);
|
deformed_model_normal_map_fade_dq, batchSetter, itemSetter);
|
||||||
// dual quaternion skinned and translucent
|
// dual quaternion skinned and translucent
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withDualQuatSkinned().withTranslucent(),
|
Key::Builder().withMaterial().withDeformed().withDualQuatSkinned().withTranslucent(),
|
||||||
deformed_model_translucent_dq, nullptr, nullptr);
|
deformed_model_translucent_dq, nullptr, nullptr);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withDualQuatSkinned().withTranslucent().withTangents(),
|
Key::Builder().withMaterial().withDeformed().withDualQuatSkinned().withTranslucent().withTangents(),
|
||||||
deformed_model_normal_map_translucent_dq, nullptr, nullptr);
|
deformed_model_normal_map_translucent_dq, nullptr, nullptr);
|
||||||
// Same thing but with Fade on
|
// Same thing but with Fade on
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withDualQuatSkinned().withTranslucent().withFade(),
|
Key::Builder().withMaterial().withDeformed().withDualQuatSkinned().withTranslucent().withFade(),
|
||||||
deformed_model_translucent_fade_dq, batchSetter, itemSetter);
|
deformed_model_translucent_fade_dq, batchSetter, itemSetter);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withMaterial().withSkinned().withDualQuatSkinned().withTranslucent().withTangents().withFade(),
|
Key::Builder().withMaterial().withDeformed().withDualQuatSkinned().withTranslucent().withTangents().withFade(),
|
||||||
deformed_model_normal_map_translucent_fade_dq, batchSetter, itemSetter);
|
deformed_model_normal_map_translucent_fade_dq, batchSetter, itemSetter);
|
||||||
|
|
||||||
// Depth-only
|
// Depth-only
|
||||||
|
@ -207,24 +207,24 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
||||||
Key::Builder().withDepthOnly(),
|
Key::Builder().withDepthOnly(),
|
||||||
model_shadow, nullptr, nullptr);
|
model_shadow, nullptr, nullptr);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withSkinned().withDepthOnly(),
|
Key::Builder().withDeformed().withDepthOnly(),
|
||||||
deformed_model_shadow, nullptr, nullptr);
|
deformed_model_shadow, nullptr, nullptr);
|
||||||
// Same thing but with Fade on
|
// Same thing but with Fade on
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withDepthOnly().withFade(),
|
Key::Builder().withDepthOnly().withFade(),
|
||||||
model_shadow_fade, batchSetter, itemSetter);
|
model_shadow_fade, batchSetter, itemSetter);
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withSkinned().withDepthOnly().withFade(),
|
Key::Builder().withDeformed().withDepthOnly().withFade(),
|
||||||
deformed_model_shadow_fade, batchSetter, itemSetter);
|
deformed_model_shadow_fade, batchSetter, itemSetter);
|
||||||
|
|
||||||
// Now repeat for dual quaternion
|
// Now repeat for dual quaternion
|
||||||
// Depth-only
|
// Depth-only
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withSkinned().withDualQuatSkinned().withDepthOnly(),
|
Key::Builder().withDeformed().withDualQuatSkinned().withDepthOnly(),
|
||||||
deformed_model_shadow_dq, nullptr, nullptr);
|
deformed_model_shadow_dq, nullptr, nullptr);
|
||||||
// Same thing but with Fade on
|
// Same thing but with Fade on
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder().withSkinned().withDualQuatSkinned().withDepthOnly().withFade(),
|
Key::Builder().withDeformed().withDualQuatSkinned().withDepthOnly().withFade(),
|
||||||
deformed_model_shadow_fade_dq, batchSetter, itemSetter);
|
deformed_model_shadow_fade_dq, batchSetter, itemSetter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,21 +256,21 @@ void initForwardPipelines(ShapePlumber& plumber) {
|
||||||
addPipeline(Key::Builder().withMaterial().withUnlit(), forward_model_unlit);
|
addPipeline(Key::Builder().withMaterial().withUnlit(), forward_model_unlit);
|
||||||
addPipeline(Key::Builder().withMaterial().withTangents(), forward_model_translucent);
|
addPipeline(Key::Builder().withMaterial().withTangents(), forward_model_translucent);
|
||||||
|
|
||||||
// Skinned Opaques
|
// Deformed Opaques
|
||||||
addPipeline(Key::Builder().withMaterial().withSkinned(), forward_deformed_model);
|
addPipeline(Key::Builder().withMaterial().withDeformed(), forward_deformed_model);
|
||||||
addPipeline(Key::Builder().withMaterial().withSkinned().withTangents(), forward_deformed_model_normal_map);
|
addPipeline(Key::Builder().withMaterial().withDeformed().withTangents(), forward_deformed_model_normal_map);
|
||||||
addPipeline(Key::Builder().withMaterial().withSkinned().withDualQuatSkinned(), forward_deformed_model_dq);
|
addPipeline(Key::Builder().withMaterial().withDeformed().withDualQuatSkinned(), forward_deformed_model_dq);
|
||||||
addPipeline(Key::Builder().withMaterial().withSkinned().withTangents().withDualQuatSkinned(), forward_deformed_model_normal_map_dq);
|
addPipeline(Key::Builder().withMaterial().withDeformed().withTangents().withDualQuatSkinned(), forward_deformed_model_normal_map_dq);
|
||||||
|
|
||||||
// Translucents
|
// Translucents
|
||||||
addPipeline(Key::Builder().withMaterial().withTranslucent(), forward_model_translucent);
|
addPipeline(Key::Builder().withMaterial().withTranslucent(), forward_model_translucent);
|
||||||
addPipeline(Key::Builder().withMaterial().withTranslucent().withTangents(), forward_model_normal_map_translucent);
|
addPipeline(Key::Builder().withMaterial().withTranslucent().withTangents(), forward_model_normal_map_translucent);
|
||||||
|
|
||||||
// Skinned Translucents
|
// Deformed Translucents
|
||||||
addPipeline(Key::Builder().withMaterial().withSkinned().withTranslucent(), forward_deformed_translucent);
|
addPipeline(Key::Builder().withMaterial().withDeformed().withTranslucent(), forward_deformed_translucent);
|
||||||
addPipeline(Key::Builder().withMaterial().withSkinned().withTranslucent().withTangents(), forward_deformed_translucent_normal_map);
|
addPipeline(Key::Builder().withMaterial().withDeformed().withTranslucent().withTangents(), forward_deformed_translucent_normal_map);
|
||||||
addPipeline(Key::Builder().withMaterial().withSkinned().withTranslucent().withDualQuatSkinned(), forward_deformed_translucent_dq);
|
addPipeline(Key::Builder().withMaterial().withDeformed().withTranslucent().withDualQuatSkinned(), forward_deformed_translucent_dq);
|
||||||
addPipeline(Key::Builder().withMaterial().withSkinned().withTranslucent().withTangents().withDualQuatSkinned(), forward_deformed_translucent_normal_map_dq);
|
addPipeline(Key::Builder().withMaterial().withDeformed().withTranslucent().withTangents().withDualQuatSkinned(), forward_deformed_translucent_normal_map_dq);
|
||||||
|
|
||||||
forceLightBatchSetter = false;
|
forceLightBatchSetter = false;
|
||||||
}
|
}
|
||||||
|
@ -366,32 +366,32 @@ void initZPassPipelines(ShapePlumber& shapePlumber, gpu::StatePointer state) {
|
||||||
using namespace shader::render_utils::program;
|
using namespace shader::render_utils::program;
|
||||||
gpu::ShaderPointer modelProgram = gpu::Shader::createProgram(model_shadow);
|
gpu::ShaderPointer modelProgram = gpu::Shader::createProgram(model_shadow);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withoutSkinned().withoutFade(),
|
ShapeKey::Filter::Builder().withoutDeformed().withoutFade(),
|
||||||
modelProgram, state);
|
modelProgram, state);
|
||||||
|
|
||||||
gpu::ShaderPointer skinProgram = gpu::Shader::createProgram(deformed_model_shadow);
|
gpu::ShaderPointer skinProgram = gpu::Shader::createProgram(deformed_model_shadow);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withSkinned().withoutDualQuatSkinned().withoutFade(),
|
ShapeKey::Filter::Builder().withDeformed().withoutDualQuatSkinned().withoutFade(),
|
||||||
skinProgram, state);
|
skinProgram, state);
|
||||||
|
|
||||||
gpu::ShaderPointer modelFadeProgram = gpu::Shader::createProgram(model_shadow_fade);
|
gpu::ShaderPointer modelFadeProgram = gpu::Shader::createProgram(model_shadow_fade);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withoutSkinned().withFade(),
|
ShapeKey::Filter::Builder().withoutDeformed().withFade(),
|
||||||
modelFadeProgram, state);
|
modelFadeProgram, state);
|
||||||
|
|
||||||
gpu::ShaderPointer skinFadeProgram = gpu::Shader::createProgram(deformed_model_shadow_fade);
|
gpu::ShaderPointer skinFadeProgram = gpu::Shader::createProgram(deformed_model_shadow_fade);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withSkinned().withoutDualQuatSkinned().withFade(),
|
ShapeKey::Filter::Builder().withDeformed().withoutDualQuatSkinned().withFade(),
|
||||||
skinFadeProgram, state);
|
skinFadeProgram, state);
|
||||||
|
|
||||||
gpu::ShaderPointer skinModelShadowDualQuatProgram = gpu::Shader::createProgram(deformed_model_shadow_dq);
|
gpu::ShaderPointer skinModelShadowDualQuatProgram = gpu::Shader::createProgram(deformed_model_shadow_dq);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withSkinned().withDualQuatSkinned().withoutFade(),
|
ShapeKey::Filter::Builder().withDeformed().withDualQuatSkinned().withoutFade(),
|
||||||
skinModelShadowDualQuatProgram, state);
|
skinModelShadowDualQuatProgram, state);
|
||||||
|
|
||||||
gpu::ShaderPointer skinModelShadowFadeDualQuatProgram = gpu::Shader::createProgram(deformed_model_shadow_fade_dq);
|
gpu::ShaderPointer skinModelShadowFadeDualQuatProgram = gpu::Shader::createProgram(deformed_model_shadow_fade_dq);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withSkinned().withDualQuatSkinned().withFade(),
|
ShapeKey::Filter::Builder().withDeformed().withDualQuatSkinned().withFade(),
|
||||||
skinModelShadowFadeDualQuatProgram, state);
|
skinModelShadowFadeDualQuatProgram, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,7 +404,6 @@ void RenderPipelines::bindMaterial(const graphics::MaterialPointer& material, gp
|
||||||
auto textureCache = DependencyManager::get<TextureCache>();
|
auto textureCache = DependencyManager::get<TextureCache>();
|
||||||
|
|
||||||
batch.setUniformBuffer(gr::Buffer::Material, material->getSchemaBuffer());
|
batch.setUniformBuffer(gr::Buffer::Material, material->getSchemaBuffer());
|
||||||
// batch.setUniformBuffer(gr::Buffer::TexMapArray, material->getTexMapArrayBuffer());
|
|
||||||
|
|
||||||
const auto& materialKey = material->getKey();
|
const auto& materialKey = material->getKey();
|
||||||
const auto& textureMaps = material->getTextureMaps();
|
const auto& textureMaps = material->getTextureMaps();
|
||||||
|
|
|
@ -249,22 +249,22 @@ void RenderShadowMap::run(const render::RenderContextPointer& renderContext, con
|
||||||
batch.setViewTransform(viewMat, false);
|
batch.setViewTransform(viewMat, false);
|
||||||
|
|
||||||
auto shadowPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder);
|
auto shadowPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder);
|
||||||
auto shadowSkinnedPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder.withSkinned());
|
auto shadowDeformedPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder.withDeformed());
|
||||||
auto shadowSkinnedDQPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder.withSkinned().withDualQuatSkinned());
|
auto shadowDeformedDQPipeline = _shapePlumber->pickPipeline(args, defaultKeyBuilder.withDeformed().withDualQuatSkinned());
|
||||||
|
|
||||||
std::vector<ShapeKey> skinnedShapeKeys{};
|
std::vector<ShapeKey> deformedShapeKeys{};
|
||||||
std::vector<ShapeKey> skinnedDQShapeKeys{};
|
std::vector<ShapeKey> deformedDQShapeKeys{};
|
||||||
std::vector<ShapeKey> ownPipelineShapeKeys{};
|
std::vector<ShapeKey> ownPipelineShapeKeys{};
|
||||||
|
|
||||||
// Iterate through all inShapes and render the unskinned
|
// Iterate through all inShapes and render the unskinned
|
||||||
args->_shapePipeline = shadowPipeline;
|
args->_shapePipeline = shadowPipeline;
|
||||||
batch.setPipeline(shadowPipeline->pipeline);
|
batch.setPipeline(shadowPipeline->pipeline);
|
||||||
for (auto items : inShapes) {
|
for (auto items : inShapes) {
|
||||||
if (items.first.isSkinned()) {
|
if (items.first.isDeformed()) {
|
||||||
if (items.first.isDualQuatSkinned()) {
|
if (items.first.isDualQuatSkinned()) {
|
||||||
skinnedDQShapeKeys.push_back(items.first);
|
deformedDQShapeKeys.push_back(items.first);
|
||||||
} else {
|
} else {
|
||||||
skinnedShapeKeys.push_back(items.first);
|
deformedShapeKeys.push_back(items.first);
|
||||||
}
|
}
|
||||||
} else if (!items.first.hasOwnPipeline()) {
|
} else if (!items.first.hasOwnPipeline()) {
|
||||||
renderItems(renderContext, items.second);
|
renderItems(renderContext, items.second);
|
||||||
|
@ -274,16 +274,16 @@ void RenderShadowMap::run(const render::RenderContextPointer& renderContext, con
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reiterate to render the skinned
|
// Reiterate to render the skinned
|
||||||
args->_shapePipeline = shadowSkinnedPipeline;
|
args->_shapePipeline = shadowDeformedPipeline;
|
||||||
batch.setPipeline(shadowSkinnedPipeline->pipeline);
|
batch.setPipeline(shadowDeformedPipeline->pipeline);
|
||||||
for (const auto& key : skinnedShapeKeys) {
|
for (const auto& key : deformedShapeKeys) {
|
||||||
renderItems(renderContext, inShapes.at(key));
|
renderItems(renderContext, inShapes.at(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reiterate to render the DQ skinned
|
// Reiterate to render the DQ skinned
|
||||||
args->_shapePipeline = shadowSkinnedDQPipeline;
|
args->_shapePipeline = shadowDeformedDQPipeline;
|
||||||
batch.setPipeline(shadowSkinnedDQPipeline->pipeline);
|
batch.setPipeline(shadowDeformedDQPipeline->pipeline);
|
||||||
for (const auto& key : skinnedDQShapeKeys) {
|
for (const auto& key : deformedDQShapeKeys) {
|
||||||
renderItems(renderContext, inShapes.at(key));
|
renderItems(renderContext, inShapes.at(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
LIGHTMAP,
|
LIGHTMAP,
|
||||||
TANGENTS,
|
TANGENTS,
|
||||||
UNLIT,
|
UNLIT,
|
||||||
SKINNED,
|
DEFORMED,
|
||||||
DUAL_QUAT_SKINNED,
|
DUAL_QUAT_SKINNED,
|
||||||
DEPTH_ONLY,
|
DEPTH_ONLY,
|
||||||
DEPTH_BIAS,
|
DEPTH_BIAS,
|
||||||
|
@ -78,7 +78,7 @@ public:
|
||||||
Builder& withLightmap() { _flags.set(LIGHTMAP); return (*this); }
|
Builder& withLightmap() { _flags.set(LIGHTMAP); return (*this); }
|
||||||
Builder& withTangents() { _flags.set(TANGENTS); return (*this); }
|
Builder& withTangents() { _flags.set(TANGENTS); return (*this); }
|
||||||
Builder& withUnlit() { _flags.set(UNLIT); return (*this); }
|
Builder& withUnlit() { _flags.set(UNLIT); return (*this); }
|
||||||
Builder& withSkinned() { _flags.set(SKINNED); return (*this); }
|
Builder& withDeformed() { _flags.set(DEFORMED); return (*this); }
|
||||||
Builder& withDualQuatSkinned() { _flags.set(DUAL_QUAT_SKINNED); return (*this); }
|
Builder& withDualQuatSkinned() { _flags.set(DUAL_QUAT_SKINNED); return (*this); }
|
||||||
Builder& withDepthOnly() { _flags.set(DEPTH_ONLY); return (*this); }
|
Builder& withDepthOnly() { _flags.set(DEPTH_ONLY); return (*this); }
|
||||||
Builder& withDepthBias() { _flags.set(DEPTH_BIAS); return (*this); }
|
Builder& withDepthBias() { _flags.set(DEPTH_BIAS); return (*this); }
|
||||||
|
@ -127,8 +127,8 @@ public:
|
||||||
Builder& withUnlit() { _flags.set(UNLIT); _mask.set(UNLIT); return (*this); }
|
Builder& withUnlit() { _flags.set(UNLIT); _mask.set(UNLIT); return (*this); }
|
||||||
Builder& withoutUnlit() { _flags.reset(UNLIT); _mask.set(UNLIT); return (*this); }
|
Builder& withoutUnlit() { _flags.reset(UNLIT); _mask.set(UNLIT); return (*this); }
|
||||||
|
|
||||||
Builder& withSkinned() { _flags.set(SKINNED); _mask.set(SKINNED); return (*this); }
|
Builder& withDeformed() { _flags.set(DEFORMED); _mask.set(DEFORMED); return (*this); }
|
||||||
Builder& withoutSkinned() { _flags.reset(SKINNED); _mask.set(SKINNED); return (*this); }
|
Builder& withoutDeformed() { _flags.reset(DEFORMED); _mask.set(DEFORMED); return (*this); }
|
||||||
|
|
||||||
Builder& withDualQuatSkinned() { _flags.set(DUAL_QUAT_SKINNED); _mask.set(DUAL_QUAT_SKINNED); return (*this); }
|
Builder& withDualQuatSkinned() { _flags.set(DUAL_QUAT_SKINNED); _mask.set(DUAL_QUAT_SKINNED); return (*this); }
|
||||||
Builder& withoutDualQuatSkinned() { _flags.reset(DUAL_QUAT_SKINNED); _mask.set(DUAL_QUAT_SKINNED); return (*this); }
|
Builder& withoutDualQuatSkinned() { _flags.reset(DUAL_QUAT_SKINNED); _mask.set(DUAL_QUAT_SKINNED); return (*this); }
|
||||||
|
@ -169,7 +169,7 @@ public:
|
||||||
bool hasTangents() const { return _flags[TANGENTS]; }
|
bool hasTangents() const { return _flags[TANGENTS]; }
|
||||||
bool isUnlit() const { return _flags[UNLIT]; }
|
bool isUnlit() const { return _flags[UNLIT]; }
|
||||||
bool isTranslucent() const { return _flags[TRANSLUCENT]; }
|
bool isTranslucent() const { return _flags[TRANSLUCENT]; }
|
||||||
bool isSkinned() const { return _flags[SKINNED]; }
|
bool isDeformed() const { return _flags[DEFORMED]; }
|
||||||
bool isDualQuatSkinned() const { return _flags[DUAL_QUAT_SKINNED]; }
|
bool isDualQuatSkinned() const { return _flags[DUAL_QUAT_SKINNED]; }
|
||||||
bool isDepthOnly() const { return _flags[DEPTH_ONLY]; }
|
bool isDepthOnly() const { return _flags[DEPTH_ONLY]; }
|
||||||
bool isDepthBiased() const { return _flags[DEPTH_BIAS]; }
|
bool isDepthBiased() const { return _flags[DEPTH_BIAS]; }
|
||||||
|
@ -209,7 +209,7 @@ inline QDebug operator<<(QDebug debug, const ShapeKey& key) {
|
||||||
<< "hasTangents:" << key.hasTangents()
|
<< "hasTangents:" << key.hasTangents()
|
||||||
<< "isUnlit:" << key.isUnlit()
|
<< "isUnlit:" << key.isUnlit()
|
||||||
<< "isTranslucent:" << key.isTranslucent()
|
<< "isTranslucent:" << key.isTranslucent()
|
||||||
<< "isSkinned:" << key.isSkinned()
|
<< "isDeformed:" << key.isDeformed()
|
||||||
<< "isDualQuatSkinned:" << key.isDualQuatSkinned()
|
<< "isDualQuatSkinned:" << key.isDualQuatSkinned()
|
||||||
<< "isDepthOnly:" << key.isDepthOnly()
|
<< "isDepthOnly:" << key.isDepthOnly()
|
||||||
<< "isDepthBiased:" << key.isDepthBiased()
|
<< "isDepthBiased:" << key.isDepthBiased()
|
||||||
|
|
Loading…
Reference in a new issue