Jump to content
  • Advertisement
Sign in to follow this  
viper110110

Plxel Shader: run every pixel or screen pixel?

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

Is the shader run once for every pixel a triangle covers or just the ones that are included in the screen?

 

The reason I'm asking is because I want to do a simple ground for a platformer, and I was thinking of using one giant pair of triangles (to make a rectangle) to do the ground, and then having the texture tile over it. If the pixel shader would only run for the pixels that appear on the screen, this would work fine, but if it is called for the entire rectangle, this could be a bad idea.

Share this post


Link to post
Share on other sites
Advertisement

To be a lot more clearer it only runs for every pixel that needs to be rasterized. So if you had scissor test enable and clip areas of the screen, then those part will not get process by the pixel shader.

Share this post


Link to post
Share on other sites

Clip hint applies to every graphical element in existence which is meant to not be visible until needed, including all types of shaders.  As you get more experience then you will learn to optimize clip hint efficiently.

Edited by 3Ddreamer

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!