• <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://www.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久久香蕉国产线看观看| 久久天天躁狠狠躁夜夜avapp| 久久精品国产91久久麻豆自制| 男女久久久国产一区二区三区| 亚洲伊人久久精品影院| 九九久久自然熟的香蕉图片| 97超级碰碰碰碰久久久久| 伊人色综合久久天天人守人婷 | 亚洲成色WWW久久网站| 综合久久国产九一剧情麻豆 | 无码人妻少妇久久中文字幕 | 狠狠色综合网站久久久久久久 | 久久久久久久久久久久久久| 色欲久久久天天天综合网精品| 久久精品一区二区国产| 久久国语露脸国产精品电影| 91精品国产高清久久久久久io| 久久综合久久综合九色| 少妇内射兰兰久久| 久久夜色精品国产www| 久久AV高清无码| 久久无码专区国产精品发布| 国产免费久久精品99久久| 久久亚洲私人国产精品| 亚洲精品97久久中文字幕无码| 青青国产成人久久91网| 久久男人Av资源网站无码软件| 亚洲伊人久久综合中文成人网| 亚洲国产精品久久久久| 久久精品中文字幕久久| 麻豆成人久久精品二区三区免费| 亚洲性久久久影院| 久久影院亚洲一区| 久久久精品视频免费观看| 国产精品无码久久综合网| 一级做a爰片久久毛片人呢| 国产精品久久久久9999高清| 国产精品无码久久综合| 亚洲国产欧洲综合997久久| 国产毛片欧美毛片久久久| 色综合久久久久无码专区|