I don’t know how to describe this but lighting on objects made similar to the Dynamic Geometry sample feel more “on point” with a Directional Light point in a general direction.
Here’s what the regular cube .mdl looks like in the Directional light. (The light’s direction is 0.6f, -1.0f, 0.8f)
Here’s what a custom object with a cube model looks like in the Directional light.
The custom object cube light seems to be more “on-point” or “specific” and less spread out compared to the .mdl
Here’s how a vertex is in my custom objects
//position normals color tmap tangents
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, color.r_, color.g_, color.b_, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
And I calculate normals and tangent this way, doesn’t seem to glitch the vertices at all so it seems fine.
for (int iter = 0; iter < vertexData.size(); iter += 15) {
ur::Vector3 vertex = { vertexData[iter], vertexData[iter + 1], vertexData[iter + 2] };
vertex.Normalize();
vertex.Normalize();
vertexData[iter + 3] = vertex.x_;
vertexData[iter + 4] = vertex.y_;
vertexData[iter + 5] = vertex.z_;
}
ur::GenerateTangents(vertexData.data(), 15 * sizeof(float), indexData, sizeof(unsigned short), 0, numIndices, 3 * sizeof(float), 9 * sizeof(float), 11 * sizeof(float));
Is there any reason behind the custom object’s lighting looking more “specific”?