• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            醬壇子

            專注C++技術 在這里寫下自己的學習心得 感悟 和大家討論 共同進步(歡迎批評!!!)

              C++博客 :: 首頁 :: 聯系 :: 聚合  :: 管理
              66 Posts :: 16 Stories :: 236 Comments :: 0 Trackbacks

            公告

            王一偉 湖南商學院畢業 電子信息工程專業

            常用鏈接

            留言簿(19)

            我參與的團隊

            搜索

            •  

            積分與排名

            • 積分 - 387044
            • 排名 - 64

            最新隨筆

            最新評論

            閱讀排行榜

            評論排行榜

            另外一篇 英文資料(轉自 http://www.intel.com/cd/ids/developer/apac/zho/dc/games/optimization/170939.htm?page=4
            使用Z-Bias解決Z-Fighting問題的替代方案
            |
            目錄
            Introduction
            Alternative Method 1: Projection Matrix
            Alternative Method 2: Viewport
            Alternative Method 3: Depth Bias
            Conclusion
            Additional Resources

            Alternative Method 3: Depth Bias

            The last method addressed in this article uses the DirectX 9 Depth Bias method to solve z-fighting. A check to verify that the graphics card is capable of performing depth bias is needed. Intel Integrated Graphics will support depth bias in the next graphics core code named Grantsdale. After checking the cap bits to verify that depth bias is supported, this technique merely requires setting D3DRS_SLOPESCALEDEPTHBIAS and D3DRS_DEPTHBIAS to the proper values to get the desired effect.

            The following code snippet shows the depth-bias alternative to using a DirectX z-bias call:

            BOOL m_bDepthBiasCap; // TRUE, if device has DepthBias Caps

            // Globals used for Depth Bias
            float g_fSlopeScaleDepthBias = 1.0f;
            float g_fDepthBias = -0.0005f;
            float g_fDefaultDepthBias = 0.0f;

            // Check for devices which support the new depth bias caps
            if ((pCaps->RasterCaps & D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS) &&
            (pCaps->RasterCaps & D3DPRASTERCAPS_DEPTHBIAS))
            {
            m_bDepthBiasCap = true; // TRUE, if DepthBias Caps
            }

            // Billboards are rendered...

            // DepthBias work around
            if ( m_bDepthBiasCap ) // TRUE, if DepthBias supported
            {
            // Used to determine how much bias can be applied
            // to co-planar primitives to reduce z fighting
            // bias = (max * D3DRS_SLOPESCALEDEPTHBIAS) + D3DRS_DEPTHBIAS,
            // where max is the maximum depth slope of the triangle being rendered.
            m_pd3dDevice->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, F2DW(g_fSlopeScaleDepthBias));
            m_pd3dDevice->SetRenderState(D3DRS_DEPTHBIAS, F2DW(g_fDepthBias));
            }

            // Posters are rendered...

            if ( m_bDepthBiasCap ) // TRUE, if DepthBias supported
            {
            // DepthBias work around
            // set it back to zero (default)
            m_pd3dDevice->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, F2DW(g_fDefaultDepthBias));
            m_pd3dDevice->SetRenderState(D3DRS_DEPTHBIAS, F2DW(g_fDefaultDepthBias));
            }

            . . .

            Like the other methods (and like the original z-bias), some tweaking may be necessary, but using D3DRS_SLOPESCALEDEPTHBIAS and D3DRS_DEPTHBIAS is a relatively consistent technique for resolving z-fighting issues across a wide selection of graphics devices. The figure below shows the result of this alternate solution:


            Figure 4. Z-fighting solved with depth bias solution.
            As Figure 4 shows, care should be taken for adjusting the D3DRS_SLOPESCALEDEPTHBIAS and D3DRS_DEPTHBIAS. They can be very sensitive and lead to other issues like the problem below for distant objects:


            Figure 5. Depth-bias solution possible issue: unwanted overlapping polygons.
            找到一些英文資料
            Depth Bias收藏

            An application can help ensure that coplanar polygons are rendered properly by adding a bias to the z-values that the system uses when rendering the sets of coplanar polygons. To add a z-bias to a set of polygons, call the SetRenderState method just before rendering them, setting the State parameter to D3DRS_DEPTHBIAS, and the value parameter to a value between 0-16 inclusive. A higher z-bias value increases the likelihood that the polygons you render will be visible when displayed with other coplanar polygons.


            Offset = m * D3DRS_SLOPESCALEDEPTHBIAS + D3DRS_DEPTHBIAS

            where m is the maximum depth slope of the triangle being rendered.

            m = max(abs(delta z / delta x), abs(delta z / delta y))

            The units for the D3DRS_DEPTHBIAS and D3DRS_SLOPESCALEDEPTHBIAS render states depend on whether z-buffering or w-buffering is enabled. The application must provide suitable values.

            The bias is not applied to any line and point primitive. However, this bias needs to be applied to triangles drawn in wireframe mode.

            // RenderStates
            D3DRS_SLOPESCALEDEPTHBIAS, // Defaults to zero
            D3DRS_DEPTHBIAS, // Defaults to zero

            // Caps
            D3DPRASTERCAPS_DEPTHBIAS
            D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS

            是的 無外乎就是這樣的
            請問用winnet怎么實現遠程的seek操作

            而不是像MFC的HTTPFile那樣down到本地了才Seek

            呵呵 sunraiing@126.com
            re: inline函數 @王一偉 2007-12-30 08:12
            inline化算是編譯時的一種優化,比如里面有for循環的時候,還有遞歸調用什么的,編譯器就會自動優化成非inline函數,inline的會導致代碼體積上升過快 呵呵。

            這個是編譯到代碼段的行為。
            re: UNICODE 介紹 @王一偉 2007-12-30 08:06
            沒有涉及過unix/linux編程哦 可以探討下 過陣我會研究一下linux下的,d等我有兩臺電腦的時候 呵呵
            re: amd的Memcpy函數 @王一偉 2007-12-30 08:04
            呵呵 粘帖過來的 還沒來得及研究呢
            有時間研究下可以探討探討

            指令一般般多拉 哈哈
            re: inline函數 @王一偉 2007-12-30 08:03
            呵呵 是的 寄存器變量的分配在編譯時獲得,編譯時會確定變量數據段的地址,包括寄存器變量。

            inline也是編譯器負責 原生C++都是在編譯時進行inline化,而C++/CLI可以支持運行時的inline化

            不知道是不是可以理解C++/CLI為一種動態語言了 呵呵,我對這不是太清楚 Solomon Jon可以解釋下
            re: 兩類程序員 @王一偉 2007-11-26 15:29
            來這里的都會選前者的

            每種程序員的競爭力核心不一樣,不能只狹隘的吧所有的東西歸結到程序語言本身上。

            很少有人的工作是完全純凈的某一個狹小的領域的,混合型工作是工作的主流,各個層面工作的比例不同造就了我們在這里討論的幾種程序員的工作重心不一樣,核心競爭力也就不一樣 呵呵
            re: D語言與C++ @王一偉 2007-09-14 15:57
            荒謬 拖出去喂鳥


            3.4秒鐘你遍歷這幾百個文件名還不一定夠

            你還編譯個鳥
            re: 引領Boost(一)(開篇) @王一偉 2007-08-16 12:34
            好東西 學習學習
            re: 函數用const修飾算不算重載 @王一偉 2007-08-13 14:13
            或許泡泡牛大哥的解釋方法能解釋吧
            re: 函數用const修飾算不算重載 @王一偉 2007-08-13 14:12
            但是是重載的話 如果單寫某一個函數 用同一種調用方法都能調用 呵呵

            說不清

            結貼吧
            re: 函數用const修飾算不算重載 @王一偉 2007-08-13 09:51
            似乎 重載又不似重載 呵呵

            不管了 知道怎么用就可以了

            這玩意專研多了 無意,浪費青春
            re: GetProcAddress @王一偉 2007-08-09 09:50
            已經解決 嘿嘿
            re: GetProcAddress @王一偉 2007-08-09 08:58
            我重新寫了上面的代碼 發覺還是有問題dll能導入成功,函數地址能獲取

            但是一旦用typedef的函數指針的時候就連編譯都編譯不過了

            請求幫助

            工程文件如下http://m.shnenglu.com/Files/sunraiing9/hahahah.rar

            11k大小
            re: 無題 @王一偉 2007-07-30 17:54
            你是最好的服裝設計師?拜托 不能這么說人家啊 呵呵
            這可不是做美術
            re: 圖片測試貼 @王一偉 2007-04-12 11:47
            用netease 的相冊,比較好用
            re: 類模板(原創) @王一偉 2007-04-11 10:50
            好文,哈哈,下班了慢慢看看你寫的
            re: 白居易《長恨歌》的主題 @王一偉 2007-04-11 10:05
            有沒搞錯,這個也發到主頁上來,LZ沒睡好吧
            re: 請達人提示一下 @王一偉 2007-04-11 09:50
            轉過來支持下array,pointer,map等
            re: 請達人提示一下 @王一偉 2007-04-11 09:49
            HOHO 已經完成帶基本數據類型 和string的類序列化
            久久久亚洲欧洲日产国码二区| 精品国产一区二区三区久久久狼| 国产国产成人精品久久| 97久久精品午夜一区二区| 久久国产精品久久久| 人妻无码精品久久亚瑟影视| 色婷婷综合久久久久中文| 99久久精品国产一区二区三区| 亚洲国产成人久久综合区| 久久精品国产亚洲AV高清热 | 亚洲一区精品伊人久久伊人| 国产精品久久久久久久app| 久久婷婷久久一区二区三区| 四虎国产精品成人免费久久| 亚洲国产成人久久精品影视| 精品伊人久久久| 久久国产热这里只有精品| 99久久超碰中文字幕伊人| 久久久无码精品亚洲日韩软件| 成人资源影音先锋久久资源网| 欧美久久久久久午夜精品| 99久久99久久精品国产| 91久久精一区二区三区大全| 怡红院日本一道日本久久 | 亚洲AV无码一区东京热久久 | A级毛片无码久久精品免费| 久久国产精品国语对白| 久久国产高清字幕中文| 精品久久久久久无码中文字幕一区| 久久国产精品无| 一本一本久久a久久精品综合麻豆| 蜜桃麻豆www久久| 久久综合狠狠综合久久激情 | 久久精品中文字幕无码绿巨人| 中文字幕精品久久久久人妻| 伊人色综合久久天天人守人婷| 久久久精品波多野结衣| 国产精品成人久久久久久久| 久久国产乱子伦精品免费强| 精品国产一区二区三区久久| 亚洲欧美精品伊人久久|