fix: D3D12 sphere rendering - correct matrix math, enable depth test, add texture sampling
- Fix TranslationMatrix to use correct indices (m12/m13/m14 for translation) - Fix PerspectiveMatrix projection formula - Enable depth testing (was disabled) - Add texture sampling in pixel shader - Adjust sphere radius to 1.0 and position to z=5 - Fix D3D12Buffer copy size calculation
This commit is contained in:
@@ -99,7 +99,7 @@ bool D3D12Buffer::InitializeWithData(ID3D12Device* device, ID3D12GraphicsCommand
|
||||
D3D12_RESOURCE_DESC d3d12TempResourceDesc = {};
|
||||
d3d12TempResourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
|
||||
d3d12TempResourceDesc.Alignment = 0;
|
||||
d3d12TempResourceDesc.Width = memorySizeUsed;
|
||||
d3d12TempResourceDesc.Width = size;
|
||||
d3d12TempResourceDesc.Height = 1;
|
||||
d3d12TempResourceDesc.DepthOrArraySize = 1;
|
||||
d3d12TempResourceDesc.MipLevels = 1;
|
||||
@@ -129,7 +129,7 @@ bool D3D12Buffer::InitializeWithData(ID3D12Device* device, ID3D12GraphicsCommand
|
||||
memcpy(pDstTempBuffer, pSrcData, size);
|
||||
tempBufferObject->Unmap(0, nullptr);
|
||||
|
||||
commandList->CopyBufferRegion(m_resource.Get(), 0, tempBufferObject, 0, subresourceFootprint.Footprint.Width);
|
||||
commandList->CopyBufferRegion(m_resource.Get(), 0, tempBufferObject, 0, size);
|
||||
|
||||
D3D12_RESOURCE_BARRIER barrier = {};
|
||||
barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
|
||||
|
||||
Reference in New Issue
Block a user