Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions trinity/Eve/EveInstancedMeshManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ void EveInstancedMeshManager::AddMeshGroup(
false,
true };
auto& instances = m_meshInstances[key];
instances.material = material;
if( instances.radius == 0 )
{
auto meshData = geometry->GetMeshData( meshIndex );
Expand All @@ -323,6 +322,7 @@ void EveInstancedMeshManager::AddMeshGroup(
meshGroup.handle = &handle;
meshGroup.owner = pickingOwner;
meshGroup.ownerIndex = pickingOwnerIndex;
meshGroup.material = material;
handle.owner = this;
handle.index = static_cast<uint32_t>( instances.meshGroups.size() - 1 );

Expand Down Expand Up @@ -360,7 +360,6 @@ void EveInstancedMeshManager::AddMeshGroup(
areaCount,
areaReversed };
auto& instances = m_meshInstances[key];
instances.material = material;
if( instances.radius == 0 )
{
auto meshData = geometry->GetMeshData( meshIndex );
Expand All @@ -387,6 +386,7 @@ void EveInstancedMeshManager::AddMeshGroup(
meshGroup.handle = &handle;
meshGroup.owner = pickingOwner;
meshGroup.ownerIndex = pickingOwnerIndex;
meshGroup.material = material;
handle.owner = this;
handle.index = static_cast<uint32_t>( instances.meshGroups.size() - 1 );

Expand Down Expand Up @@ -853,7 +853,7 @@ void EveInstancedMeshManager::GetPickingBatches( EvePendingPickingReadback& read
uint32_t stride = uint32_t( mesh.isDynamic ? sizeof( DynamicPerInstanceBufferElement ) : sizeof( StaticPerInstanceBufferElement ) );

Tr2RenderBatch batch;
batch.SetMaterial( meshInfo.material );
batch.SetMaterial( group.material );
batch.SetGeometry( mesh.combinedVertexDeclaration, draw.lodData->m_vertexAllocation, *draw.indexRange.indices );
batch.SetStreamSource( 1, *allocation.buffer, stride );
batch.SetDrawIndexedInstanced(
Expand Down Expand Up @@ -940,7 +940,7 @@ size_t EveInstancedMeshManager::GetBatches( const std::initializer_list<std::pai
}

Tr2RenderBatch batch;
batch.SetMaterial( meshInfo.material );
batch.SetMaterial( meshInfo.meshGroups.front().material );
batch.SetGeometry( mesh.combinedVertexDeclaration, draw.lodData->m_vertexAllocation, *draw.indexRange.indices );
batch.SetStreamSource( 1, *allocation.buffer, stride );
batch.SetDrawIndexedInstanced(
Expand Down Expand Up @@ -1033,7 +1033,7 @@ void EveInstancedMeshManager::ReportUsedScreenSizes() const
{
if( auto meshData = mesh.geometry->GetMeshLod( mesh.meshIndex, 0 ) )
{
meshInfo.material->UsedWithScreenSize( meshInfo.maxScreenSize, meshInfo.radius, meshData->m_uvDensities );
meshInfo.meshGroups.front().material->UsedWithScreenSize( meshInfo.maxScreenSize, meshInfo.radius, meshData->m_uvDensities );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion trinity/Eve/EveInstancedMeshManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class EveInstancedMeshManager
const StaticPerInstanceData* staticInstances = nullptr;
const DynamicPerInstanceData* dynamicInstances;
};
Tr2EffectPtr material = nullptr;
uint32_t count = 0;
uint32_t sphereGroupIndex = 0;
uint32_t perObjectDataIndex = 0;
Expand Down Expand Up @@ -240,7 +241,6 @@ class EveInstancedMeshManager
{
std::vector<MeshGroup> meshGroups;

Tr2EffectPtr material = nullptr;
float radius = 0.0f;
float maxScreenSize = 0.0f;
uint32_t totalVisibleInstances = 0;
Expand Down
Loading