11.15
This commit is contained in:
@@ -63,7 +63,7 @@ void TestVertexShader::process(size_t index, void* outputVertex, davinci::fVecto
|
||||
static const float32_t DEFAULT_POSITION[] = {0.f, 0.f, 0.f};
|
||||
static const float32_t DEFAULT_NORMAL[] = { 0.f, 0.f, 0.f };
|
||||
static const float32_t DEFAULT_TEXCOORD0[] = { 0.f, 0.f};
|
||||
static const float32_t DEFAULT_TANGENT[] = { 1.f, 0.f, 0.f };
|
||||
static const float32_t DEFAULT_TANGENT[] = { 1.f, 0.f, 0.f, 1.f };
|
||||
|
||||
const davinci::UniformBuffer& uniformBuffer = m_pipe->getUniformBuffer();
|
||||
|
||||
@@ -73,7 +73,7 @@ void TestVertexShader::process(size_t index, void* outputVertex, davinci::fVecto
|
||||
|
||||
davinci::fVector2 a_uv(m_TEXCOORD_0 ? (const float32_t*)(m_TEXCOORD_0->getElement(index)) : DEFAULT_TEXCOORD0);
|
||||
|
||||
davinci::fVector3 a_tangent(m_TANGENT ? (const float32_t*)(m_TANGENT->getElement(index)) : DEFAULT_TANGENT);
|
||||
davinci::fVector4 a_tangent(m_TANGENT ? (const float32_t*)(m_TANGENT->getElement(index)) : DEFAULT_TANGENT);
|
||||
|
||||
davinci::fMatrix4 mat_world = davinci::fMatrix4::IDENTITY;
|
||||
if (davinci::fMatrix4* p_mat_world = (davinci::fMatrix4*)(uniformBuffer.getAttribute("self:world_transform")))
|
||||
@@ -108,8 +108,8 @@ void TestVertexShader::process(size_t index, void* outputVertex, davinci::fVecto
|
||||
matNormal = *p_mat_normal;
|
||||
}
|
||||
davinci::fVector3 v_normal = (matNormal * davinci::fVector4(a_normal, 0)).xyz().normalise();
|
||||
davinci::fVector3 v_tangent = (matNormal * davinci::fVector4(a_tangent, 0)).xyz().normalise();
|
||||
davinci::fVector3 v_binormal = v_normal.crossProduct(v_tangent).normalise();
|
||||
davinci::fVector3 v_tangent = (matNormal * davinci::fVector4(a_tangent.xyz(), 0)).xyz().normalise();
|
||||
davinci::fVector3 v_binormal = v_normal.crossProduct(v_tangent).normalise();// *a_tangent.w;
|
||||
|
||||
davinci::fMatrix3 tbnMatrix = davinci::fMatrix3(
|
||||
v_tangent.x, v_binormal.x, v_normal.x,
|
||||
|
||||
Reference in New Issue
Block a user