锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲午夜久久久精品影院,漂亮人妻被中出中文字幕久久,久久国产亚洲精品http://www.shnenglu.com/bloodbao/c++zh-cnTue, 06 May 2025 22:16:05 GMTTue, 06 May 2025 22:16:05 GMT60鏀瑰啓浠g爜蹇冨緱http://www.shnenglu.com/bloodbao/archive/2008/12/08/68816.htmlbloodbaobloodbaoMon, 08 Dec 2008 02:21:00 GMThttp://www.shnenglu.com/bloodbao/archive/2008/12/08/68816.htmlhttp://www.shnenglu.com/bloodbao/comments/68816.htmlhttp://www.shnenglu.com/bloodbao/archive/2008/12/08/68816.html#Feedback0http://www.shnenglu.com/bloodbao/comments/commentRss/68816.htmlhttp://www.shnenglu.com/bloodbao/services/trackbacks/68816.html       鐢變簬BLOOD娓叉煋鍣ㄧ殑API鐢盌X9杞悜DX10錛屽湪杞寲鏋舵瀯鍜屾敼鍐欎唬鐮佺殑榪囩▼涓紝鍑虹幇寰堝寮傚父銆?br>鍦ㄦ祴璇曡繃紼嬩腑錛屽彂鐜板緢澶氶敊璇兘鏄敱浜庢病鏈夎繘琛屾紜殑鍒濆鍖栭犳垚鐨勩傛瘮濡傚垎閰嶅唴瀛樼殑瀹歸棿錛屽彉閲忕殑姝g‘璧嬪肩瓑絳夈傚凡璋冨畬VB錛孖B錛孴EXTURE錛孯ENDERTARGET絳夐儴鍒嗭紝榪樻湁MESH絳夊ぇ閮ㄦ湭璋冦?br>       鐗規MARK錛屼互浣滆褰曘?

