• <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://www.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的類序列化
            欧美精品一本久久男人的天堂| 久久久国产亚洲精品| 久久精品国产亚洲网站| 国产成人精品久久一区二区三区av | 欧美熟妇另类久久久久久不卡| 精品久久久噜噜噜久久久 | 国产69精品久久久久9999| 午夜精品久久久久成人| 久久久久国产精品熟女影院| 国产免费久久久久久无码| 国产精品久久婷婷六月丁香| 国内精品久久久久影院优| 亚洲国产精品综合久久网络| 久久96国产精品久久久| 国产亚洲精品久久久久秋霞| 精品多毛少妇人妻AV免费久久 | 国产国产成人精品久久| 久久久久无码中| 久久91精品国产91久久小草| 精品国产99久久久久久麻豆| 久久精品国产精品亚洲艾草网美妙| 亚洲精品无码成人片久久| 性高湖久久久久久久久AAAAA| 色偷偷888欧美精品久久久| 天天躁日日躁狠狠久久| 2021国产精品久久精品| 久久精品国产只有精品66| 久久亚洲国产中v天仙www | 国产精品久久久久久福利69堂| 亚洲国产成人精品无码久久久久久综合 | 亚洲精品久久久www| 久久这里只有精品视频99| 曰曰摸天天摸人人看久久久| 久久久久亚洲av无码专区导航| 久久久久亚洲精品日久生情| 久久亚洲电影| 国产精品久久久久久久久软件 | 国产亚州精品女人久久久久久| 国产精品免费久久| 国产精品久久久久乳精品爆 | 久久综合给合久久国产免费|