Uh oh!
There was an error while loading. Please reload this page.
Collada a1.0 - #32
Open
pandaGaume wants to merge 47 commits into
Open
Conversation
PolygonalSun
approved these changes
Aug 14, 2020
| DIRECTIONAL, | ||
| POINT, | ||
| SPOT, | ||
| UNKOWN |
| bool InvertY(CanvasTex::Image image); | ||
| size_t s = bufferSize < m_size ? bufferSize : m_size; | ||
| return Read(outputBuffer, s); | ||
| } | ||
Contributor
There was a problem hiding this comment.
Nit: Remove extra new line
| std::vector<float> inputs; | ||
| std::vector<float> outputs; | ||
| }; | ||
Contributor
There was a problem hiding this comment.
Nit: Remove extra new line
| }; | ||
| } | ||
| } | ||
| #pragma once |
Contributor
There was a problem hiding this comment.
Is this extra pragma once necessary?
| m_light = light; | ||
| return *this; | ||
| } | ||
Contributor
There was a problem hiding this comment.
Nit: Remove extra new line
| * * | ||
| ********************************************************/ | ||
| #pragma once | ||
Contributor
There was a problem hiding this comment.
Nit: Remove extra new line
| class Skeleton; | ||
| } | ||
Contributor
There was a problem hiding this comment.
Nit: Remove extra new line
Comment on lines
+73
to
+146
| //COLLADAFW::ColorOrTexture transparent = effectCommon->getTransparent(); | ||
| //if (transparent.isTexture()) { | ||
| // std::cerr << "WARNING: Effect " << effect->getOriginalId() << | ||
| // " contains a transparent texture that will be omitted from" << | ||
| // " the converted model." << std::endl; | ||
| //} | ||
| //else if (transparent.isColor()) { | ||
| // float* diffuse = material->values->diffuse; | ||
| // if (diffuse == NULL) { | ||
| // diffuse = new float[4]; | ||
| // diffuse[0] = 1.0; | ||
| // diffuse[1] = 1.0; | ||
| // diffuse[2] = 1.0; | ||
| // diffuse[3] = 1.0; | ||
| // material->values->diffuse = diffuse; | ||
| // } | ||
| // float* transparentValues = new float[4]; | ||
| // packColladaColor(transparent.getColor(), transparentValues); | ||
| // auto opaqueMode = effectCommon->getOpaqueMode(); | ||
| // bool alwaysUseAlpha = (opaqueMode == COLLADAFW::EffectCommon::OpaqueMode::A_ONE) || | ||
| // (opaqueMode == COLLADAFW::EffectCommon::OpaqueMode::A_ZERO); | ||
| // bool oneMinus = (opaqueMode == COLLADAFW::EffectCommon::OpaqueMode::RGB_ZERO) || | ||
| // (opaqueMode == COLLADAFW::EffectCommon::OpaqueMode::A_ZERO); | ||
| // for (size_t i = 0; i < 4; i++) { | ||
| // auto transparentValue = transparentValues[alwaysUseAlpha ? 3 : i]; | ||
| // if (!alwaysUseAlpha && i == 3) { //RGB_ZERO or RGB_ONE - use luminance for alpha | ||
| // transparentValue = (transparentValues[0] * 0.212671) + | ||
| // (transparentValues[1] * 0.715160) + | ||
| // (transparentValues[2] * 0.072169); | ||
| // } | ||
| // diffuse[i] *= (oneMinus ? (1.0 - transparentValue) : transparentValue); | ||
| // } | ||
| // if (diffuse[3] < 1.0) { | ||
| // material->transparent = true; | ||
| // } | ||
| // delete transparentValues; | ||
| //} | ||
| //COLLADAFW::FloatOrParam shininess = effectCommon->getShininess(); | ||
| //if (shininess.getType() == COLLADAFW::FloatOrParam::FLOAT) { | ||
| // float shininessValue = shininess.getFloatValue(); | ||
| // if (shininessValue >= 0) { | ||
| // material->values->shininess = new float[1]; | ||
| // material->values->shininess[0] = shininessValue; | ||
| // } | ||
| //} | ||
| //COLLADAFW::FloatOrParam transparency = effectCommon->getTransparency(); | ||
| //if (transparency.getType() == COLLADAFW::FloatOrParam::FLOAT) { | ||
| // float transparencyValue = transparency.getFloatValue(); | ||
| // if (_options->invertTransparency) { | ||
| // transparencyValue = 1.0 - transparencyValue; | ||
| // } | ||
| // if (transparencyValue < 1.0) { | ||
| // material->values->transparency = new float[1]; | ||
| // material->values->transparency[0] = transparencyValue; | ||
| // material->transparent = true; | ||
| // } | ||
| //} | ||
| //auto bumpTextureIt = _extrasHandler->bumpTextures.find(effect->getUniqueId()); | ||
| //if (bumpTextureIt != _extrasHandler->bumpTextures.end()) { | ||
| // material->values->bumpTexture = fromColladaTexture(effectCommon, (*bumpTextureIt).second->samplerId); | ||
| //} | ||
| //bool doubleSided = _extrasHandler->doubleSided.find(effect->getUniqueId()) != _extrasHandler->doubleSided.end(); | ||
| //if (doubleSided) { | ||
| // material->doubleSided = true; | ||
| //} | ||
| //_effectTextureMapping[effectId] = textureMapping; | ||
| //_effectInstances[effectId] = material; |
Contributor
There was a problem hiding this comment.
Unless there's a specific reason to keep it in, it might be a good idea to remove this commented code.
Comment on lines
+97
to
+145
| //std::shared_ptr<Mesh> DAENodeBuilder::BuildSkin(std::shared_ptr<DAESkinController> controller) { | ||
| // | ||
| // int n0 = controller->data->getNumberOfComponents(); | ||
| // int n = n0; | ||
| // /// Asset3D do NOT support more than 4 joints/weights per vertex | ||
| // if (n > MAX_JOINT_INFLUENCES) { | ||
| // TRACE_WARN(DAENodeBuilder, "Asset 3D currently accept ONLY %x joints influences - given %x joints - extra items will be ignored.", MAX_JOINT_INFLUENCES, n); | ||
| // n = MAX_JOINT_INFLUENCES; | ||
| // } | ||
| // | ||
| // controller->meshBuilder->Save(); | ||
| // | ||
| // /// assign weight and joint to underlying primitives | ||
| // for (auto geom : controller->meshBuilder->GetGeometries()) { | ||
| // | ||
| // /// get an ordered list of used vertex (POSITION semantic) inside this primitive | ||
| // std::vector<uint32_t> mapping = geom->GetOriginalIndices(); | ||
| // std::vector<uint32_t> indices = geom->GetIndices(); | ||
| // | ||
| // /** | ||
| // * assign weigth & joints. We gona flatten array[][n]. | ||
| // */ | ||
| // size_t size = controller->data->weights.size() * n; | ||
| // std::vector<float> weights; | ||
| // weights.reserve(size); | ||
| // std::vector<uint32_t> joints; | ||
| // joints.reserve(size); | ||
| // | ||
| // for (int i = 0; i != mapping.size(); i++) { | ||
| // | ||
| // uint32_t originalIndex = mapping[i]; | ||
| // uint32_t index = indices[i]; | ||
| // float* weight = controller->data->weights[originalIndex]; | ||
| // uint32_t* joint = controller->data->jointIndices[originalIndex]; | ||
| // uint32_t offset = index * n0; // we seek offset using original number of component | ||
| // | ||
| // /// note : keeping in mind as indices are describnig faces, this should be repeated several time at the same offset | ||
| // joints.insert(joints.begin() + offset, joint, joint + n); | ||
| // weights.insert(weights.begin() + offset, weight, weight + n); | ||
| // } | ||
| // | ||
| // geom->WithJoints(std::move(joints), std::move(weights)); | ||
| // } | ||
| // | ||
| // std::shared_ptr<Mesh> mesh = controller->meshBuilder->Build(); | ||
| // controller->meshBuilder->Restore(); | ||
| // | ||
| // return mesh; | ||
| //} |
Contributor
There was a problem hiding this comment.
Unless there's a specific reason to keep it in, it might be a good idea to remove this commented code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial COLLADA Pull Resquest