bloodbao 2008-12-08 10:21 鍙戣〃璇勮
]]>
clip plane妯℃嫙錛堟妱鑷狣XSDK錛?/title><link>http://www.shnenglu.com/bloodbao/archive/2008/11/09/66448.html</link><dc:creator>bloodbao</dc:creator><author>bloodbao</author><pubDate>Sun, 09 Nov 2008 12:47:00 GMT</pubDate><guid>http://www.shnenglu.com/bloodbao/archive/2008/11/09/66448.html</guid><wfw:comment>http://www.shnenglu.com/bloodbao/comments/66448.html</wfw:comment><comments>http://www.shnenglu.com/bloodbao/archive/2008/11/09/66448.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/bloodbao/comments/commentRss/66448.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/bloodbao/services/trackbacks/66448.html</trackback:ping><description><![CDATA[<p>DX9涓嬩嬌鐢?br>D3DXPLANE plane; <br> D3DXPlaneFromPointNormal( &plane, &vPoint, &vNormal ); //鐢熸垚榪欎釜騫抽潰 <br>D3DXMatrixReflect( &matReflect, &plane ); //鍙栧緱璇ュ鉤闈㈢殑鍙嶅皠鐭╅樀<br>//璁劇疆鍓垏騫抽潰錛屼嬌鍙嶅皠闈笂鐨勫唴瀹硅娓叉煋錛岄潰涓嬬殑琚涪寮?<br> m_pd3dDevice->SetClipPlane( 0, plane ); <br> m_pd3dDevice->SetRenderState( D3DRS_CLIPPLANEENABLE, 0x01 );<br>DX10涓嬫ā鎷燂細<br>User Clip PlanesUser Clip Planes are emulated by specifying a clip distance output from the Vertex Shader with the SV_ClipDistance[n] flag, where n is either 0 or 1. Each component can hold up to 4 clip distances in x, y, z, and w giving a total of 8 clip distances.</p> <p>    鐢ㄦ埛瑁佸噺騫抽潰閫氳繃鍦╒S閲岃瀹氫竴涓猄V_ClipDistance[n]鏍囪錛屽畾涔変竴涓鍑忚窛紱昏緭鍑哄緱鍒?n涓?鎴?銆傝繖閲屼竴鍏辮兘瀛樻斁8涓狢lip Plane璺濈錛屽垎鍒嬌鐢ㄦ暟緇勪袱涓厓绱犵殑x,y,z,w閫氶亾銆?/p> <p>In this scenario, each clip planes is defined by a plane equation of the form:</p> <p>鍦ㄨ繖涓満鏅噷錛屾瘡涓猚lip plane琚竴涓鉤闈㈡柟紼嬪畾涔夛細</p> <p>Ax + By + Cz + D =0;</p> <p>Where <A,B,C> is the normal of the plane, and D is the distance of the plane from the origin. Plugging in any point <x,y,z> into this equation gives its distance from the plane. Therefore, all points <x,y,z> that satisfy the equation Ax + By + Cz + D = 0 are on the plane. All points that satisfy Ax + By + Cz + D < 0 are below the plane. All points that satisfy Ax + By + Cz + D > 0 are above the plane.</p> <p><A,B,C>鏄鉤闈㈡硶鍚戯紝D鏄鉤闈㈠埌鍘熺偣鐨勮窛紱匯傛妸浠繪剰鐐?lt;x,y,z>浠e叆鏂圭▼鑳藉緱鍒板畠鍒板鉤闈㈢殑璺濈銆傛墍鏈夋弧瓚蟲柟紼嬶紳0鐨勭偣鍦ㄥ鉤闈笂錛?lt;0鐨勭偣鍦ㄥ鉤闈笅鑰?>0鐨勭偣鍦ㄥ鉤闈笂銆?/p> <p>In the Vertex Shader, each vertex is tested against each plane equation to produce a distance to the clip plane. Each of the three clip distances are stored in the first three components of the output component with the semantic SV_ClipDistance0. These clip distances get interpolated over the triangle during rasterization and clipped if the value every goes below 0.</p> <p>    鍦╒S涓紝姣忎釜欏剁偣浼氬甫鍏ュ鉤闈㈡柟紼嬪仛嫻嬭瘯銆傛瘡涓笁瑙掑艦鐨凜lip璺濈瀛樺湪SV_ClipDistance0璇箟杈撳嚭鐨勫墠涓変釜閫氶亾涓傝繖涓窛紱誨湪鍏夋爡鍖栦腑琚嚎鎬ф彃鍊鹼紝鎵鏈夊皬浜?鐨勫儚绱犺鍓旈櫎銆?/p> <img src ="http://www.shnenglu.com/bloodbao/aggbug/66448.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/bloodbao/" target="_blank">bloodbao</a> 2008-11-09 20:47 <a href="http://www.shnenglu.com/bloodbao/archive/2008/11/09/66448.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>rendering璋冭瘯http://www.shnenglu.com/bloodbao/archive/2008/10/23/64881.htmlbloodbaobloodbaoThu, 23 Oct 2008 13:55:00 GMThttp://www.shnenglu.com/bloodbao/archive/2008/10/23/64881.htmlhttp://www.shnenglu.com/bloodbao/comments/64881.htmlhttp://www.shnenglu.com/bloodbao/archive/2008/10/23/64881.html#Feedback0http://www.shnenglu.com/bloodbao/comments/commentRss/64881.htmlhttp://www.shnenglu.com/bloodbao/services/trackbacks/64881.html

bloodbao 2008-10-23 21:55 鍙戣〃璇勮
]]>
鑷埗錛堝啓緇欒嚜宸詫級http://www.shnenglu.com/bloodbao/archive/2008/09/18/62223.htmlbloodbaobloodbaoThu, 18 Sep 2008 13:58:00 GMThttp://www.shnenglu.com/bloodbao/archive/2008/09/18/62223.htmlhttp://www.shnenglu.com/bloodbao/comments/62223.htmlhttp://www.shnenglu.com/bloodbao/archive/2008/09/18/62223.html#Feedback0http://www.shnenglu.com/bloodbao/comments/commentRss/62223.htmlhttp://www.shnenglu.com/bloodbao/services/trackbacks/62223.html

bloodbao 2008-09-18 21:58 鍙戣〃璇勮
]]>
Main Features in my blood enginehttp://www.shnenglu.com/bloodbao/archive/2008/08/11/58530.htmlbloodbaobloodbaoMon, 11 Aug 2008 07:05:00 GMThttp://www.shnenglu.com/bloodbao/archive/2008/08/11/58530.htmlhttp://www.shnenglu.com/bloodbao/comments/58530.htmlhttp://www.shnenglu.com/bloodbao/archive/2008/08/11/58530.html#Feedback0http://www.shnenglu.com/bloodbao/comments/commentRss/58530.htmlhttp://www.shnenglu.com/bloodbao/services/trackbacks/58530.htmlDirect3D 9 is used to render the scene
User input is gathered though DirectInput
Single pass multi-texturing using the fixed-function pipeline (FFP)
Light-mapping
Frustum culling
Simple skybox
Keyframe Animation with GPU-based frame interpolation through a custom vertex and pixel shader written in HLSL. This technique is also known as Vertex Tweening or even Morph Target
Support for Quake2 models (.md2)
Support for DirectX models (.x)
Support for PCX texture loading in addition to the other image formats already supported by Direct3D
Support for Quake3:Arena levels
Lightmaps
Curved surfaces using Bezier patches
Partial support of Quake3 materials and effects (.shader)
Uses the BSP/PVS to quickly discard non visible geometry
Collision detection using the BSP tree (supports ray, sphere and box sweeps)
A flexible scene graph system where entities can be attached to each other in order to perform hierarchical transformations and geometry culling
Quake-like player movement physics
A powerful in-game console system:
Outputs vital information
Can take command inputs from the user
Console variables can be dynamically edited at runtime
Commands and console variable settings can be loaded from a user-specified text file (cfg)
Garbage collection of unused resources through reference counting
Control keys can be dynamically changed in-game through the console, using the bind command
User input is abstracted through an Action Manager which maps inputs to actions
A smart chase-camera controller that will detect collisions with the world to prevent the view from being occluded by other pieces of world geometry.
Error handling through exceptions
The in-game HUD can display vital performance statistics about the game, such as frames per second, total number of triangles on the screen, number of textures loaded, etc…

bloodbao 2008-08-11 15:05 鍙戣〃璇勮
]]>
鍙堝け璐ヤ簡http://www.shnenglu.com/bloodbao/archive/2008/08/06/58118.htmlbloodbaobloodbaoWed, 06 Aug 2008 02:36:00 GMThttp://www.shnenglu.com/bloodbao/archive/2008/08/06/58118.htmlhttp://www.shnenglu.com/bloodbao/comments/58118.htmlhttp://www.shnenglu.com/bloodbao/archive/2008/08/06/58118.html#Feedback10http://www.shnenglu.com/bloodbao/comments/commentRss/58118.htmlhttp://www.shnenglu.com/bloodbao/services/trackbacks/58118.html       涓轟簡榪欐闈㈣瘯錛屾垜浼戞伅浜嗗緢澶氬ぉ錛岄兘娌″伐浣溿傜粨鏋滐紝寰楀埌鐨勫張鏄竴涓け璐ョ殑緇撳眬銆傚垎鏋愬師鍥狅紝閮借涓烘垜鐨凜++鍩虹寰堣杽寮卞惂錛岃涓嶅氨鏄洜涓烘垜浠ュ墠浠庝簨鐨勫伐浣滃拰鐜板湪鐨勫伐浣滃樊鍒お澶т簡銆?br>      浣滀負涓鍚嶆柊鎵嬶紝鎴戝緢榪瘋尗錛屽湪瀛︿範鐨勯亾璺垜娌℃湁琚墦璐ワ紝鍗村湪涓ゆ闈㈣瘯涓紝娣卞彈鎵撳嚮銆傛垜涓嶄粎鍦ㄦ兂錛岃繖鏄惁鏄垜瑕侀夋嫨鐨勮礬銆備粎鍓╁崐涓鏈堢殑鏃墮棿錛屾殤鏈熷氨緇撴潫浜嗭紝鎴戝啀涓嶅嚭鍘伙紝灝辨病鏈轟細浜嗐備簨瀹炰笂錛屽仛涓嶅仛娓告垙錛屾垜鏃犳墍璋擄紝浣嗙幇鍦ㄧ殑鐢熸椿涓鐩翠笉鏄垜鎯寵鐨勩傛垜涓嶆柇鍦板湪鍚﹀畾鑷凡鐨勮礬涓婏紝瓚婅蛋瓚婅繙錛屾壘涓嶅埌鐪熷疄鐨勬垜銆?br>      涓や釜鏈堝緢蹇氨榪囧幓浜嗭紝鎴戝彧鑳介潤涓嬪績鏉ュ幓鍋氫簨鎯咃紝鎶婅繖浜涚儲浜虹殑浜嬶紝閮芥姏浜庤剳鍚庛傝礬榪樻槸瑕佽蛋錛屼漢鎬繪槸瑕佹垚闀跨殑錛屽笇鏈涜兘浠庡け璐ヤ腑璧板嚭鏉ャ?br>      璁頒笅浠婂ぉ鐨勫け璐ワ紝浠ヤ綔鑷媺銆?/p>

