For my client I am preparing a scene that is supposed to be rainy. For rain I can go with following solutions:
Fully-particle based rain, each drop is a particle (awesome quality, but there may be performance issues)
Rain as screen-space animated texture (not so good quality, no depth, but it will run on a potato)
Mix of the above
But I am not sure if Unity can handle fully particle-based rain (we’re talking about up to 100k particles at any single moment) and the client is a stubborn asshole who wants rain to be developed first, then rest of the scene, so profiling won’t yield any good results.
Anyone had similar issue before?
P.S. The scene will also have other particle-based objects such as torches and 100k figure is just for rain.
Why won’t profiling yield results? Assign your rain a time budget (say, allow it to have 6ms or something) and see how far you can get on the target device with that.
For what it’s worth, you do have other options. Eg: nearby rain per-raindrop (with raycasts for splashing) and distant rain in larger sheets (with just some random splash textures) - essentially doing LOD on your particle system.
Not sure, but you could use a big rain texture (like this, but without the droplets on the ground and cropped). This way, you can have millions of rain drops without having actually millions of particles. Would that work?
Because client in question wants this fast and wants rain being shown first (and then develop rest of the scene which will add drawcalls and geometry).
//edit: And I wouldn’t worry about client reading this, he doesn’t even know English, let alone have any interest in programming forums. Ever heard of Vince Perri? Yeah, guy’s kinda like that.
Yeah… which you can work around by setting budgets. Just because you’re doing rain first doesn’t mean you have to max out the device on the rain alone.
What is it for? Do you need 100k particles at the same time or only in the scene? I suggest having multiple particle systems and only enabling the nearest/nearer one(s). Also, profile. You can still do it just to get an idea of the performance impact. Might want to check out some Asset Store items as well, like Liquidium (have not used it myself).
I cannot recommend you PAParticleField enough. It runs all the particles using the GPU in a single drawcall and has helped me a lot squeezing the performance out of my game.
Just look at the demo: Popup Asylum and choose the “Rain” scene… I think it is exactly what you want!
I wonder if you could have a texture with the depth painted in then merge it with the screen? I would have a particle effect attached to the player and a few inverted cylinders centered on the player with a animated texture for the distant rain. Just an idea, I haven’t tried this method.
Have you ever seen rain? I challenge you to identify 100K raindrops next time you are outside. The idea is just ridiculous.
You would build multiple particle systems that are always centred on the player. Anything close to the player gets an accurate rain simulation. As you move further and further out the simulation becomes less accurate, using bigger and bigger particle sheets.
It’s also worth noting that good looking rain takes a lot of work. It can be one of the most impressive graphical features of a game. Your client is probably right to want it done first. It lets you prove your worth. It also lets you stress test the most intense feature if the game.
Just be prepared that on mobile devices alpha overdraw can be an issue. So adding 1000 particles might be a better solution than adding 100 particles where each particle is pretty big and contains a lot of raindrops.
You didn’t even mention if it’ll be a 3d game or 2d game. If it’ll be a 3d game, will you be able to navigate the scene or you will be stationary? Mobile or desktop.
Why do you think that a full screen effect will run on a potato, for all I know, and as @kalamona said, it might be actually cheaper to run 1k particles than a full screen animated texture.
haha! This is amazing, either it’s staged or this is the best thing ever! Seriously @darkhog if you are going to be doing freelance, be professional enough where you don’t insult your client in a public forum.