Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Why SV_ClipDistance[n] cost so much performance?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 xlope01   Members   -  Reputation: 174

Like
0Likes
Like

Posted 26 June 2013 - 01:41 PM

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)



Sponsor:

#2 Adam_42   Crossbones+   -  Reputation: 2579

Like
1Likes
Like

Posted 27 June 2013 - 05:54 PM

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.



#3 xlope01   Members   -  Reputation: 174

Like
0Likes
Like

Posted 28 June 2013 - 08:48 AM

-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)

 

 






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS