Sign in to follow this  
db123

Dose all primitive in the viewport will execute its pixel shader?

Recommended Posts

I find the Output Merger Stage is after Pixel Shader Stage in the book : <Introduction to 3D Game Programming with DirectX 10>.

[quote]
[b] 5.11 The Output Merger Stage[/b]

After pixel fragments have been generated by the pixel shader, they move to the output merger (OM) stage of the rendering pipeline. In this stage, some pixel fragments may be rejected (e.g., from the depth or stencil buffer tests). Pixel fragments that are not rejected are written to the back buffer. Blending is also done in this stage, where a pixel may be blended with the pixel currently on the back buffer instead of overriding it completely. Some special effects like transparency are implemented with blending;[/quote]

if the comparison of depths is happened after the pixel shader, what's the significance of z-prepass?
In the past I thought z-prepass will write the depth of the scene into the depth buffer, and then when we draw the scene, the pixel which is behind the headmost pixel will be discard by depth comparision.
thanks a lot~~[img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img] [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img] [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]

Share this post


Link to post
Share on other sites
In terms of the logical DX10 pipeline the depth/stencil test happens after the pixel shader, but in reality all DX10-capable graphics hardware is capable of performing the test [i]before[/i] pixel shading as a performance optimization. However there are some cases that can cause the early-Z test to be deactivated, the most notable of which is having the pixel shader output a depth value using SV_Depth.

Share this post


Link to post
Share on other sites
[quote name='MJP' timestamp='1329724102' post='4914759']
In terms of the logical DX10 pipeline the depth/stencil test happens after the pixel shader, but in reality all DX10-capable graphics hardware is capable of performing the test [i]before[/i] pixel shading as a performance optimization. However there are some cases that can cause the early-Z test to be deactivated, the most notable of which is having the pixel shader output a depth value using SV_Depth.
[/quote]
thank you very much.~~[img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Thank you for your answer[img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

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