--- deliantra/Deliantra-Client/TODO 2006/06/04 00:16:11 1.119 +++ deliantra/Deliantra-Client/TODO 2006/06/05 00:56:44 1.124 @@ -8,9 +8,8 @@ 12:17 <@schmorp> remind me of it 12:17 <@schmorp> qwhen i next bundle it -- IMPORTANT: message log window often loses contents after refreshes/res switches - (m,aybe not, maybe after loging out and in again?) -- IMPORTANT: toplevel geometry is not respected on moves. +- IMPORTANT: password-entry dialog (query!) not hidden, should be fixed + together with removing query dialog altogether. - IMPORTANT: statusbox update timer - IMPORTANT: statusbox tooltip must not go away on updates - IMPORTANT: history for completer (cursor-up) @@ -92,3 +91,28 @@ set_face 4784 => 73 libpng warning: Ignoring gAMA chunk with gamma=0 + To achieve a more complete blending, you can have your drawing engine rasterize each transparent object more than once, altering in each pass the blending mode, object alpha channel, and buffer write masks. The first pass should perform RGB blending. Accordingly, you should disable writing any alpha channel or z buffer data during this pass. + /*first pass*/ + glColorMask(TRUE, TRUE, TRUE, FALSE); /*disable alpha channel*/ + glDepthMask(FALSE); /*disable Z buffer*/ + if (premultpliedTransparency) + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + else + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + /*render the object here*/ + + On the second pass, you should set the frame buffer alpha channel value to (1- a s )(1- a d ). To do this, you need to render the object again, with a different alpha value, as follows: + /*second pass*/ + glColorMask(FALSE, FALSE, FALSE, TRUE); /*enable alpha channel*/ + glDepthMask(FALSE); /*disable Z buffer*/ + glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ZERO); + /*render the object with alpha replaced with 1-a*/ + + Finally, the third pass should replace the value in the alpha channel with the final value 1-((1- a s )(1- a d )). To do this, you need to render the object again, with its alpha value set to 1, as follows: + /*third pass*/ + glColorMask(FALSE, FALSE, FALSE, TRUE); /*enable alpha channel*/ + glDepthMask(TRUE); /*enable Z buffer*/ + glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ZERO); + /*render the object with alpha replaced with 1*/ + +