Changed color values from floats to glm::vec4

This commit is contained in:
antc13
2016-01-24 14:18:04 +01:00
parent b5b1140f5c
commit 8286d052b3
6 changed files with 18 additions and 8 deletions
+1
View File
@@ -45,6 +45,7 @@ void DrawFinalPass::Draw(RenderScene& scene)
//TODO: Kolla upp "header/include/common" shader saken så man slipper skicka in asmycket uniforms
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(modelJob->Color));
glUniform4fv(glGetUniformLocation(shaderHandle, "DiffuseColor"), 1, glm::value_ptr(modelJob->DiffuseColor));
if(modelJob->DiffuseTexture != nullptr) {
glActiveTexture(GL_TEXTURE0);
+3 -3
View File
@@ -138,11 +138,11 @@ void RawModelCustom::ReadMaterialSingle(unsigned int &offset, char* fileData, un
newMaterial.ReflectionFactor = *(float*)(fileData + offset);
offset += sizeof(float);
memcpy(newMaterial.DiffuseColor, fileData + offset, sizeof(float) * 3);
memcpy(&newMaterial.DiffuseColor[0], fileData + offset, sizeof(float) * 3);
offset += sizeof(float) * 3;
memcpy(newMaterial.SpecularColor, fileData + offset, sizeof(float) * 3);
memcpy(&newMaterial.SpecularColor[0], fileData + offset, sizeof(float) * 3);
offset += sizeof(float) * 3;
memcpy(newMaterial.IncandescenceColor, fileData + offset, sizeof(float) * 3);
memcpy(&newMaterial.IncandescenceColor[0], fileData + offset, sizeof(float) * 3);
offset += sizeof(float) * 3;
newMaterial.StartIndex = *(unsigned int*)(fileData + offset);
+1 -1
View File
@@ -90,7 +90,7 @@ void Skeleton::AccumulateBoneTransforms(bool noRootMotion, const Animation::Keyf
int k = 0;
} else {
if (bone->Parent) {
boneMatrix = parentMatrix * bone->Parent->OffsetMatrix * glm::translate(glm::vec3(1.718, 0, 0)); // * glm::inverse(bone->OffsetMatrix);
boneMatrix = parentMatrix; // * glm::inverse(bone->OffsetMatrix);
}
boneMatrices[bone->ID] = boneMatrix; // * bone->OffsetMatrix;
}