bloodbao 2008-08-06 10:36 鍙戣〃璇勮
]]>
DX10sample鐨勯槾褰?/title><link>http://www.shnenglu.com/bloodbao/archive/2008/07/20/56669.html</link><dc:creator>bloodbao</dc:creator><author>bloodbao</author><pubDate>Sun, 20 Jul 2008 02:48:00 GMT</pubDate><guid>http://www.shnenglu.com/bloodbao/archive/2008/07/20/56669.html</guid><wfw:comment>http://www.shnenglu.com/bloodbao/comments/56669.html</wfw:comment><comments>http://www.shnenglu.com/bloodbao/archive/2008/07/20/56669.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/bloodbao/comments/commentRss/56669.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/bloodbao/services/trackbacks/56669.html</trackback:ping><description><![CDATA[<img src="http://www.shnenglu.com/images/cppblog_com/bloodbao/self-shadow.jpg" border=0><br>涓昏鏄敤妯℃澘緙撳啿鍖烘潵瀹炵幇銆?br>DepthStencilState StencilShadow<br>{<br>    DepthEnable = true;<br>    DepthWriteMask = ZERO;<br>    DepthFunc = LESS;<br>    <br>    StencilEnable = true;<br>    StencilReadMask = 0xFFFFFFFF;<br>    StencilWriteMask = 0xFFFFFFFF;<br>    <br>    FrontFaceStencilFunc = ALWAYS;<br>    FrontFaceStencilPass = INCR;<br>    FrontFaceStencilFail = Keep;<br>    <br>    BackFaceStencilFunc = ALWAYS;<br>    BackFaceStencilPass = DECR;<br> 銆BackFaceStencilFail = Keep;<br>};<br>BlendState AdditiveBlending<br>{<br>    AlphaToCoverageEnable = FALSE;<br>    BlendEnable[0] = TRUE;<br>    SrcBlend = SRC_ALPHA ;<br>    DestBlend = INV_SRC_ALPHA ;<br>    BlendOp = ADD;<br>    SrcBlendAlpha = ZERO;<br>    DestBlendAlpha = ZERO;<br>    BlendOpAlpha = ADD;<br>    RenderTargetWriteMask[0] = 0x0F;<br>};<br> <h2><a name=Rendering_Shadows></a>Rendering Shadows</h2> <p>At the top level, the rendering steps look like the following:</p> <ul> <li>If ambient lighting is enabled, render the entire scene with ambient only. <li>For each light in the scene, do the following: <ul> <li>Disable depth-buffer and frame-buffer writing. <li>Prepare the stencil buffer render states for rendering the shadow volume. <li>Render the shadow volume mesh with a vertex extruding shader. This sets up the stencil buffer according to whether or not the pixels are in the shadow volume. <li>Prepare the stencil buffer render states for lighting. <li>Prepare the additive blending mode. <li>Render the scene for lighting with only the light being processed. </li> </ul> </li> </ul> <br>Shadow Volume騫朵笉鏄竴涓病鏈夌己闄風殑鎶鏈傞櫎浜嗛珮鍍忕礌濉厖鐜囧拰闃村獎杈圭晫媯嫻嬪錛屽湪緇樺埗榪囩▼涓繕鍙兘鍑虹幇閿欒銆傞敊璇殑涓昏鍘熷洜鏄綋涓涓嚑浣曟ā鍨嬪湪璁$畻鑷槾褰辨椂錛屽畠鐨勯潰閫氬父琚畬鍏ㄧ収浜垨鑰呭畬鍏ㄥ彉鏆楋紝榪欏彇鍐充簬榪欎釜闈㈡槸鍚︽湞鍚戝厜婧愩傚厜鐓ц綆楀繀欏諱嬌鐢ㄩ《鐐規硶鍚戣岄潪琛ㄩ潰娉曞悜銆傚浜庢帴榪戝鉤琛屽厜婧愮殑闈紝瀹冧細琚畬鍏ㄧ収浜垨鑰呭畬鍏ㄥ彉鏆楋紝鑰屽疄闄呬笂搴旇閮ㄥ垎澶勪簬鍏夋簮涓傝繖鏄粠stencil shadow volume涓戶鎵挎潵鐨勯棶棰橈紝鍦ㄨ綆楅槾褰辨椂蹇呴』琚冭檻銆傝繖涓棶棰樺彲浠ラ氳繃澧炲姞mesh瀵嗗害鏉ヨВ鍐籌紝榪欎篃澧炲姞浜嗗鐞唌esh鐨勬椂闂淬傞《鐐規硶鍚戝拰闈㈡硶鍚戣秺鎺ヨ繎錛岃〃闈㈢殑闂灝辮秺灝戙傚鏋滅▼搴忎笉鑳芥妸闂闄愬埗鍦ㄥ彲鎺ュ彈鐨勮寖鍥村唴錛屽氨蹇呴』鑰冭檻浣跨敤鍏朵粬鐨勭畻娉曪紝姣斿PRT鎴栬匰hadow Map銆? <img src ="http://www.shnenglu.com/bloodbao/aggbug/56669.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/bloodbao/" target="_blank">bloodbao</a> 2008-07-20 10:48 <a href="http://www.shnenglu.com/bloodbao/archive/2008/07/20/56669.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>dx10涔嬫ā鎷烡X9http://www.shnenglu.com/bloodbao/archive/2008/07/20/56663.htmlbloodbaobloodbaoSun, 20 Jul 2008 02:31:00 GMThttp://www.shnenglu.com/bloodbao/archive/2008/07/20/56663.htmlhttp://www.shnenglu.com/bloodbao/comments/56663.htmlhttp://www.shnenglu.com/bloodbao/archive/2008/07/20/56663.html#Feedback0http://www.shnenglu.com/bloodbao/comments/commentRss/56663.htmlhttp://www.shnenglu.com/bloodbao/services/trackbacks/56663.htmlFixed-function Lighting Pipeline
ColorsOutput CalcLighting( float3 worldNormal, float3 worldPos, float3 cameraPos )
{
    ColorsOutput output = (ColorsOutput)0.0;
   
    for(int i=0; i<8; i++)
{
     //鍏夌嚎鏂瑰悜
        float3 toLight = g_lights[i].Position.xyz - worldPos;
         //紱誨厜婧愯窛紱?br>        float lightDist = length( toLight );
         //atten錛濓紙1/(a[2]*d*d+a[1]*d+a[1])
        float fAtten = 1.0/dot( g_lights[i].Atten, float4(1,lightDist,lightDist*lightDist,0) );
        float3 lightDir = normalize( toLight );
         //H
        float3 halfAngle = normalize( normalize(-cameraPos) + lightDir );
       
         //Phong鏂圭▼錛岄愰《鐐瑰厜鐓?br>        output.Diffuse += max(0,dot( lightDir, worldNormal ) * g_lights[i].Diffuse * fAtten) + g_lights[i].Ambient;
        output.Specular += max(0,pow( dot( halfAngle, worldNormal ), 64 ) * g_lights[i].Specular * fAtten );
    }
   
    return output;
}
綆鍗旳LPHA嫻嬭瘯
//
// PS for rendering with alpha test
//
float4 PSAlphaTestmain(PSSceneIn input) : COLOR0
{       
         float4 color =  tex2D( g_samLinear, g_txDiffuse, input.tex ) * input.colorD;
         if( color.a < 0.5 )
                 discard;
         return color;
}
闆懼寲錛?/p>

