Skip to content
Snippets Groups Projects
Commit dc25bef6 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Fixed an issue with instance counters that lead to some lines not being...

Fixed an issue with instance counters that lead to some lines not being rendered. How this didn't just crash completely is beyond me.
parent 39943cb7
No related branches found
No related tags found
No related merge requests found
......@@ -543,6 +543,8 @@ void UGPUInstancedLineComponent::AddBulkInternal(int32 NumberOfLines, int32 Numb
DummyTransforms.SetNum(NumberOfLines * NumberOfSegmentsPerLine);
AddInstances(DummyTransforms, false);
int32 InstanceCounter = 0;
for (int32 LineIndex = 0; LineIndex < NumberOfLines; ++LineIndex)
{
const FLinearColor Color = UniformColor ? Colors[0] : Colors[LineIndex];
......@@ -554,11 +556,10 @@ void UGPUInstancedLineComponent::AddBulkInternal(int32 NumberOfLines, int32 Numb
for (int32 PointIndex = 0; PointIndex < NumberOfSegmentsPerLine; ++PointIndex)
{
//const int32 InstanceId = AddNewSegmentInstance(Color, Width, CurrentTextureIndex);
const int32 InstanceId = CurrentTextureIndex;
InitializeCreatedSegmentInstance(InstanceId, Color, Width, CurrentTextureIndex);
NewLineArray.IndexArray.Add({ InstanceId, LineIndex * (NumberOfSegmentsPerLine + 1) + PointIndex });
InitializeCreatedSegmentInstance(InstanceCounter, Color, Width, CurrentTextureIndex);
NewLineArray.IndexArray.Add({ InstanceCounter, LineIndex * (NumberOfSegmentsPerLine + 1) + PointIndex });
CurrentTextureIndex++;
InstanceCounter++;
MoveTextureMarker();
}
NewLineArray.IndexArray.Add({ -1, LineIndex * (NumberOfSegmentsPerLine + 1) + NumberOfSegmentsPerLine });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment