Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 983429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:51:20+00:00 2026-05-16T04:51:20+00:00

What is the usage of making the depth buffer read-only? I’ve read on redbook

  • 0

What is the usage of making the depth buffer read-only? I’ve read on redbook that it is the case where you need to draw opaque objects first then the transparent ones. I’ve tested that and also on two opaque objects over each other, the result is hard to explain and i’ve found nothing usefull about making it read-only. Can some one explain about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:51:21+00:00Added an answer on May 16, 2026 at 4:51 am

    That absolutely makes sense in some scenarios. Here are two:

    1. You may use very expensive pixel-shaders for your graphics. If you do so you want to minimize the amount of pixels that need to get shaded. To do so you can first render your scene into the depth-buffer only (disable writes to the color buffer). Then you set your depth-buffer to read-only and render all your geometry with color-writes enabled and depth-compare-mode set to equal. This makes sure that every pixel on the screen gets painted exactly once, and you can use very expensive pixel shaders while still maintaining a nice frame-rate.

    2. The transparency-problem: If you render transparent (alpha-blended) triangles the order of drawing makes a significant difference to the final image. To get good looking result a tried and trusted way is to first render all opaque geometry. Then disable writes to the depth-buffer and render all transparent stuff sorted from back to front. This will make sure that your transparent polygons are always drawn in order and they don’t interfere with the opaque stuff.

    Just imagine this case:

    • The camera is in a street-scene and you are looking at a shop with a window and some nice stuff inside the shop.

    • You draw the transparent window first – with depth writes enabled.

    • Then you draw the interior of the shop.. Due to the z-buffer all pixels will get discarded because the graphic card thinks that the pixels aren’t visible.

    • You’ll end up with a completely wrong image: A window in front of … well … whatever was in your graphic memory before you started rendering.

    As said: To get around this you first render all your opaque things (the shop interior) with depth-test and depth-writes on. Then you render the window with depth-test on and depth-write off. This will solve this issue.

    Here is an example of how ugly such things can be. It shows yet another way of handling transparency wrong (take a closer look at the carpet).

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am thinking about making a website with some fairly intense JavaScript/canvas usage and
Our usage case is a database responsible for accounts, sessions, licenses, etc. — it
My usage-scenario may seem a bit unusual, but here it is: When using vim
What level of CPU usage should be considered high for SQL Server? ie 80%
What are your usage of delegates in C#?
According to [MSDN: Array usage guidelines]( http://msdn.microsoft.com/en-us/library/k2604h5s(VS.71).aspx) : Array Valued Properties You should use
How do you measure the memory usage of an application or process in Linux?
Could you please explain what the practical usage is for the internal keyword in
C Interfaces and Implementations shows some interesting usage patterns for data structures, but I
Suppose the following data schema: Usage ====== client_id resource type amount Billing ====== client_id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.