# Difference Tiled and Clustered shading

This topic is 1861 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites

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)

##### Share on other sites

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 ?

Edited by Alundra

##### Share on other sites

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

##### Share on other sites

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_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.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634091
• Total Posts
3015433
×