Jump to content

  • Log In with Google      Sign In   
  • Create Account


stop rendering


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 lomateron   Members   -  Reputation: 329

Like
0Likes
Like

Posted 12 February 2013 - 05:10 AM

I have a technique that uses vertex, geometry and pixel shaders

 

I want to render nothing to a texture when i read in the vertex shader a texel and i see that it has a determined value.

 

The best way I know in performance to make it render nothing is to replace the vertice position "w" (the fourth value) with 0.0f. Is there a fastest way? is there something similar to clip() but for the vertex shader? to stop going into the geometry shader.


Edited by lomateron, 12 February 2013 - 05:12 AM.


Sponsor:

#2 Nik02   Crossbones+   -  Reputation: 2769

Like
0Likes
Like

Posted 12 February 2013 - 08:25 AM

You must output something from the vertex shader, but you can discard entire primitives in the geometry shader. So, you could set an integer in your VS out structure, and in GS see if any incoming vertices of the current primitive have that integer set.


Niko Suni


#3 Jason Z   Crossbones+   -  Reputation: 4905

Like
0Likes
Like

Posted 13 February 2013 - 01:23 PM

You didn't mention what types of primitives you are using, but in general, if you put your vertex outside of the clip space then you are effectively clipping the vertex.  The trouble is that you are using the Geometry Shader, which operates before clip/cull operations in the rasterizer.

 

So in that case, you would probably have to use the GS as Niko mentioned.  Depending on the amount of times that you expect to get one of these 'dead' vertices, it may or may not be worth doing from a performance standpoint...  Probably you could just use the w value in the GS, and if it is zero then just directly jump out of the shader (of course this will vary based on your primitives...).






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