• Create Account

# DigiHunter

Member Since 08 Aug 2005
Offline Last Active Jan 28 2016 05:21 AM

### In Topic: Shading graphs and how they map to implementation in a game engine.

09 August 2013 - 09:23 AM

Different nodes in graph correspond to GPU computation via shaders.

It works like in post-process when you have done some effect having put result into surface of render target texture.

Then you make it  be input for the next pass with other effect.

Same way in a graph when the primary nodes have been done the next nodes can be passed. And after this process repeats.

Output from the prev node is input for the next node. It will be textures for example.

### In Topic: Energy conservation of diffuse term

09 August 2013 - 09:14 AM

Lout(y) = Integral( BRDF(x,y) * Visibility(x) * Lin(x) * cos(angle between x and normal) * dx ) over hemisphere

Energy conservation it's just

Integral( Lout(x) * dx ) <= Integral( Lin(x) * dx ) (here out and in flux density values are)

You can substitute constant Lin and Visibility equaling to 1. And in the case of diffuse term BRDF is just albedo.

It'll be

Integral( Lout(x) * dx ) <= Integral( Lin(x) * dx )  (condition of not emission)

Integral( Integral( BRDF(x,y) * Visibility(x) * Lin(x) * cos(x,n) * dx ) * dy ) <= Integral( 1 * dx )

Integral( BRDF(x,y) * 1 * 1 * cos(x,n) * dx ) * Integral( 1 * dy) <= 2 * Pi

Integral( BRDF(x,y) * cos(x,n) * dx ) * Integral( 1 * dy) <= 2 * Pi

diffuse BRDF is just constant

Integral(a * cos(x,n) * dx ) * 2 * Pi <= 2 * Pi

a * Integral(cos(x,n) * dx ) <= 1

a * Pi <= 1

a <= 1 / Pi

it's constraint for albedo

Like this way you can check different BRDF.

And also when you use direct light source in Integral over hemisphere its integration is changed by computing by single ray via delta function.

Lin(x) = delta(xlight directoin - x) * c, where c is flux density of light source, being measured in Watt /  m2 units, and delta func is measured  steradian-1.

Then

Lout(y) = Integral( BRDF(x,y) * Visibility(x) * Lin(x) * cos(x,n) * dx )

Lout(y) = Integral( BRDF(x,y) * Visibility(x) * delta(xlight directoin - x) * c * cos(x,n) * dx )

Lout(y) = BRDF(xlight directoin,y) * Visibility(xlight directoin) * c * cos(xlight directoin,n)

where Visibility(xlight directoin) is filtered sample from shadow map (for example).

### In Topic: RPG Shadows, CSM, TSM, what else?

09 August 2013 - 08:20 AM

It seems you want to have dynamic illumination with shadowing from everything on everything (aka global direct illumination).

Use CSM with PCF on Poison Kernel. It works well. This method is used in many titles in the market.

Some time ago I had been testing many others. This had given max result for scalability and perf.

Also you should use deferred tech instead forward even in large-scale scene.

And hold in mind what types of BRDF you want to see in your game. May be it's just diffuse and specular terms.

Or may be complex aniso BRDF, or may be you'll have decided to add local subsurface scattering via spherical harmonics or wavelets.

You should have chosen a good solution at the beginning, because there are 4 render targets in Direct3d9.

### In Topic: C++ rendering engines to look at for learning purposes

09 August 2013 - 07:45 AM

I would recommend you Torque3d engine (http://www.garagegames.com/products/torque-3d) which is made professionally and full featured.

PARTNERS