Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thomas, 2008-06-18, "Character version 2.0"
starstutter Offline
Junior Member

Posts: 8
Threads: 0
Joined: Jun 2008
Reputation: 0
#15
RE: Thomas, 2008-06-18, "Character version 2.0"

Thomas Wrote:As for deferred shadowing, if you mean that you render the shadow map result(s) to texture and then using them in the light rendering then that is used by Crysis. That technique is mostly for forward shading though, so perhaps you mean something else.

I read the paper on the cryengine and while the techniqe is somewhat similar, it's not what I had done. There is no forward rendering of the shadowing results. By results I mean (and I guess you mean) is the final output from sampling the depth map. This techniqe is different, it works on the same principle as deferred lighting where not a single invisible pixel gets depth tested.

It's done in 3 fairly quick passes:

1. Render the depth scene from the lights point of view (whatever resolution that may be)

2. In a forward rendering pass, render all the geometry in your view fulstrum (from your point of view) to a seperate render target. As an optimization, you can preform culling for both the light's fulstrum and the camera fulstrum at the same time. To these surfaces, preform no depth testing, but use a floating point render target to record the SM coordinates to each surface (the 0 to 1 2d measurement of the projection matrix). R and G hold the sm coordinates, B holds the distance away from the shadowmap (in w coordinates of course). Unfortunatley this render target needs to be 4 channels with 32 bits for each to avoid precision problems with storing the depth.

3. In the final pass, render the shadow caster as geometry (same as you would do with light) and project the previously rendered scene onto it. In the shader, extract the SM coordinates and depth, and then compare. That may not be exactly clear instructions so:

float2 coords = tex2d(coordinateTexture, screenUV).rg;
float depth = tex2d(coordinateTexture, screenUV).b;
*then for sampling:*
float result;
for (i = 0; i < numsamples)
{
result = (depth < tex2d(depthMap, coords + jitteredDisk[i]))? 0:1;
}
result /= numsamples;

Personally, the results for me when moving to this method were:
Forward shadowing: 1024 sm with 8 samples : 65 fps
Deferred shadowing: 2048 sm with 11 samples + screen space (smart depth) blur : 62 fps

Thanks for taking the time to listen btw Smile
06-30-2008, 07:38 PM
Find


Messages In This Thread



Users browsing this thread: 1 Guest(s)