Sign in to follow this  
TheLastOfUs

What on earth is Far Cry 3's Deferred Radiance Transfer ?

Recommended Posts

TheLastOfUs    135

an someone be kind enough and explain their GDC slide to me:

 

http://fileadmin.cs.lth.se/cs/Education/EDAN35/lectures/L10b-Nikolay_DRTV.pdf

 

I just need a nice detailed description of what the system essentially is with their "probes"

 

From what I gathered...they use spherical harmonics to deduce irradiance in a scene, and the dynamic objects sample nearby probes - using a sort of voxel cone tracing on the camera which calculates for X+1 and Y-1 shift so that they don't have to essentially render every probe outside of players view?

 

Please note, I am not a game programmer..nor do I want to be one. I am just a consumer trying to gain better understanding so that I can keep up with Current Gen vs Next Gen etc

Share this post


Link to post
Share on other sites
TheLastOfUs    135

Hi,

 

Thank you SOOO much for your reply. Someone who really knows what he/she is talking about.

 

If I may ask - dynamic lights meaning gunfire and flashlights I suppose?

 

Also..could you please decipher the following from the BLACK flag team for me:

 

"LP: Our Global Illumination is based on previous work that was done internally at Ubisoft (deferred radiance transfer volumes), but we improved it greatly. Using the navmesh, we automatically populate our world with thousands of probes. For each probe, we then compute the irradiance for 8 different time of the day. Those computations are done on the build machine GPU, so they are really fast: we can compute thousands of probes per minute. At runtime, on the player machine, we then interpolate these data to get the proper bounce lighting for a given time of day, world position and weather. This bounce sun lighting is then combined with ambient occlusion and sky lighting to achieve a full indirect lighting and a Global Illumination solution. This system works on both current gen and next gen.""

 

So as I understand ...probes essentially function to hold lighting information in the form of cubemaps which are essentially textures - or are they actually equations which take light inputs from other light sources and essentially "bounce" them like a transparency reflectance object?

Share this post


Link to post
Share on other sites
FreneticPonE    3294

probes essentially function to hold lighting information in the form of cubemaps which are essentially textures

 

Pretty much correct, though instead of a cubemap they use spherical harmonics (fancy maths) to turn those textures into an approximation that uses a lot less memory. As for what they did for Black Flag, it sounds like they just made it even less dynamic, just figuring out what each probe looks like for a given time of day/weather, storing ALL of that on disc, and just blending between whatever probes were correct for the games current weather/time of day.

Share this post


Link to post
Share on other sites
TheLastOfUs    135

Pand copy them into the cells of a regular 3D grid covering the view. Instead of searching for the nearest probe, you can find it instantly by reading the grid cell that you're in. Instead of searching for the nearest probe, they can always find it at a constant cost -- this allows them to use any number of probes that they like; millions across the island if need be.
 

 

So I am so glad you mentioned this - this means they made a grid that constantly evaluates probes along the viewer's camera? So it is not dependent on probes being constantly used...but rather in the direction the dynamic character faces?

 

Considering Far Cry 3 is a 1st person game - how does it work when say a 3rd person character walks into a set?

Share this post


Link to post
Share on other sites
SimmerD    1210

 

Pand copy them into the cells of a regular 3D grid covering the view. Instead of searching for the nearest probe, you can find it instantly by reading the grid cell that you're in. Instead of searching for the nearest probe, they can always find it at a constant cost -- this allows them to use any number of probes that they like; millions across the island if need be.
 

 

So I am so glad you mentioned this - this means they made a grid that constantly evaluates probes along the viewer's camera? So it is not dependent on probes being constantly used...but rather in the direction the dynamic character faces?

 

Considering Far Cry 3 is a 1st person game - how does it work when say a 3rd person character walks into a set?

 

It's not based on direction, but rather position.  One or more nearby probes are read and blended together, depending on the XYZ of the object being rendered.

Share this post


Link to post
Share on other sites
TheLastOfUs    135

I see - still have 2 questions:

 

What happens when a 3rd person view of a character walks into the scene with probes

 

and also @ Frentic - so the way the Black Flag people did it is they calculated for weather...baked it for that, and then blended? So essentially everything for theirs is precomputed and nothing is actually very dynamic?

Share this post


Link to post
Share on other sites
Hodgman    51222

Pand copy them into the cells of a regular 3D grid covering the view. Instead of searching for the nearest probe, you can find it instantly by reading the grid cell that you're in. Instead of searching for the nearest probe, they can always find it at a constant cost -- this allows them to use any number of probes that they like; millions across the island if need be.

 
So I am so glad you mentioned this - this means they made a grid that constantly evaluates probes along the viewer's camera? So it is not dependent on probes being constantly used...but rather in the direction the dynamic character faces?
 
Considering Far Cry 3 is a 1st person game - how does it work when say a 3rd person character walks into a set?
The probes are all static / pre-generated. The grid is quite large and is *centered* around the camera. That means that when rotating the camera, the grid still covers your view.
It's only when the camera moves that the grid needs to be updated. If you move in the +X direction, then the colums of cells right at the -X edge are discarded and a new face full of columns are appended at the +X end of the cube. When appending these new cells, the costly "search" algorithm is run, which locates he closest probes to each new cell and merges them in order to generate he SH values to store in that cell.

Share this post


Link to post
Share on other sites
FreneticPonE    3294

Basically they set Black Flag to "Rainy/Afternoon" and bake what all the probes look like for that, then for all combinations of other times of day and weathers. Then, if say it's the afternoon and turning from clear to rainy in the game, they'll just blend between "Clear/Afternoon" and "Rainy/Afternoon". So all they had to do was look up two probes for each area and blend between them, which is quite cheap.

 

Whereas in Far Cry 3 they used a pre-computed radiance transfer function, which takes a given static area and calculates "If you have light here, then it's going to bounce around like this". So they could use whatever lighting they wanted and this function would produce the correct bounces for each probe. But this takes more time to compute than just looking up a texture essentially, and so they ditched that for Black Flag.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this