Added more models
Fixed issue with material only parts of meshs not being rendered
This commit is contained in:
@ -63,10 +63,18 @@ void SubMeshRenderer::RenderChild(SceneNodePointer node, bool renderTransparent)
|
||||
_cBuffer.specularCoefficient = material->GetSpecularColour();
|
||||
_cBuffer.shininess = material->GetShininess();
|
||||
_cBuffer.opacity = opacity;
|
||||
// Update the constant buffer
|
||||
// Update the constant buffer
|
||||
_texture = material->GetTexture();
|
||||
if (_texture == nullptr)
|
||||
{
|
||||
_cBuffer.validTexture = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_cBuffer.validTexture = 1;
|
||||
}
|
||||
_deviceContext->VSSetConstantBuffers(0, 1, _constantBuffer.GetAddressOf());
|
||||
_deviceContext->UpdateSubresource(_constantBuffer.Get(), 0, 0, &_cBuffer, 0, 0);
|
||||
_texture = material->GetTexture();
|
||||
_deviceContext->PSSetShaderResources(0, 1, _texture.GetAddressOf());
|
||||
_deviceContext->PSSetConstantBuffers(0, 1, _constantBuffer.GetAddressOf());
|
||||
_deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
Reference in New Issue
Block a user