Difference Tiled and Clustered shading

Started by
3 comments, last by Alundra 10 years, 5 months ago

Hi all,

My question is quite simple : "The only difference between Tiled and Clustered shading is clustered adds a dimension ?".

If the answer is yes, the only difference is the grid storage (x/y -> x/y/z) and the cull test to add in the cell of the grid ?

Thanks

Advertisement

Essentially yes. Though IIRC, the author of the original clustered shading whitepaper talks about adding in several dimensions, by also breaking the shading into similar angles.
So its (x/y) -> (position x/ position y/ position z/ normal x / normal z)

One probleme is to store light indices since the array is not always the same size and using the "max theorically" the memory size is pretty impossible.

So using a worst case must be used but, if we say we allow 1024 point lights and 1024 spot lights, a good pool is 4*1024*1024 ?

One probleme is to store light indices since the array is not always the same size and using the "max theorically" the memory size is pretty impossible.

So using a worst case must be used but, if we say we allow 1024 point lights and 1024 spot lights, a good pool is 4*1024*1024 ?

The way we implemented it is to allocate a 'reasonable' buffer and then to grow it when (if) needed.

I think Emil covered how they deal with this in our talk from Siggraph this year:

'Practical Clustered Deferred and Forward Shading'

This talk should provide a few insights into both the general gist of the algorithm and the practical implementation at Avalanche.

Hope it helps.

.ola

Thanks for the answer, actually I used the way of static buffer as a pool :


D3D11_BUFFER_DESC LightIndicesBufferDesc =
{
  4 * 1024 * 1024 * sizeof( UInt32 ),
  D3D11_USAGE_DYNAMIC,
  D3D11_BIND_SHADER_RESOURCE,
  D3D11_CPU_ACCESS_WRITE,
  D3D11_RESOURCE_MISC_BUFFER_STRUCTURED,
  sizeof( UInt32 )
};

Actually I have the clustered forward shading working on D3D11, I have some issue that need to work (some ceil/floor missed I guess).

I only compute the bounding sphere, on the paper of Emil, he does a special code for the point light using planes.

I don't have really understand well the plane-intersection code so I stay with bounding sphere only who is not so bad.

My implementation is CPU based, that works nicely but the perf go fast down around 100 lights with the sponza mesh.

The problem with the compute shader is to sync data to have the good offset + indices working.

This topic is closed to new replies.

Advertisement