Skip to content

Commit

Permalink
https://github.com/KhronosGroup/glTF/issues/189
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrobinet committed Jan 31, 2014
1 parent bb841aa commit b1213b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions converter/COLLADA2GLTF/shaders/commonProfileShaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ namespace GLTF
return techniqueHash;
}

bool writeShaderIfNeeded(const std::string& shaderId, GLTFConverterContext& converterContext)
bool writeShaderIfNeeded(const std::string& shaderId, GLTFConverterContext& converterContext, unsigned int type)
{
shared_ptr <JSONObject> shadersObject = converterContext.root->createObjectIfNeeded("shaders");

Expand All @@ -293,7 +293,7 @@ namespace GLTF
std::string path = shaderId+".glsl";
shadersObject->setValue(shaderId, shaderObject);
shaderObject->setString("path", converterContext.resourceOuputPathForPath(path));

shaderObject->setUnsignedInt32("type", type);
//also write the file on disk
std::string shaderString = converterContext.shaderIdToShaderString[shaderId];
if (shaderString.size() > 0) {
Expand Down Expand Up @@ -1116,8 +1116,8 @@ namespace GLTF
converterContext.shaderIdToShaderString[shaderVS] = vs->source();
converterContext.shaderIdToShaderString[shaderFS] = fs->source();

writeShaderIfNeeded(shaderVS, converterContext);
writeShaderIfNeeded(shaderFS, converterContext);
writeShaderIfNeeded(shaderVS, converterContext, converterContext.profile->getGLenumForString("VERTEX_SHADER"));
writeShaderIfNeeded(shaderFS, converterContext, converterContext.profile->getGLenumForString("FRAGMENT_SHADER"));

shared_ptr <JSONObject> programsObject = converterContext.root->createObjectIfNeeded("programs");
std::string programID = "program_" + GLTFUtils::toString(programsObject->getKeysCount());
Expand Down

0 comments on commit b1213b5

Please sign in to comment.