### Mixed-resolution particle rendering in T3D

• 1
• 2

#### Mixed-resolution particle rendering in T3D

LukasPJ
Posts: 444
Joined: Tue Feb 03, 2015 7:25 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.

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:

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:

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

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:

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!

#### Re: Mixed-resolution particle rendering in T3D

buckmaster
DEVGRU
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
Note that the PR has been merged, and will be in 3.7 .

#### Re: Mixed-resolution particle rendering in T3D

LukasPJ
Posts: 444
Joined: Tue Feb 03, 2015 7:25 pm

Copy-pasta mistake

#### Re: Mixed-resolution particle rendering in T3D

Ron Kapaun
Posts: 28
Joined: Thu Feb 05, 2015 3:46 am
Give me a link to the PBR merge please. I wanna test it!

#### Re: Mixed-resolution particle rendering in T3D

LukasPJ
Posts: 444
Joined: Tue Feb 03, 2015 7:25 pm

PBR merge? I didn't know that had gone into testing yet?

#### Re: Mixed-resolution particle rendering in T3D

Ron Kapaun
Posts: 28
Joined: Thu Feb 05, 2015 3:46 am
Well, Lukas, give me a link.... again, I wanna test it!

#### Re: Mixed-resolution particle rendering in T3D

LukasPJ
Posts: 444
Joined: Tue Feb 03, 2015 7:25 pm

You are talking about Physically Based Rendering right? I think it's still on the theoretical stage Defferred Shading has been primary focus so far.

#### Re: Mixed-resolution particle rendering in T3D

Ron Kapaun
Posts: 28
Joined: Thu Feb 05, 2015 3:46 am
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.

#### Re: Mixed-resolution particle rendering in T3D

LukasPJ
Posts: 444
Joined: Tue Feb 03, 2015 7:25 pm

I think one of the game changers closer to becoming a reality is @ andrewmac 's Offline LPV:

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.

#### Re: Mixed-resolution particle rendering in T3D

Azaezel
DEVGRU
Posts: 495
Joined: Tue Feb 03, 2015 9:50 pm

On Topic: Thnis is very, very cool.

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

#### Who is online

Users browsing this forum: Bing [Bot] and 10 guests