//
// Calculates fog factor based upon distance
//
// E is defined as the base of the natural logarithm (2.71828)
float CalcFogFactor( float d )
{
         float fogCoeff = 1.0;
        
         if( FOGMODE_LINEAR == g_fogMode )
         {
                 fogCoeff = (g_fogEnd - d)/(g_fogEnd - g_fogStart);
         }
         else if( FOGMODE_EXP == g_fogMode )
         {
                 fogCoeff = 1.0 / pow( E, d*g_fogDensity );
         }
         else if( FOGMODE_EXP2 == g_fogMode )
         {
                 fogCoeff = 1.0 / pow( E, d*d*g_fogDensity*g_fogDensity );
         }
        
         return clamp( fogCoeff, 0, 1 );
}

Finally, the pixel shader uses the fog factor to determine how much of the original color and how much of the fog color to output to the pixel.

鏈鍚庯紝PS浣跨敤闆懼寲鍙傛暟紜畾闆鵑鑹插拰綰圭悊棰滆壊鐨勬販鍚堢▼搴︺?br>return fog * normalColor + (1.0 - fog)*g_fogColor;



bloodbao 2008-07-20 10:31 鍙戣〃璇勮
]]>
鐢憋幾鏂囦歡瀵煎叆寮曞彂鐨勩傘?/title><link>http://www.shnenglu.com/bloodbao/archive/2008/07/17/56387.html</link><dc:creator>bloodbao</dc:creator><author>bloodbao</author><pubDate>Thu, 17 Jul 2008 02:26:00 GMT</pubDate><guid>http://www.shnenglu.com/bloodbao/archive/2008/07/17/56387.html</guid><wfw:comment>http://www.shnenglu.com/bloodbao/comments/56387.html</wfw:comment><comments>http://www.shnenglu.com/bloodbao/archive/2008/07/17/56387.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/bloodbao/comments/commentRss/56387.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/bloodbao/services/trackbacks/56387.html</trackback:ping><description><![CDATA[<p>鍒氬紑濮嬪涔燚X10錛屽彂瑙夋ā鍨嬫枃浠跺凡緇忎粠鍘熸潵鐨刋鏍煎紡鍙樹負SDKMESH鏍煎紡錛屼篃灝辨槸璇碊X10涓嶇洿鎺ユ敮鎸乆鏂囦歡浜嗭紝<br>閭g幇鍦ㄨ鎬庝箞鍔烇紝鎴戝湪NVSDK涓嬫壘鍒頒簡浠栫殑瑙e喅鏂規錛屽厛鐢―X9鐨勬帴鍙f墦寮X鏂囦歡錛屽啀鐢―X10鎺ュ彛鏉ユ覆鏌撴枃浠躲?br>         鍦―X10涓嬶紝緙哄皯浜嗗緢澶氫互鍓嶅湪DX9涓嬬殑鍏冪礌銆傛瘮濡傦紝鍏夌収錛屾潗璐ㄧ瓑銆?br>         瑕佸疄鐜拌繖浜涘厓绱狅紝灝卞繀欏誨湪SHADER涓嬫墜鍔ㄥ幓瀹炵幇錛岄偅灝辨剰鍛崇潃浣犲繀欏葷啛鎮夊浘褰㈠鐨勫唴瀹癸紝鐗瑰埆鏄叾涓殑鍏夌収妯″瀷絳夊唴瀹廣?br>姣斿錛屾柟鍚戝厜鐨勫疄鐜幫細<br>    //directional light-----------------------------------------------------------------<br>    float3 lightDir = g_lightPos - In.worldPos;<br>    float3 lightDirNorm = normalize(lightDir);<br>    float3 SDir = normalize( g_lightPos - g_eyePos);<br>    float cosGammaDir = dot(SDir, V);<br>    float dirLighting = g_Kd*dirLightIntensity*saturate( dot( N,lightDirNorm ) );<br>    //diffuse<br>    float3 diffuseDirLight = dirLighting*exDir;        <br>    //airlight<br>    float3 dirAirLight = phaseFunctionSchlick(cosGammaDir)* dirLightIntensity*float3(1-exDir.x,1-exDir.y,1-exDir.z);<br>    //specular<br>    float3 specularDirLight = saturate( pow(  dot(lightDirNorm,reflVect),g_specPower)) * dirLightIntensity * g_KsDir * exDir;<br>鐐瑰厜婧愮殑瀹炵幇錛?br>  //point light 1---------------------------------------------------------------------<br>    //diffuse surface radiance and airlight due to point light<br>    float3 pointLightDir = g_PointLightPos - In.worldPos;<br>    //diffuse<br>    float3 diffusePointLight1 = calculateDiffusePointLight(0.1,Dvp,g_DSVPointLight,pointLightDir,N,V);<br>    //airlight<br>    float3 airlight1 = calculateAirLightPointLight(Dvp,g_DSVPointLight,g_VecPointLightEye,V);<br>    //specular<br>    float3 specularPointLight = Specular(g_PointLightIntensity, g_KsPoint, length(pointLightDir), Dvp, g_specPower, normalize(pointLightDir), reflVect);<br>璁$畻鐐瑰厜婧愮殑婕皠鍏夛細<br>float3 calculateDiffusePointLight(float Kd,float Dvp,float Dsv,float3 pointLightDir,float3 N,float3 V)<br>{</p> <p>    float Dsp = length(pointLightDir);<br>    float3 L = pointLightDir/Dsp;<br>    float thetas = acos(dot(N, L));<br>    float lightIntensity = g_PointLightIntensity * 100;<br>    <br>    //spotlight<br>    float angleToSpotLight = dot(-L, g_SpotLightDir);<br>    if(g_useSpotLight)<br>    {    if(angleToSpotLight > g_cosSpotlightAngle)<br>             lightIntensity *= abs((angleToSpotLight - g_cosSpotlightAngle)/(1-g_cosSpotlightAngle));<br>         else<br>             lightIntensity = 0;         <br>    }   <br>    <br>    //diffuse contribution<br>    float t1 = exp(-g_beta.x*Dsp)*max(cos(thetas),0)/Dsp;<br>    float4 t2 = g_beta.x*Gtable.SampleLevel(samLinearClamp, float2((g_beta.x*Dsp-g_diffXOffset)*g_diffXScale, (thetas-g_diffYOffset)*g_diffYScale),0)/(2*PI);<br>    float rCol = (t1+t2.x)*exp(-g_beta.x*Dvp)*Kd*lightIntensity/Dsp;<br>    float diffusePointLight = float3(rCol,rCol,rCol);  <br>    return diffusePointLight.xxx;<br>}<br>璁$畻楂樺厜錛?br>float3 Specular(float lightIntensity, float Ks, float Dsp, float Dvp, float specPow, float3 L, float3 VReflect)<br>{<br>    lightIntensity = lightIntensity * 100;<br>    float LDotVReflect = dot(L,VReflect);<br>    float thetas = acos(LDotVReflect);</p> <p>    float t1 = exp(-g_beta*Dsp)*pow(max(LDotVReflect,0),specPow)/Dsp;<br>    float4 t2 = g_beta.x*G_20table.SampleLevel(samLinearClamp, float2((g_beta.x*Dsp-g_20XOffset)*g_20XScale, (thetas-g_20YOffset)*g_20YScale),0)/(2*PI);<br>    float specular = (t1+t2.x)*exp(-g_beta.x*Dvp)*Ks*lightIntensity/Dsp;<br>    return specular.xxx;<br>}<br>涓嬩竴姝ワ紝鑰冭檻濡備綍涓嶉氳繃DX9鎺ュ彛錛岀洿鎺ュ鍏鏂囦歡銆?/p> <img src ="http://www.shnenglu.com/bloodbao/aggbug/56387.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/bloodbao/" target="_blank">bloodbao</a> 2008-07-17 10:26 <a href="http://www.shnenglu.com/bloodbao/archive/2008/07/17/56387.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏀懼亣浼戞伅http://www.shnenglu.com/bloodbao/archive/2008/07/15/56197.htmlbloodbaobloodbaoTue, 15 Jul 2008 07:53:00 GMThttp://www.shnenglu.com/bloodbao/archive/2008/07/15/56197.htmlhttp://www.shnenglu.com/bloodbao/comments/56197.htmlhttp://www.shnenglu.com/bloodbao/archive/2008/07/15/56197.html#Feedback0http://www.shnenglu.com/bloodbao/comments/commentRss/56197.htmlhttp://www.shnenglu.com/bloodbao/services/trackbacks/56197.html      鏈潵鎯沖啓涓▼搴忕殑錛屽彲鏄垜鍙戣鑷凡鐨勮嚜鎺у姏澶樊浜嗐傚垰鎽稿埌涓鏈皬璇達紝灝辮榪蜂綇浜嗭紝浠ヨ嚦浜庤繖涓鍛ㄩ兘鍦ㄧ湅閭f湰灝忚錛岀▼搴忔柟闈㈡槸涓鐐硅繘搴﹂兘鏈夈傞偅鏄湰鍏充簬SC鐨勫皬璇達紝浣嗕負涓涓槦闄呰糠錛屾垜娣辨繁鍦拌鍚稿紩浜嗭紝姣忓綋鎴戜竴鎽稿埌鐢佃剳錛屽氨涓嶈嚜瑙夊湴鐐硅繘灝忚鐨勭綉欏典腑錛岃繘鍏ラ偅涓猄C鐨勮櫄騫葷┖闂淬?br>鐪嬪畬灝忚錛屾湰浠ヤ負榪樿兘騫茬偣浠涔堬紝緇撴灉鍙堜笅浜嗘湰DOOM鍚ず褰曪紝鍙堣糠榪涘幓浜嗐傚搸錛岀湅鏉ュ皬璇存槸涓嶈兘紕板暒錛屾垜鍙笉鎯蟲案榪滃憜鍦ㄨ繖涓鍦版柟銆?br>絳夋壘鍒板伐浣滐紝鍐嶇湅灝忚鍚с?

