Sign in to follow this  
Followers 0
viper110110

Plxel Shader: run every pixel or screen pixel?

4 posts in this topic

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.

0

Share this post


Link to post
Share on other sites

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.

0

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
0

Share this post


Link to post
Share on other sites

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  
Followers 0