• <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>

            4D星宇

            c++

              C++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
              57 隨筆 :: 0 文章 :: 39 評(píng)論 :: 0 Trackbacks

            #

            有Effect版:
                DWORD         g_dwShaderFlags; // Shader compilate and link flags
                  LPD3DXBUFFER  g_pCompiledFragments = NULL; 

                D3DXGatherFragmentsFromFile( L"FragmentLinker.fx", NULL,
                            NULL, g_dwShaderFlags, &g_pCompiledFragments, NULL );

            D3DXGatherFragmentsFromFile requires the .fx file, pointers to the #define and #include handlers (both set to NULL in this example), and the shader compile flags. The method returns a buffer which contains the compiled shader fragment. The method can return a second buffer with compile errors, which is set to NULL in this example because it is not used. D3DXGatherFragments is overloaded to handle loading fragments from a string, a file, or a resource.

            Set your debugger to break on this method to look for compile errors in the debugger. The compiler can catch errors in syntax, but it cannot check for registers that are shared incorrectly due to the fact that it has no way to predict which parameters a user may want to share between fragments.

            You need a fragment linker to manage the compiled fragments. Create the fragment linker by calling D3DXCreateFragmentLinker:

            ID3DXFragmentLinker* g_pFragmentLinker = NULL;     // Fragment linker interface
            IDirect3DDevice9*    pd3dDevice        = NULL;

                // Initialize the device before using it
             ...
             
                // Create the fragment linker interface
                D3DXCreateFragmentLinker( pd3dDevice, 0, &g_pFragmentLinker );

            Then simply add the compiled fragments to the fragment linker using ID3DXFragmentLinker::AddFragments.

                // Add the compiled fragments to a list
                g_pFragmentLinker->AddFragments(    
                          (DWORD*)g_pCompiledFragments->GetBufferPointer() );

            ID3DXFragmentLinker::AddFragments requires a pointer to the DWORD stream that contains the compiled shader.

            After compiling fragments and creating a fragment linker, there are several ways to link fragments. One way to link a vertex shader fragment is to call ID3DXFragmentLinker::LinkVertexShader. Here is an example that links two vertex shader fragments:

                // Get a handle to each fragment   
                D3DXHANDLE fragmentHandle[2];
             fragmentHandle[0] =
                 (D3DXHANDLE)g_pFragmentLinker->GetFragmentHandleByName("Ambient");
             fragmentHandle[1] =
                 (D3DXHANDLE)g_pFragmentLinker->GetFragmentHandleByName("AmbientDiffuseFragment");
               
                // Link the fragments together to form a vertex shader
                IDirect3DVertexShader9* pVertexShader = NULL;
                g_pFragmentLinker->LinkVertexShader( "vs_1_1", g_dwShaderFlags,
                       fragmentHandle, 2, &pVertexShader, NULL );

            This requires a shader compile target, the shader compile and link flags, and a handle to each of the fragments to link. If the fragments are successfully linked, ID3DXFragmentLinker::LinkVertexShader returns a vertex shader (IDirect3DVertexShader9). The vertex shader needs to be set in the effect before rendering. But before this, here's how the shader is declared in the effect:

            VertexShader MyVertexShader; // Vertex shader set by the application

            The effect technique contains all the state set for a pass. This pass specifies the vertex shader like this:

            technique RenderScene
            {
                pass P0
                {
                    VertexShader = <MyVertexShader>;   
                    PixelShader = compile ps_1_1 ModulateTexture();   
                }

            With the effect's vertex shader created and initialized, the render code also sets the uniform constants and calls the render loop. Set the uniform constants similar to this:

                // Update the uniform shader constants.
                g_pEffect->SetMatrix( "g_mWorldViewProjection", &mWorldViewProjection );
                g_pEffect->SetMatrix( "g_mWorld", &mWorld );
                g_pEffect->SetFloat( "g_fTime", (float)fTime );   
            Then render the effect by setting the current technique and pass:

                // Render the scene
                if( SUCCEEDED( pd3dDevice->BeginScene() ) )
                { 
                    // Apply the technique contained in the effect
                    UINT cPasses, iPass;
                    g_pEffect->Begin(&cPasses, 0);

                    for (iPass = 0; iPass < cPasses; iPass++)
                    {
                        g_pEffect->BeginPass(iPass);

                        // Render the mesh with the applied technique
                        g_pMesh->DrawSubset(0);

                        g_pEffect->EndPass();
                    }
                    g_pEffect->End();

                    pd3dDevice->EndScene();
                }

            When setting uniform shader constants, it is more efficient to cache a handle to the parameter by calling ID3DXBaseEffect::GetParameterByName. This avoids the string lookup that is necessary when calling effect methods like ID3DXBaseEffect::SetMatrix.

              // Instead of setting a uniform constant like this in the render loop
              g_pEffect->SetMatrix( "g_mWorldViewProjection", &mWorldViewProjection );

              // Get a handle to a uniform constant outside of the render loop
              D3DXHANDLE hParameter;
              GetParameterByName( hParameter,"g_mWorldViewProjection");

              ...
             
              // Use the handle to set the uniform constant in the render loop
              g_pEffect->SetMatrix(hParameter);

            無(wú)Effect版:
             LPD3DXCONSTANTTABLE pConstantTable;
                LPD3DXBUFFER pShaderBuf;
                IDirect3DVertexShader9* pVertexShader = NULL;

                // Compile the fragments to a buffer.
                D3DXGatherFragmentsFromFile( L"FragmentLinker.fx", NULL, NULL,
                     g_dwShaderFlags, &g_pCompiledFragments, NULL );
               
                g_pFragmentLinker->AddFragments((DWORD*)g_pCompiledFragments->GetBufferPointer());
                g_pFragmentLinker->LinkShader(
                 "vs_1_1",
                 g_dwShaderFlags,
                 aHandles,
                 NUM_FRAGMENTS,
                 &pShaderBuf,
                 NULL);
                D3DXGetShaderConstantTable(
                 (DWORD*)pShaderBuf->GetBufferPointer(),
                 &pConstantTable );
               
                pDevice->CreateVertexShader(
                 (DWORD*)pShaderBuf->GetBufferPointer(),
                 &pVertexShader);
                RELEASE(pShaderBuf);

            posted @ 2008-05-12 19:51 bloodbao 閱讀(456) | 評(píng)論 (0)編輯 收藏

            OGRE場(chǎng)景管理:
            PCZSceneManager : public SceneManager
            節(jié)點(diǎn):
                typedef std::list < SceneNode * > NodeList;
                typedef std::list < WireBoundingBox * > BoxList;
            攝像機(jī):
                class PCZCamera;
            天空:
                void setSkyZone(PCZone * zone);
            光照:
                createLight(const String& name);
            地帶:
                class PCZone;
                PCZone * createZone(const String& zoneType, const String& instanceName);
            釋放節(jié)點(diǎn):
                void removeSceneNode( SceneNode * );
            節(jié)點(diǎn)查找:
                void findNodesIn( const AxisAlignedBox &box,
                    PCZSceneNodeList &list,
                    PCZone * startZone,
                    PCZSceneNode *exclude = 0 );

                class PCZIntersectionSceneQuery;-----相交查詢
                class PCZRaySceneQuery;---------射線查詢
                class PCZSphereSceneQuery;--------球面查詢
                class PCZAxisAlignedBoxSceneQuery;------箱查詢(沿軸向)
                class PCZPlaneBoundedVolumeListSceneQuery;-------表查詢
            簡(jiǎn)單地看了OGRE的場(chǎng)景管理,除了OGREMAIN部分,還用了PCZ插件來(lái)實(shí)繼承并實(shí)現(xiàn)。
            (class PCZSceneManagerFactory : public SceneManagerFactory)挺復(fù)雜的,相比之下,鬼火的場(chǎng)景管理就簡(jiǎn)單了,
            可調(diào)用多種節(jié)點(diǎn)。

            posted @ 2008-05-11 11:42 bloodbao 閱讀(1483) | 評(píng)論 (0)編輯 收藏

            posted @ 2008-05-10 22:00 bloodbao 閱讀(186) | 評(píng)論 (1)編輯 收藏

            175.5K MilkShape_3D_v1.8.2.zip
             
            已經(jīng)成功地保存在Mofile
            文件提取碼: 4330054774071826
             
                當(dāng)您的朋友需要提取此文件時(shí)只需:
                 匿名提取文件連接 http://pickup.mofile.com/4330054774071826
                 或登錄Mofile,使用提取碼 4330054774071826 提取文件
            呼呼,,高興啊,剛收到朋友發(fā)來(lái)的UNREAL3的源碼!可以好好的研究一下啦,找不到工作,我就做自已的游戲,自已的引擎!
            posted @ 2008-05-08 19:35 bloodbao 閱讀(478) | 評(píng)論 (0)編輯 收藏

            這一次的應(yīng)聘是徹底失敗了,不過(guò),也算是見(jiàn)識(shí)了福建的網(wǎng)游公司。
            一天坐了九個(gè)小時(shí)的車,我算是體驗(yàn)到了討生活的艱辛。
            中午坐車的時(shí)候天還是炎熱的,下午開(kāi)始狂下雨,我穿著兩件衣服還一直在發(fā)抖。
            先來(lái)談?wù)劯惺埽?br>1.公司內(nèi)部環(huán)境不錯(cuò),很漂亮的游泳池,攀沿壁,會(huì)議室,食堂。我比較喜歡那個(gè)游泳池,感覺(jué)很不錯(cuò)。
            2.美女很多,特別是人事部門的,那么冷的天氣,穿著超短裙,簡(jiǎn)是要風(fēng)度不要溫度。不過(guò),特別養(yǎng)眼。
            3.工作環(huán)境,兩三百個(gè)人擠在一個(gè)大廳中。好像,各個(gè)開(kāi)發(fā)組都在一起吧,有些成員面前放著兩臺(tái)很大的液晶,很上去就挺爽的。只是這么吵雜的環(huán)境適合開(kāi)發(fā)嗎,偶是不知道的。
            4.人事部的MM挺勤快的,不過(guò),依舊有被扔在一旁的感覺(jué),特別是在等與主程見(jiàn)面的時(shí)間,差不多快一個(gè)小時(shí)。幸好旁邊的一個(gè)帥哥給了本雜志,讓我打發(fā)時(shí)間。
            5.每時(shí)每刻都有人在應(yīng)聘,不過(guò),都是招文員。感覺(jué)就去了一個(gè)PHP的,也算技術(shù)的。
            6.主程很厲害,用現(xiàn)在的話講,叫很牛。人事的MM,說(shuō)他很嚴(yán)格,面試的題目都是他出的,非常難。面談時(shí)果然很嚴(yán),偶不是計(jì)算機(jī)科班出身的,雖然C++用的不是爐火純青,但也有兩三年的基礎(chǔ),對(duì)基本概念都是小懂的,可是要我按書(shū)本上背出來(lái),讓我有點(diǎn)難以接受(也背不出來(lái)啊)。
            至于題目的難度,有用的C++的朋友,應(yīng)該都是了解的。還有就是那個(gè)主程一直想讓我講優(yōu)點(diǎn)和缺點(diǎn),估計(jì)是出于崗位安排考慮,可是俺一直找不來(lái)自已的特色,這算是我面試的敗筆吧。最大的敗筆可能是對(duì)人事的MM,說(shuō)了句這考題太EASY了。
            7.帶去代碼用的調(diào)試環(huán)境太高,這是我的錯(cuò)!哎,誰(shuí)讓我的開(kāi)發(fā)環(huán)境是VISTA+VC2008!嗯,難道ND都沒(méi)有一臺(tái)電腦跑這個(gè)的?
            那主程說(shuō)程序打不開(kāi)。哎,我的錯(cuò)。直覺(jué)告訴我,這個(gè)主程比華為面試官差多了,簡(jiǎn)直是兩個(gè)檔次的。以前,在和華為的交流時(shí),那態(tài)度啊,對(duì)代碼的分析,都很不錯(cuò)。可憐,那時(shí)我剛學(xué)C++,傻乎乎的就跑去面試,華為招硬件+C的比較多,和偶的不適合(我不懂?dāng)?shù)字電路,模電等硬件方面的知識(shí))。
            8.我說(shuō)了我的優(yōu)勢(shì)在對(duì)數(shù)學(xué)的了解上,比如矩陣可能在引擎上有一定的應(yīng)用。那主程直接和我說(shuō),數(shù)學(xué)在游戲開(kāi)發(fā)上應(yīng)用不太。我忽視了,ND好像用的是UNREAL,別人的引擎,不用自已開(kāi)發(fā)底層吧?
            C++
            1.什么是繼承?
            2.什么是多態(tài)性?
            3.什么是Iterator,有什么作用?
            4.STL是什么?
            5.STACK,LIST和MAP有什么不同?
            6.什么是重載(overloading)和重寫(overridding)?有什么區(qū)別?
            7.多線程有幾種。。。?
            8.MUTEX和CRITICALSECTION有什么區(qū)別?
            9.ENTERCRITICALSECTION和TRYENTERCRITICALSECTION有什么不同?
            D3D
            1.材質(zhì)是什么?有些什么元素?
            2.LOD時(shí)產(chǎn)生T型裂縫和呼吸效應(yīng),有什么優(yōu)化方案?
            3.淺解HDR技術(shù)?
            4.什么是BILLBOARD,怎么實(shí)現(xiàn)?
            5.什么是BSP?用在室內(nèi)還是室外?怎么實(shí)現(xiàn)?
            6.模板緩沖區(qū)的應(yīng)用?
            7.逆矩陣有什么應(yīng)用?
            面試時(shí):
            1.D3D或ONPENGL,實(shí)現(xiàn)一個(gè)三角形?(過(guò)程)
            2.用過(guò)什么物理引擎?
            3.用過(guò)什么腳本?
            4.自已的優(yōu)缺點(diǎn)?
            5.有什么作品并介紹?
            6.對(duì)3D中的什么最熟悉?
            總結(jié):敗軍之將,談什么都是沒(méi)用的,找不到好工作苦的是自已,趕快加深自身的修養(yǎng)。特別是表達(dá)和溝通能力。
            posted @ 2008-05-08 14:38 bloodbao 閱讀(851) | 評(píng)論 (8)編輯 收藏

            該項(xiàng)目使用INI來(lái)實(shí)現(xiàn)數(shù)據(jù)的讀取。
            比如:
            1.節(jié)點(diǎn)讀取
            INI部分:
            外觀
            Look
             Body
              model=impreza.3ds
              scale=1 1 1
             Wheels
              model=wheel.3ds
              scale=1 1 1
            聲音
            Sound
             Engine
              wave=206_engine.wav
              pitch_low=0.2
              pitch_high=1.5
            程序部分:
            //load car

             body.node=loadModel(cfg, "Look/Body/", device, sm, driver);

             body.node_debug=sm->addCubeSceneNode(1, 0, -1, core::vector3df(0, 0, 0), core::vector3df(0, 0, 0),
              cfg.Getval_vector("Body/Chassis/1/scale", core::vector3df(1, 1, 1))
              );
             body.node_debug->setMaterialTexture(0, driver->getTexture("data/misc/checked.jpg"));
            2.車輪的屬性
             Wheel #default
              damp=30000
              spring=50000
              radius=0.38
              weight=20
              width=0.10 #not yet used if user specifies wheel model
              brakes=0 # 0.0 - 1.0
             Wheel_1 #fl
              pos=1.39 -0.145 0.823
              attr=STEER
              brakes=0.8
              rotation_z=1.5707963 #used just by client part
             Wheel_2 #fr
              pos=1.39 -0.145 -0.823
              attr=STEER
              brakes=0.8
              rotation_z=4.7123889
             Wheel_3 #rl
              pos=-1.350 -0.15 0.823
              attr=STRAIGHT|THURST
              brakes=0.2
              rotation_z=1.5707963
             Wheel_4 #rr
              pos=-1.350 -0.15 -0.823
              attr=STRAIGHT|THURST
              brakes=0.2
              rotation_z=4.7123889
            for (int i=0; ; i++) {
              char buf2[128];

              sprintf(buf2, "Body/Wheel_%d/", i+1);
              buf=buf2;

              if (!cfg.Getval_exists(buf+"attr")) break;

              double radius=cfg.Getval_double((string)buf+"radius", cfg.Getval_double("Body/Wheel/radius", 1));
              double width=cfg.Getval_double((string)buf+"width", cfg.Getval_double("Body/Wheel/width", 1));

              scene::ISceneNode* node=loadModel(cfg, "Look/Wheels/", device, sm, driver);
              CModelAttr wm;

              scene::IMesh* cm=CreateCylinder(25, 2, 1);
              scene::ISceneNode* node_debug=sm->addMeshSceneNode(cm);
              node_debug->setScale(core::vector3df((f32)(radius), (f32)width, (f32)(radius)));
              node_debug->setMaterialTexture(0, driver->getTexture("data/misc/checked.jpg"));
              node_debug->getMaterial(0).EmissiveColor.set(255,255,255,255);

              wm.arot=core::vector3df((f32)cfg.Getval_double(buf+"rotation_x", 0),
                (f32)cfg.Getval_double(buf+"rotation_y", 0),
                (f32)cfg.Getval_double(buf+"rotation_z", 0));
              wm.node=node;
              wm.node_debug=node_debug;

              wheels.push_back(wm);
             }
            3.聲音---車開(kāi)動(dòng)時(shí)的轟鳴聲
             //load sounds
             try {
              snd_engine = new openalpp::Source((ALbyte*)("data/cars/"+profile+"/"+cfg.Getval_str("Sound/Engine/wave")).c_str());
              if (!snd_engine.valid())
               DBGCOUT("ALUT", "Coulnd't load file", ("data/cars/"+profile+"/"+cfg.Getval_str("Sound/Engine/wave")).c_str());
              else {
               snd_engine->setGain(1);
               snd_engine->setPosition(0.0,0.0,0.0);
               snd_engine->setLooping(true);
              }
              snd_engine_pitch_low=cfg.Getval_double("Sound/Engine/pitch_low");
              snd_engine_pitch_high=cfg.Getval_double("Sound/Engine/pitch_high");
             } catch(openalpp::Error e) {
              std::cerr << e << "\n";
             }

            posted @ 2008-05-08 10:31 bloodbao 閱讀(198) | 評(píng)論 (0)編輯 收藏

            ODE常用變量:
            dWorldID world;
            dSpaceID space;
            dJointGroupID  contactgroup;
            dBodyID body;
            dGeomID geom;
            初始化:
            void InitODE(){
             dInitODE();
             world=dWorldCreate();
             space=dHashSpaceCreate(0);
             contactgroup=dJointGroupCreate(0);
             dWorldSetGravity(world,0,-9.8,0);
            }
            回調(diào)函數(shù):計(jì)算碰撞點(diǎn)
            void nearCallback(void* node, dGeomID o1, dGeomID o2)
            {
              int i=0;
              dBodyID b1=dGeomGetBody(o1);
              dBodyID b2=dGeomGetBody(o2);
              const int MAX_CONTACTS = 8;
              if(b1 && b2 && dAreConnectedExcluding(b1,b2,dJointTypeContact))return;
              dContact contact[MAX_CONTACTS];
                for(i=0;i<MAX_CONTACTS;++i)
              {
                contact[i].surface.mode=dContactBounce | dContactSoftCFM;
                contact[i].surface.mu=100000.0;
                contact[i].surface.mu2=.00001;
                contact[i].surface.bounce=.2;
                contact[i].surface.bounce_vel=.1;
                contact[i].surface.soft_cfm=.0000001;
              }
                int numc=dCollide(o1,o2,MAX_CONTACTS,&contact[0].geom,sizeof(dContact));
              if(numc>0)
              {
                for(i=0;i<numc;i++)
                {
                  dJointID c=dJointCreateContact(world,contactgroup,&contact[i]);
                  dJointAttach(c,b1,b2);
                }
              }
            }
            程序主循環(huán)
            while(device->run())
             {
              setPosition(geom);
              dJointGroupEmpty (contactgroup);    //清空碰撞點(diǎn)組
              driver->beginScene(true, true, SColor(0,200,200,200));
              dSpaceCollide (space,0,&nearCallback); //通過(guò)回調(diào)函數(shù)計(jì)算碰撞點(diǎn)等數(shù)據(jù)
              dWorldQuickStep(world,0.025); //使物理世界隨著時(shí)間變化
              smgr->drawAll();
              guienv->drawAll();

              driver->endScene();
             }

            posted @ 2008-05-08 10:27 bloodbao 閱讀(541) | 評(píng)論 (4)編輯 收藏


            概要:雨粒子每刻的動(dòng)畫使用輸出流,在每一幀都使用geometry Shader擴(kuò)成billboard.
            最后,雨粒子的渲染使用的紋理庫(kù)存儲(chǔ)在一個(gè)紋理陣列。使用DX10和GeForce8 系列GPU。
            1.應(yīng)用風(fēng)和重力使粒子一直在作動(dòng)畫。
            2.把粒子擴(kuò)成要在每一幀渲染的精靈。
            3.渲染精靈
            1.(1)C++使用輸出流
            //設(shè)立渲染點(diǎn)列表,每個(gè)粒子存一個(gè)頂點(diǎn)。
            pd3dDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_POINTLIST);
            pd3dDevice->IASetInputLayout(g_pVertexLayoutRainVertex);
            //決定哪個(gè)頂點(diǎn)緩沖我們既將要渲染
            假如這是第一幀我們渲染一個(gè)預(yù)產(chǎn)生的頂點(diǎn)幀g_pParticleStart
             static bool firstFrame=true;
             ID3D10Buffer* pBuffers[1];
             if(firstFrame)
              pBuffers[0]=g_pParticleStart;
             else
              pBuffers[0]=g_pParticleDrawFrom;
             pDevice->IASetVertexBuffers(0,1,pBuffers,stride,offset);
             //指向正確的輸出緩沖
             pBuffers[0] = g_pParticleStreamTo;
                    pd3dDevice->SOSetTargets( 1, pBuffers, offset );
                   
                    // 畫圖,使粒子動(dòng)畫
                    D3D10_TECHNIQUE_DESC techDesc;
                    g_pTechniqueAdvanceRain->GetDesc( &techDesc );
                    g_pTechniqueAdvanceRain->GetPassByIndex(0)->Apply(0);

                    pd3dDevice->Draw(g_numRainVertices , 0 );

                    // Get back to normal
                    pBuffers[0] = NULL;
                    pd3dDevice->SOSetTargets( 1, pBuffers, offset );

                    // Swap buffers交換緩沖區(qū)
                    ID3D10Buffer* pTemp = g_pParticleDrawFrom;
                    g_pParticleDrawFrom = g_pParticleStreamTo;
                    g_pParticleStreamTo = pTemp;
               
                    firstFrame = false;
            2.(2)HLSL--使用Geometry shader Expanding

            GeometryShader gsStreamOut = ConstructGSWithSO( CompileShader( vs_4_0, VSAdvanceRain() ), "POSITION.xyz; SEED.xyz; SPEED.xyz; RAND.x; TYPE.x" ); 
            technique10 AdvanceParticles
            {
                pass p0
                {
                    SetVertexShader( CompileShader( vs_4_0, VSAdvanceRain() ) );
                    SetGeometryShader( gsStreamOut );
                    SetPixelShader( NULL );
                   
                    SetDepthStencilState( DisableDepth, 0 );
                } 
            }
            (3)HLSL--使用Geometry shader Extruding
            // GS for rendering rain as point sprites.  Takes a point and turns it into 2 tris.
            [maxvertexcount(4)]
            void GSRenderRain(point VSParticleIn input[1], inout TriangleStream<PSSceneIn> SpriteStream)
            {
                float totalIntensity = g_PointLightIntensity*g_ResponsePointLight + dirLightIntensity*g_ResponseDirLight;
                if(!cullSprite(input[0].pos,2*g_SpriteSize) && totalIntensity > 0)
                {   
                    PSSceneIn output = (PSSceneIn)0;
                    output.type = input[0].Type;
                    output.random = input[0].random;
                  
                    float3 pos[4];
                    GenRainSpriteVertices(input[0].pos.xyz, input[0].speed.xyz/g_FrameRate + g_TotalVel, g_eyePos, pos);
                   
                    float3 closestPointLight = g_PointLightPos;
                    float closestDistance = length(g_PointLightPos - pos[0]);
                    if( length(g_PointLightPos2 - pos[0]) < closestDistance )
                       closestPointLight = g_PointLightPos2;
                   
                    output.pos = mul( float4(pos[0],1.0), g_mWorldViewProj );
                    output.lightDir = g_lightPos - pos[0];
                    output.pointLightDir = closestPointLight - pos[0];
                    output.eyeVec = g_eyePos - pos[0];
                    output.tex = g_texcoords[0];
                    SpriteStream.Append(output);
                           
                    output.pos = mul( float4(pos[1],1.0), g_mWorldViewProj );
                    output.lightDir = g_lightPos - pos[1];
                    output.pointLightDir = closestPointLight - pos[1];
                    output.eyeVec = g_eyePos - pos[1];
                    output.tex = g_texcoords[1];
                    SpriteStream.Append(output);
                   
                    output.pos = mul( float4(pos[2],1.0), g_mWorldViewProj );
                    output.lightDir = g_lightPos - pos[2];
                    output.pointLightDir = closestPointLight - pos[2];
                    output.eyeVec = g_eyePos - pos[2];
                    output.tex = g_texcoords[2];
                    SpriteStream.Append(output);
                           
                    output.pos = mul( float4(pos[3],1.0), g_mWorldViewProj );
                    output.lightDir = g_lightPos - pos[3];
                    output.pointLightDir = closestPointLight - pos[3];
                    output.eyeVec = g_eyePos - pos[3];
                    output.tex = g_texcoords[3];
                    SpriteStream.Append(output);
                   
                    SpriteStream.RestartStrip();
                }  
            }

            3.
            渲染點(diǎn)精靈
            使用DX10新特性Texture Array
            渲染霧
            運(yùn)行范例:
            范例顯示兩個(gè)點(diǎn)光源和一條直射光下的橋。
            左鍵控制直射光。

            posted @ 2008-05-08 10:25 bloodbao 閱讀(402) | 評(píng)論 (0)編輯 收藏

            posted @ 2008-05-06 21:28 bloodbao 閱讀(192) | 評(píng)論 (0)編輯 收藏

            哎,,被雨淋得死,全身都在發(fā)抖,明顯不在狀態(tài),結(jié)果是回去等通知。 估計(jì)是沒(méi)戲了,再過(guò)兩三天把面試過(guò)程總結(jié)出來(lái)。 無(wú)語(yǔ)中。。。。。。。。。。。。。
            posted @ 2008-05-06 21:02 bloodbao 閱讀(120) | 評(píng)論 (0)編輯 收藏

            僅列出標(biāo)題
            共6頁(yè): 1 2 3 4 5 6 
            免费久久人人爽人人爽av| 久久福利青草精品资源站| 久久久久精品国产亚洲AV无码| 精品国产99久久久久久麻豆| 久久久噜噜噜久久熟女AA片 | 久久综合久久综合亚洲| 国产精品99久久久精品无码| 日韩亚洲欧美久久久www综合网| 亚洲精品99久久久久中文字幕 | 99久久久精品| 亚洲国产高清精品线久久 | 成人久久久观看免费毛片| 日本欧美国产精品第一页久久| 久久亚洲精品国产精品| 人人狠狠综合久久亚洲高清| 国产精品18久久久久久vr | 欧美熟妇另类久久久久久不卡| 久久国产精品免费一区| 99久久精品毛片免费播放| 伊人久久大香线蕉精品不卡| 91精品国产91热久久久久福利| 无码国产69精品久久久久网站| 无码8090精品久久一区 | 久久久亚洲欧洲日产国码是AV| 亚洲国产精品婷婷久久| 成人国内精品久久久久一区| 久久久久久久波多野结衣高潮| 国产视频久久| 99久久精品国产一区二区蜜芽| 久久91综合国产91久久精品| 成人妇女免费播放久久久| 色偷偷88888欧美精品久久久| 久久亚洲精品成人无码网站| 日韩电影久久久被窝网| 久久精品成人免费观看97| 国产精品免费久久久久久久久| 日本道色综合久久影院| 久久久久一区二区三区| 久久九九有精品国产23百花影院| 国产产无码乱码精品久久鸭| 999久久久免费精品国产|