bloodbao 2008-07-15 15:53 鍙戣〃璇勮
]]>
欧美伊人久久大香线蕉综合| 久久亚洲精品中文字幕| 久久精品国产亚洲7777| 天堂无码久久综合东京热| 久久亚洲熟女cc98cm| …久久精品99久久香蕉国产| 日韩亚洲国产综合久久久| 日产精品久久久一区二区| 99久久无码一区人妻| 久久久久久精品成人免费图片| 久久ZYZ资源站无码中文动漫| 国产精品99久久久久久猫咪| 人妻精品久久无码专区精东影业| 欧美精品一区二区久久| 久久综合综合久久97色| 色婷婷综合久久久久中文| 亚洲国产精品综合久久网络| 国产精品久久久久9999| 久久WWW免费人成一看片| 日韩久久久久中文字幕人妻| 久久精品国产69国产精品亚洲| 亚洲人成网亚洲欧洲无码久久| 国产999精品久久久久久| 99久久精品国产麻豆| 亚洲午夜无码久久久久| 国产精品久久久久久久人人看 | 国内精品久久久久久久久| 人妻无码中文久久久久专区| 国产精品久久久久久久久久影院 | 伊人久久大香线蕉av不卡| 久久国产美女免费观看精品| 99久久99久久精品免费看蜜桃| 无码人妻少妇久久中文字幕蜜桃| 综合久久久久久中文字幕亚洲国产国产综合一区首 | 人妻少妇久久中文字幕一区二区 | 中文精品99久久国产 | 国产成人精品久久亚洲高清不卡 | 久久久久久无码Av成人影院| 亚洲中文字幕久久精品无码APP| 国产69精品久久久久9999APGF | 久久精品中文字幕一区|