FLAMEGPU / FLAMEGPU2-visualiser

Cross platform real-time OpenGL visualiser for FLAMEGPU2 models.
1 stars 2 forks source link

Phantom Agent #82

Closed Robadob closed 2 years ago

Robadob commented 3 years ago

image

0 Schwann agents, but something which looks like a Schwann agent at the (presumed) origin, as though an agent is being rendered with null/empty texture buffers.

Won't investigate this as a priority, but worth leaving an issue to be aware.

Robadob commented 2 years ago

Jack A has suggested this is to do with dead agents still being rendered, will investigate further soon.

Robadob commented 2 years ago

https://github.com/FLAMEGPU/FLAMEGPU2-visualiser/blob/2bf3078b303c83e084ba91db7882e7ea9e7c0dbb/src/flamegpu/visualiser/Visualiser.cpp#L560

I think these two lines should actually be

            if (!as.second.core_texture_buffers.empty() && as.second.dataSize && as.second.requiredSize)  // Extra check to make sure buffer has been allocated successfully
                as.second.entity->renderInstances(std::min(as.second.dataSize, as.second.requiredSize));

The code was accounting for if the buffer hadn't been allocated yet (or resized for an increased agent pop), but wasn't accounting for if the buffer was larger than the current required size (or if there were no agents).