Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


clip() HLSL


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
3 replies to this topic

#1 lomateron   Members   -  Reputation: 363

Like
0Likes
Like

Posted 19 October 2012 - 01:00 AM

Does clip() improves performance?
rendering a quad in a 2D texture
Is it better in performance than, using depht or alpha to discard pixels.

Sponsor:

#2 kubera   Members   -  Reputation: 970

Like
0Likes
Like

Posted 19 October 2012 - 01:37 AM

Yes, it does.
The pixel is not being written to the destination.
Alpha-blending requires a correct order of rendered meshes or even pixels, also.

Edited by kubera, 19 October 2012 - 01:38 AM.


#3 kauna   Crossbones+   -  Reputation: 2855

Like
2Likes
Like

Posted 19 October 2012 - 06:17 AM

Use clip only when it is necessary. Keep in mind that there are cases where clip isn't necessary such as rendering opaque geometry. Typically this leads to two permutations of the pixel shader, one with clip and another one without.

Clip may save pixels from being written to the screen buffer, but on the other hand, it may have detrimental effect on the z-buffering optimizations. So, if you absolutely need clip, call it as early as possible in the pixel shader.

Cheers!

#4 phil_t   Crossbones+   -  Reputation: 4109

Like
1Likes
Like

Posted 19 October 2012 - 12:26 PM

clip() can really hurt performance if you're depending a lot of z-buffer rejection, since the pixel shader then will be run even for geometry that ends up being hidden.

This blog post has some good information on the topic: http://fgiesen.wordpress.com/2011/07/08/a-trip-through-the-graphics-pipeline-2011-part-7/

If you have no overlapping geometry in your draw call, then it might improve 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.



PARTNERS