Rename cotangent to bitangent
This commit is contained in:
parent
234c6fa5ee
commit
d9d42d05e9
|
@ -688,6 +688,9 @@
|
|||
"type": "string"
|
||||
}]
|
||||
}
|
||||
},
|
||||
"normalSource": {
|
||||
"enum": ["normal", "tangent", "-tangent", "bitangent", "-bitangent"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -247,10 +247,10 @@ std::string CFileDefinition::GetVertexBuffer(std::shared_ptr<ExtendedMesh> mesh,
|
|||
requestedName += "_ntangent";
|
||||
break;
|
||||
case VertexType::POSUVCotangent:
|
||||
requestedName += "_cotangent";
|
||||
requestedName += "_bitangent";
|
||||
break;
|
||||
case VertexType::POSUVMinusCotangent:
|
||||
requestedName += "_ncotangent";
|
||||
requestedName += "_nbitangent";
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ VertexType convertNormalSourceToVertexType(NormalSource normalSource) {
|
|||
return VertexType::POSUVTangent;
|
||||
case NormalSource::MinusTangent:
|
||||
return VertexType::POSUVMinusTangent;
|
||||
case NormalSource::CoTangent:
|
||||
case NormalSource::Bitangent:
|
||||
return VertexType::POSUVMinusCotangent;
|
||||
case NormalSource::MinusCotangent:
|
||||
return VertexType::POSUVMinusCotangent;
|
||||
|
|
|
@ -20,7 +20,7 @@ enum class NormalSource {
|
|||
Normal,
|
||||
Tangent,
|
||||
MinusTangent,
|
||||
CoTangent,
|
||||
Bitangent,
|
||||
MinusCotangent,
|
||||
};
|
||||
|
||||
|
|
|
@ -147,10 +147,10 @@ NormalSource parseMaterialNormalSource(const YAML::Node& node) {
|
|||
if (name == "-tangent") {
|
||||
return NormalSource::MinusTangent;
|
||||
}
|
||||
if (name == "cotangent") {
|
||||
return NormalSource::CoTangent;
|
||||
if (name == "bitangent") {
|
||||
return NormalSource::Bitangent;
|
||||
}
|
||||
if (name == "-cotangent") {
|
||||
if (name == "-bitangent") {
|
||||
return NormalSource::MinusCotangent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ void pointLightableMeshInit(struct PointLightableMesh* mesh, Vtx* inputVertices,
|
|||
|
||||
mesh->vertexNormals = malloc(sizeof(struct Vector3) * vertexCount);
|
||||
mesh->vertexTangents = malloc(sizeof(struct Vector3) * vertexCount);
|
||||
mesh->vertexCoTangents = malloc(sizeof(struct Vector3) * vertexCount);
|
||||
mesh->vertexBitangents = malloc(sizeof(struct Vector3) * vertexCount);
|
||||
mesh->oututVertices = malloc(sizeof(Vtx) * vertexCount);
|
||||
mesh->inputVertices = inputVertices;
|
||||
mesh->drawCommand = malloc(sizeof(Gfx) * gfxCommandCount);
|
||||
|
@ -137,7 +137,7 @@ void pointLightableMeshInit(struct PointLightableMesh* mesh, Vtx* inputVertices,
|
|||
|
||||
mesh->oututVertices[i] = mesh->inputVertices[i];
|
||||
|
||||
vector3Cross(normal, tangent, &mesh->vertexCoTangents[i]);
|
||||
vector3Cross(normal, tangent, &mesh->vertexBitangents[i]);
|
||||
}
|
||||
|
||||
Gfx* currGfx = mesh->drawCommand;
|
||||
|
@ -172,7 +172,7 @@ void pointLightableCalc(struct PointLightableMesh* mesh, struct Transform* meshT
|
|||
|
||||
float perpDistnace = vector3Dot(&mesh->vertexNormals[i], &offset);
|
||||
float tangentDistnace = vector3Dot(&mesh->vertexTangents[i], &offset);
|
||||
float coTangentDistnace = vector3Dot(&mesh->vertexCoTangents[i], &offset);
|
||||
float coTangentDistnace = vector3Dot(&mesh->vertexBitangents[i], &offset);
|
||||
|
||||
float uvWorldSize = RENDERED_LIGHT_TEX_SIZE * perpDistnace / RENDERED_LIGHT_HEIGHT;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ struct PointLight {
|
|||
struct PointLightableMesh {
|
||||
struct Vector3* vertexNormals;
|
||||
struct Vector3* vertexTangents;
|
||||
struct Vector3* vertexCoTangents;
|
||||
struct Vector3* vertexBitangents;
|
||||
Vtx* inputVertices;
|
||||
Vtx* oututVertices;
|
||||
Gfx* drawCommand;
|
||||
|
|
Loading…
Reference in a new issue