Sign in to follow this  

Why SV_ClipDistance[n] cost so much performance?

This topic is 1663 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

I want to Clip some geometry from some objects but the performance hit is huge.

 

for example a model with around 1000 triangles will now cost around 2.5 times more time to render. That is not really a problem if i want to apply the SV_ClipDistance in a small number of models, but if I want to do it in many models or models that have many triangles then the over all performance will get significant worst.(let say I do this SV_ClipDistance in everything that is on the screen then the fps will pretty much drop 2.5 times)

Share this post


Link to post
Share on other sites

I've never used it, however I have some ideas:

 

- In your tests how many clip planes are you using? How are you measuring performance? What graphics card are you testing on? Does your test use a realistic pixel shader?

 

- Instead of looking at the relative cost, it's generally more useful to look at the absolute cost. For example "clipping 1,000,000 polys takes an extra 1ms" or whatever the actual numbers are. That's because going from say 0.01ms to 0.025ms while a big factor slower will probably be an insignificant proportion of the total frame time.

 

- It's simple to implement clip planes in the pixel shader, and it doesn't take many instructions. If you're vertex bound and not pixel bound it might be quicker that way. The code is something like:

if (dot(plane, position) < 0) discard;

 

- Where possible, it should be cheaper to adjust the standard near and far clip planes, instead of adding new clip planes.

Share this post


Link to post
Share on other sites

-I want to clip the height of the models so the SV_POSITION in pixel shader is only going to clip the near and far.

 

-I measuring performance by the time it take to render my reflection texture, with the SV_ClipDistance(clip the height of the models) to get the correct water reflection from the models. (so i use one clip plane that represent the water level)

 

-GPU i currently use is a HD7950.

 

-pixel shader(that I use for my water reflection texture) is under realistic load (shadows, lighting, specular, fog, reflection, etc)

 

 

Share this post


Link to post
Share on other sites

This topic is 1663 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this