• <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++技術(shù) 在這里寫下自己的學(xué)習(xí)心得 感悟 和大家討論 共同進(jìn)步(歡迎批評(píng)!!!)

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

            公告

            王一偉 湖南商學(xué)院畢業(yè) 電子信息工程專業(yè)

            常用鏈接

            留言簿(19)

            我參與的團(tuán)隊(duì)

            搜索

            •  

            積分與排名

            • 積分 - 387833
            • 排名 - 64

            最新隨筆

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            另外一篇 英文資料(轉(zhuǎn)自 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

            是的 無外乎就是這樣的
            請(qǐng)問用winnet怎么實(shí)現(xiàn)遠(yuǎn)程的seek操作

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

            呵呵 sunraiing@126.com
            re: inline函數(shù) @王一偉 2007-12-30 08:12
            inline化算是編譯時(shí)的一種優(yōu)化,比如里面有for循環(huán)的時(shí)候,還有遞歸調(diào)用什么的,編譯器就會(huì)自動(dòng)優(yōu)化成非inline函數(shù),inline的會(huì)導(dǎo)致代碼體積上升過快 呵呵。

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

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

            inline也是編譯器負(fù)責(zé) 原生C++都是在編譯時(shí)進(jìn)行inline化,而C++/CLI可以支持運(yùn)行時(shí)的inline化

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

            每種程序員的競(jìng)爭(zhēng)力核心不一樣,不能只狹隘的吧所有的東西歸結(jié)到程序語言本身上。

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


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

            你還編譯個(gè)鳥
            好東西 學(xué)習(xí)學(xué)習(xí)
            或許泡泡牛大哥的解釋方法能解釋吧
            但是是重載的話 如果單寫某一個(gè)函數(shù) 用同一種調(diào)用方法都能調(diào)用 呵呵

            說不清

            結(jié)貼吧
            似乎 重載又不似重載 呵呵

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

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

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

            請(qǐng)求幫助

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

            11k大小
            re: 無題 @王一偉 2007-07-30 17:54
            你是最好的服裝設(shè)計(jì)師?拜托 不能這么說人家啊 呵呵
            這可不是做美術(shù)
            re: 圖片測(cè)試貼 @王一偉 2007-04-12 11:47
            用netease 的相冊(cè),比較好用
            re: 類模板(原創(chuàng)) @王一偉 2007-04-11 10:50
            好文,哈哈,下班了慢慢看看你寫的
            有沒搞錯(cuò),這個(gè)也發(fā)到主頁上來,LZ沒睡好吧
            re: 請(qǐng)達(dá)人提示一下 @王一偉 2007-04-11 09:50
            轉(zhuǎn)過來支持下array,pointer,map等
            re: 請(qǐng)達(dá)人提示一下 @王一偉 2007-04-11 09:49
            HOHO 已經(jīng)完成帶基本數(shù)據(jù)類型 和string的類序列化
            99久久99这里只有免费费精品| 亚洲AV无一区二区三区久久| 久久精品国产精品青草app| 久久久久99精品成人片直播| 国产成人精品久久免费动漫| 久久精品国产一区二区三区| 中文国产成人精品久久亚洲精品AⅤ无码精品 | 亚洲午夜久久影院| 日韩AV毛片精品久久久| 久久精品成人欧美大片| 日韩亚洲欧美久久久www综合网| 久久精品成人欧美大片| 一本久久a久久精品亚洲| yellow中文字幕久久网| 久久精品国产亚洲av麻豆图片| 久久精品国产亚洲77777| 久久久久久久亚洲精品| 久久夜色精品国产网站| 久久久无码精品午夜| 中文精品久久久久人妻不卡| 国产精品免费久久久久久久久 | 国产精品久久亚洲不卡动漫| 久久精品无码一区二区app| 久久人人爽人人爽人人AV| 久久996热精品xxxx| 婷婷综合久久中文字幕蜜桃三电影| 国产女人aaa级久久久级| 久久久久久夜精品精品免费啦| 久久久久99精品成人片三人毛片 | 日韩美女18网站久久精品| 精品久久久久久成人AV| 久久精品一本到99热免费| 久久中文精品无码中文字幕| 99久久人妻无码精品系列蜜桃 | 嫩草影院久久国产精品| 99久久99久久精品国产片果冻| 久久免费99精品国产自在现线 | 亚洲愉拍99热成人精品热久久| 久久精品无码一区二区三区免费| 国产成人精品久久一区二区三区| 久久婷婷五月综合色高清|