View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002642 | FSSCP | graphics | public | 2012-04-22 12:55 | 2012-05-03 10:51 |
Reporter | m_m | Assigned To | m_m | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.6.13 | ||||
Summary | 0002642: Cockpits are rendered incorrectly when post-processing is disabled | ||||
Description | As the scene depth texture is only saved and cleared when post-processing is available cockpits are rendered with the scene depth values still there. That causes the cockpit to be potentially occluded by geometry that should occlude it. The patch fixes that but effectively clears the z-buffer so it isn't available after cockpits are rendered. That shouldn't be a problem as the z-buffer values are only used by post-processing effects as far as I can see. | ||||
Steps To Reproduce | Disable post-processing and fly a ship with a cockpit model near some geometry. | ||||
Tags | No tags attached. | ||||
|
cockpitZBuffer.patch (953 bytes)
Index: code/graphics/gropenglpostprocessing.cpp =================================================================== --- code/graphics/gropenglpostprocessing.cpp (revision 8682) +++ code/graphics/gropenglpostprocessing.cpp (working copy) @@ -733,12 +733,18 @@ extern GLuint Cockpit_depth_texture; void gr_opengl_post_process_save_zbuffer() { - if ( !Post_initialized ) { - return; + if (Post_initialized) + { + vglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, Cockpit_depth_texture, 0); + gr_zbuffer_clear(TRUE); + zbuffer_saved = true; } - vglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, Cockpit_depth_texture, 0); - gr_zbuffer_clear(TRUE); - zbuffer_saved = true; + else + { + // If we can't save the z-buffer then just clear it so cockpits are still rendered correctly when + // post-processing isn't available/enabled. + gr_zbuffer_clear(TRUE); + } } |
|
This looks fine, alongside The_E's review on IRC: The_E: m|m: Looks good to me Committing. |
|
Fix committed to trunk@8686. |
|
Fix committed to fs2_open_3_6_14@8738. |
|
Fix committed to fs2_open_3_6_14@8744. |
fs2open: trunk r8686 2012-04-22 09:34 Ported: N/A Details Diff |
Fix Mantis 2642: Cockpits are rendered incorrectly when post-processing is disabled, thanks m_m |
Affected Issues 0002642 |
|
mod - /trunk/fs2_open/code/graphics/gropenglpostprocessing.cpp | Diff File | ||
fs2open: fs2_open_3_6_14 r8738 2012-05-02 07:38 Ported: N/A Details Diff |
Backport: Trunk r8686; Fix Mantis 2642: Cockpits are rendered incorrectly when post-processing is disabled, thanks m_m |
Affected Issues 0002642 |
|
mod - /branches/fs2_open_3_6_14/code/graphics/gropenglpostprocessing.cpp | Diff File | ||
fs2open: fs2_open_3_6_14 r8744 2012-05-03 06:52 Ported: N/A Details Diff |
Revert "Backport: Trunk r8686; Fix Mantis 2642: Cockpits are rendered incorrectly when post-processing is disabled, thanks m_m" Depends on other non-backported commits This reverts commit cdb713f15a75169ee1352aad2bae5d84951e53a6. |
Affected Issues 0002642 |
|
mod - /branches/fs2_open_3_6_14/code/graphics/gropenglpostprocessing.cpp | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-04-22 12:55 | m_m | New Issue | |
2012-04-22 12:55 | m_m | Status | new => assigned |
2012-04-22 12:55 | m_m | Assigned To | => m_m |
2012-04-22 12:55 | m_m | File Added: cockpitZBuffer.patch | |
2012-04-22 12:55 | m_m | Status | assigned => code review |
2012-04-22 13:32 | Echelon9 | Note Added: 0013474 | |
2012-04-22 13:33 | Echelon9 | Changeset attached | => fs2open trunk r8686 |
2012-04-22 13:33 | Echelon9 | Note Added: 0013475 | |
2012-04-22 13:33 | Echelon9 | Status | code review => resolved |
2012-04-22 13:33 | Echelon9 | Resolution | open => fixed |
2012-05-02 11:37 | niffiwan | Changeset attached | => fs2open fs2_open_3_6_14 r8738 |
2012-05-02 11:37 | niffiwan | Note Added: 0013509 | |
2012-05-03 10:51 | niffiwan | Changeset attached | => fs2open fs2_open_3_6_14 r8744 |
2012-05-03 10:51 | niffiwan | Note Added: 0013514 |