![]() ![]() This transfer from laboratory to large wind tunnels brings along different kinds of problems. One of the main objectives of EUROPIV was to demonstrate the applicability of PIV to large industrial wind tunnel experiments. Removing the offset does not fix the issue.The PIV technique is widely applied at laboratory scale. The GPU instancing shader I'm using is copied directly from with the only change being to add Z buffer offset. I'm fine with doing that, but I wanted to post this here in case it was an unknown bug and/or there are other solutions to it. ![]() In order to keep multiple lights and GPU instancing I can switch to deferred rendering. If I use only a single light then this rendering glitch doesn't happen, if I don't use GPU instancing then it doesn't happen, or if I use deferred rendering. Here's what it looks like after the particles despawn and the mesh is swapped in (and what it's supposed to look like even as particles). ![]() My best guess is that it's some particles rendering without proper per instance data applied. It's only present while there are active particles and then disappears. There's also a light blue highlighted corner appearing that should not be there. They are only being shaded by a single light in my scene which is why it appears darker, whereas everything else has both lights applied. The sphere on the far right is actually a bunch of particles just before they are swapped out with the finished mesh. I noticed a graphical problem when using GPU instancing, multiple directional lights, and forward rendering. thanks for sharing it! It's a cool looking scene! I'm going to keep your bug open in case my bug fix can make it even faster. If you want to keep using your custom shader, take a look at this page for how to add particle instancing support to it: If I simply swap to an instanced shader, the longest frame time I see is 40ms (usually 20-30ms). With your project, I get frame times of over 500ms when many particles are being rendered. You need to either add GPU Instancing support to "Voxel Diffuse.shader", or replace it with Particles/Standard Unlit (or Surface, if you want lighting). (available since Unity 2018.1) It only requires you to use a compatible shader. The good news is that you can make this much faster by using GPU Instancing. And you have well over 20,000 mesh particles at times, in this stress test scene. Mesh particle rendering in Unity is incredibly slow if you aren't careful, because all computation happens on the CPU, for every vertex of every particle. Once I make my fix, that marker may take less time, but the FPS will still be bad because you have some very expensive mesh particle systems in use here. ![]() The main performance problem here won't be solved by any fix I hope to make for WaitForPreviousRenderingToFinish. I performed a quick and dirty test by just calling Clear on the current particle system before emitting and that made emitting much faster, but that's perhaps not a fair comparison. Is this due to the particle system needing to find gaps in its internal arrays to put the new particles? Would it be more efficient to use many separate smaller particle systems, 1 for each burst of particles, and then reuse the systems for future bursts only once all its current particles have expired? My thinking is this would make finding room to place the newly emitted particles much quicker. The Add system almost always performs significantly better than the Remove system when it comes to emitting new particles. When particles are emitted to the Add system they are all emitted with a constant lifetime, whereas the Remove voxels system has a randomized lifetime per particle. Each system has a max capacity of 20,000 particles and has particles emitted in variable sized bursts, with multiple bursts overlapping each other in time, meaning that the particles in the system have a range of different remaining lifetimes. Right now I use 2 particle systems for the effect shown above, 1 for adding voxels and 1 for removing them. I was wondering why this might be and have a few ideas. Sometimes I can emit several thousand particles in a few milliseconds, and other times a couple hundred particles or less will take over 20 milliseconds (in both cases there's still plenty of room in the system for the new particles). I was digging into my performance bottleneck with emitting particles some more and noted some surprising results. ![]()
0 Comments
Leave a Reply. |