This commit is contained in:
Branimir Karadžić
2018-12-21 18:02:39 -08:00
parent e01edc6af1
commit 63e298795d
11 changed files with 47 additions and 47 deletions

View File

@@ -236,13 +236,13 @@ void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexDecl _decl
for (uint32_t ii = 0; ii < _numVertices; ++ii)
{
const bx::Vec3 tanu = bx::load(&tangents[ii*6]);
const bx::Vec3 tanv = bx::load(&tangents[ii*6 + 3]);
const bx::Vec3 tanu = bx::load<bx::Vec3>(&tangents[ii*6]);
const bx::Vec3 tanv = bx::load<bx::Vec3>(&tangents[ii*6 + 3]);
float nxyzw[4];
bgfx::vertexUnpack(nxyzw, bgfx::Attrib::Normal, _decl, _vertices, ii);
const bx::Vec3 normal = bx::load(nxyzw);
const bx::Vec3 normal = bx::load<bx::Vec3>(nxyzw);
const float ndt = bx::dot(normal, tanu);
const bx::Vec3 nxt = bx::cross(normal, tanu);
const bx::Vec3 tmp = bx::sub(tanu, bx::mul(normal, ndt) );
@@ -998,7 +998,7 @@ int main(int _argc, const char* _argv[])
if (hasNormal)
{
float normal[4];
bx::store(normal, bx::normalize(bx::load(&normals[index.m_normal]) ) );
bx::store(normal, bx::normalize(bx::load<bx::Vec3>(&normals[index.m_normal]) ) );
bgfx::vertexPack(normal, true, bgfx::Attrib::Normal, decl, vertices);
}