Jump to content
  • Advertisement
Sign in to follow this  
Alundra

Difference Tiled and Clustered shading

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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)

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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_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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!