Mixed-resolution particle rendering in T3D

  • 1
  • 2
11 posts Page 1 of 2
LukasPJ
Site Admin
Posts: 426
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Wed Feb 04, 2015 12:27 pm

They tricked me!

I thought MixedResolution particle rendering was already implemented!
And in some ways it are... You see a lot of the functionality is already in there, but it needs a few changes to actually work!

I've managed to get it working and the performance boost is great!

Code: Select all

2 emitters, 1000 particles per second: Highres 27 MSPF // 8.5 MSPF hit MixedRes: 20 MSPF // 1.5 MSPF hit No emitters: 18.5 MSPF
For those of you who doesn't know, MSPF is milliseconds per frame.

WOW such a high performance boost for free????
Well yea... No, not really...

You see, the way this works is that we render the particles to a render target with 1/4 resolution of the main render target such that we significantly reduce the amount of pixels rendered.
This is especially useful if you suffer from overdraw performance issues, which happens when the camera is looking at particles up close such that each particle has to be drawn to each pixel.
However doing this introduces some halo-artifacts because of the lower resolution:

Image


These halo artifacts can only be fixed by doing a high-res render... So what do we do? We do a high-res render! But to improve performance we do it ONLY where these artifacts occur! Well, how do we do that? We use the edge buffer from the EdgeDetect PostFx!
It looks like this:

Image


And then when we composite the high-res and the low-res render, we get the final result!

Image


So what was this I said about it not being free? Well the impact from doing this, is ofc the fact that we render the particles at 1/4 resolution, which makes the particles blurrier:

Image


All of this is also explained at Nvidia's GPU Gems.

This effect gets enabled when you set "HighResOnly" to false, and in stock T3D, it doesn't work at all. I'll be PR'ing a fix soon.

Why are these features not active? :(

I see so many of these unused features which are somewhat implemented in T3D, just not quite "finished". How many more are there?

There are more stuff on the particle side of T3D that has these hidden gems. The Particles shader has code that takes a lightmap and it seems to be lighting the particles in a way. Having lit particles could be awesome! Why aren't there any notes on what is needed to finish this? :(

Also the RenderParticleMgr has these:
const bool RenderToParticleTarget = true;
const bool RenderToSingleTarget = true;
I don't get it.. It works fine with rendering to a single target, what do we get from setting these to false and what are they supposed to do?

I think we should make an initiative to create a list of all these hidden features when we stumble upon them, and maybe a way to write down notes on the features such that we have a better ground to work from if we want to enable one of these features! Some of them are really great!

Edit: PR has been merged!
buckmaster
Steering Committee
Steering Committee
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
by buckmaster » Thu Feb 05, 2015 1:07 am
Note that the PR has been merged, and will be in 3.7 :D.
LukasPJ
Site Admin
Posts: 426
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Thu Feb 05, 2015 1:11 am
Copy-pasta mistake :P
Ron Kapaun
Posts: 28
Joined: Thu Feb 05, 2015 3:46 am
by Ron Kapaun » Mon Feb 16, 2015 8:57 pm
Give me a link to the PBR merge please. I wanna test it!
LukasPJ
Site Admin
Posts: 426
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Mon Feb 16, 2015 9:18 pm
PBR merge? I didn't know that had gone into testing yet?
Ron Kapaun
Posts: 28
Joined: Thu Feb 05, 2015 3:46 am
by Ron Kapaun » Mon Feb 16, 2015 10:08 pm
Well, Lukas, give me a link.... again, I wanna test it!
LukasPJ
Site Admin
Posts: 426
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Mon Feb 16, 2015 10:12 pm
You are talking about Physically Based Rendering right? I think it's still on the theoretical stage :P Defferred Shading has been primary focus so far.
Ron Kapaun
Posts: 28
Joined: Thu Feb 05, 2015 3:46 am
by Ron Kapaun » Mon Feb 16, 2015 10:24 pm
Cool, I seriously thought I missed something that was 'complete'. If you are not tracking it being 'good to go' then I am all about waiting. PBR (physically based rendering) in a practical sense would be a game changer for T3D. I know and am following the current work. Just thought I might have missed something. Too be honest, I get the PBR thing, but at the SAME time, whoever is doing it NEEDS to make MASSIVE changes to the material tools as well. (since PDR uses 'special' mats).

Oh yeah, I get the deferred shading v. deferred lighting but, in the end.... isn't it just 50% and half a dozen of another? Just asking since I STOPPED following once CryEngine 2 came out. i see where one v. the other can make a difference but.... I don't see any (mathematically) difference in performance.
LukasPJ
Site Admin
Posts: 426
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Mon Feb 16, 2015 10:39 pm
I think one of the game changers closer to becoming a reality is @ andrewmac 's Offline LPV:
Image

Ain't she a beauti?

Anyways, the only difference is that deferred shading is more flexible (and necessary for PBR). Performance wise, they are a little different but in general comparable.
Azaezel
Posts: 463
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Mon Feb 16, 2015 11:38 pm
On Topic: Thnis is very, very cool.

Off topic for Ron: http://forums.torque3d.org/viewtopic.php?f=9&t=55
  • 1
  • 2
11 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 1 guest