Jump to content

Particle rendering speed


Alienhead
 Share

Go to solution Solved by Josh,

Recommended Posts

I havent messed to much with the particle system in ultra,  but today was the day. 

I created 1 simple little emitter, 20 particles.

I placed it on the map in 3 locations and proceeded to RUN.

This is a very strong Nvidia gpu I'm using and it brought it to a crawl.. 3 little emitters sat me down to 28 fps !

image.thumb.png.0858aefecdb76284d25cc087958bb6d2.png

 

Normally I clock around 400 to 600 fps.

 

image.thumb.png.bdf8289bc92b615b570fed18c9272a2d.png

Link to comment
Share on other sites

This is happening because of the expensive lighting calculation on each pixel of each particle. The bottleneck is the 3x3 shadowmap lookup, primarily. I first noticed this in the FPS example where there's a particle emitter underneath a turning spotlight.

The solution is for me to detect transparency and only use a single shadowmap texture lookup, or to use the Unlit shader family for particles that don't need accurate lighting and shadows on them.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Josh changed the title to Particle rendering speed
  • Solution

Here is the scene I am testing with.

particlestest.zip

image.thumb.png.17a3b08fc660bc1281164c3f3a0c393d.png

180 FPS on a Radeon 6600 at 1280x720 resolution.

image.thumb.png.0a5199358234f14636f0d166417fdb5f.png

In Shaders/Base/Lighting.glsl I made a change that uses a single texture lookup if transparency is in use, and the framerate went up to 200:

#if KERNEL == 3
	if ((RenderFlags & RENDERFLAGS_TRANSPARENCY) != 0)
	{
		return texture(shadowmap, shadowcoord).r;
	}

That's a little bit faster, but not a huge improvement.

image.thumb.png.0e67e4688f241fef5e371827637b9db0.png

I then changed the particle material to use the Unlit shader family, and the framerate went way up, but particles are no longer affected by lights.

image.thumb.png.2e93e6a5963ce84feb003b7fb3c11b90.png

I can only conclude that rendering many transparent layers of lighting is expensive, and don't use it unless you really need it.

Perhaps in the future a per-vertex lighting mode will be added. This would help particle systems to blend in naturally to the surrounding lighting environment, but would be much less expensive than many layers of per-pixel lighting.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...