久久精品国产精品国产精品污,男人扒开添女人下部免费视频,一级国产69式性姿势免费视频,夜鲁夜鲁很鲁在线视频 视频,欧美丰满少妇一区二区三区,国产偷国产偷亚洲高清人乐享,中文 在线 日韩 亚洲 欧美,熟妇人妻无乱码中文字幕真矢织江,一区二区三区人妻制服国产

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

D3D11 法线贴图(凹凸贴图)

發(fā)布時(shí)間:2024/8/1 编程问答 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 D3D11 法线贴图(凹凸贴图) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

本章將學(xué)習(xí)如何讓一張平坦的紋理表面具有深度感,該技術(shù)叫法線貼圖。這里是基于前面加載obj模型的章節(jié)構(gòu)建的,但不會(huì)使用那個(gè)模型,而會(huì)使用一個(gè)更為簡(jiǎn)單的地面草地紋理的模型。

法線貼圖技術(shù)要做的事情就是讓普通紋理在使能光照時(shí)看起來有凹凸深度感。它是通過給每個(gè)像素而不是給每個(gè)頂點(diǎn)定義法線來實(shí)現(xiàn)的,然后插值到整個(gè)表面。為了實(shí)現(xiàn)該技術(shù),要使用紋理(Texture)或切線(Tangent)空間(與世界或本地視圖空間類比)。

紋理/切線空間

也許會(huì)疑惑為什么不直接使用法線貼圖來做凹凸呢?這是因?yàn)榉ň€貼圖的法線先要轉(zhuǎn)換到插值法線(頂點(diǎn)法線)空間,而實(shí)際上不能夠直接將法線貼圖的法線轉(zhuǎn)換到物體世界空間。這是因?yàn)槲矬w上的每個(gè)頂點(diǎn)可能會(huì)有不同的位置,法線和紋理坐標(biāo),意味著在物體上每個(gè)三角形的面都朝向不同的方向以及有著不同的紋理坐標(biāo),因此這么做后就必須要將法線貼圖的法線轉(zhuǎn)換到每個(gè)三角形而不是物體世界空間了。

若試著將一張凹凸感的貼圖貼到到立方體上。法線貼圖法線方向默認(rèn)是指向相機(jī)的,同時(shí)立方體的前面是朝向相機(jī)的,再將法線貼圖和立方體放入世界空間,假設(shè)讓它們旋轉(zhuǎn)90度。若直接將法線貼圖轉(zhuǎn)換到世界空間,會(huì)看到立方體的右面(就是之前的前面)有得到凹凸感,這是因?yàn)榉ň€貼圖同時(shí)也旋轉(zhuǎn)了90度,此時(shí)所有的法線貼圖的法線都指向右邊(而之前是指向相機(jī)的)。然而,立方體其他的面也會(huì)試著要使用轉(zhuǎn)換過的法線貼圖,但是現(xiàn)在都只指向右邊。這導(dǎo)致立方體上所有的法線方向都指向右邊,而不是指向每個(gè)面。這就是為什么需要為物體上的每個(gè)面使用獨(dú)立的空間來實(shí)現(xiàn)法線貼圖。

表示紋理空間的軸被稱為法線(Normal),副切線(Bitangent),和切線(Tangent)(T,B,N)。法線表示面所指向的方向,副切線和切線類似面的U,V紋理坐標(biāo)。


法線Normal

從每個(gè)頂點(diǎn)處獲取法線,然后使用像素著色器把它插值到整個(gè)平面,之后將在此做法線貼圖。

切線Tangent

切線是紋理坐標(biāo)的V軸。這里聲明兩個(gè)向量表示面的兩個(gè)邊(類似之前在加載obj章節(jié)計(jì)算法線時(shí)所做的),再聲明兩個(gè)2d向量為那個(gè)面表示紋理坐標(biāo)的兩條邊,隨后就能得到基于這些邊的切線。為每個(gè)向量計(jì)算切線并且存儲(chǔ)在向量結(jié)構(gòu)體中。由于法線插值緣故,在像素著色器中法線和切線不會(huì)總是正交的,在法線方向上可通過截?cái)嗲芯€方向來確保它們都在像素著色器中。必須確保法線和切線夾角為45°。

副切線Bitangent

副切線有時(shí)也叫做副法線,實(shí)際上副法線是錯(cuò)誤的說法。副法線是需要與NURBS以及圓表面或其他要素一起發(fā)揮作用的,而副切線是紋理坐標(biāo)的U軸。在像素著色器中(凹凸貼圖存在)為每個(gè)像素創(chuàng)建副切線,可通過叉乘切線和法線得到副切線(確認(rèn)切線和法線是正交之后)。

法線貼圖

法線貼圖是一張上面每個(gè)像素的顏色通道(eg.RGB)表示其法線的圖片,代碼中rgb會(huì)被插值表示為xyz,三維方向矢量。通常會(huì)看到法線貼圖是藍(lán)色的,是因?yàn)樗{(lán)色部分由z軸表示,z軸向上,同時(shí)法線面遠(yuǎn)離表面導(dǎo)致的。

可以用很多方法制作法線貼圖,其中一種方式使用photoshop,可從nvidia官網(wǎng)下載??上戎谱饕粡埰谕陌纪官N圖紋理,再把它轉(zhuǎn)為凹凸貼圖。其他一種方式就是用maya或3dmax先制作一張高細(xì)節(jié)網(wǎng)格,在轉(zhuǎn)為法線貼圖。這是最好的方式,但比較耗時(shí)。

法線貼圖的顏色組成范圍從0到255。當(dāng)加載貼圖到像素著色器中時(shí),該值范圍會(huì)被轉(zhuǎn)換為0到1。所以在使用法線貼圖前還需要將該值范圍轉(zhuǎn)為為-1到1,可通過將該值乘以2,再減1來實(shí)現(xiàn)。


更新常量緩沖結(jié)構(gòu)體

需要修改常量緩沖結(jié)構(gòu)體添加一個(gè)布爾變量,用來表示凹凸貼圖是否使能。這里使用的是windows布爾類型而不是標(biāo)準(zhǔn)布爾類型的,代碼如下。

struct cbPerObject {XMMATRIX WVP;XMMATRIX World;//These will be used for the pixel shaderXMFLOAT4 difColor;BOOL hasTexture;///**************new**************//Because of HLSL structure packing, we will use windows BOOL//instead of bool because HLSL packs things into 4 bytes, and//bool is only one byte, where BOOL is 4 bytesBOOL hasNormMap;///**************new************** };

更新表面材質(zhì)結(jié)構(gòu)體

紋理數(shù)組中修改該結(jié)構(gòu)體以包含帶法線的圖片索引,同時(shí)也包含一個(gè)布爾值以表示法線貼圖是否使用。

struct SurfaceMaterial {std::wstring matName;XMFLOAT4 difColor;int texArrayIndex;///**************new**************int normMapTexArrayIndex;bool hasNormMap;///**************new**************bool hasTexture;bool transparent; };
更新頂點(diǎn)結(jié)構(gòu)體

添加一個(gè)切線元素到頂點(diǎn)結(jié)構(gòu)體中,之后要使用頂點(diǎn)切線和法線來獲得副切線以及紋理/切線空間,以便順利轉(zhuǎn)換法線貼圖的法線。

struct Vertex {Vertex(){}Vertex(float x, float y, float z,float u, float v,float nx, float ny, float nz,float tx, float ty, float tz): pos(x,y,z), texCoord(u, v), normal(nx, ny, nz),tangent(tx, ty, tz){}XMFLOAT3 pos;XMFLOAT2 texCoord;XMFLOAT3 normal;///**************new**************XMFLOAT3 tangent;XMFLOAT3 biTangent;///**************new************** };D3D11_INPUT_ELEMENT_DESC layout[] = {{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 20, D3D11_INPUT_PER_VERTEX_DATA, 0},///**************new**************{ "TANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 32, D3D11_INPUT_PER_VERTEX_DATA, 0}///**************new************** };



更新LoadObjModel函數(shù)

修改該函數(shù)加載法線(凹凸)貼圖,隨后為每個(gè)頂點(diǎn)創(chuàng)建切線,方法和之前為每個(gè)頂點(diǎn)創(chuàng)建法線是一樣的:

bool LoadObjModel(std::wstring filename, ID3D11Buffer** vertBuff, ID3D11Buffer** indexBuff,std::vector<int>& subsetIndexStart,std::vector<int>& subsetMaterialArray,std::vector<SurfaceMaterial>& material, int& subsetCount,bool isRHCoordSys,bool computeNormals) {HRESULT hr = 0;std::wifstream fileIn (filename.c_str()); //Open filestd::wstring meshMatLib; //String to hold our obj material library filename//Arrays to store our model's informationstd::vector<DWORD> indices;std::vector<XMFLOAT3> vertPos;std::vector<XMFLOAT3> vertNorm;std::vector<XMFLOAT2> vertTexCoord;std::vector<std::wstring> meshMaterials;//Vertex definition indicesstd::vector<int> vertPosIndex;std::vector<int> vertNormIndex;std::vector<int> vertTCIndex;//Make sure we have a default if no tex coords or normals are definedbool hasTexCoord = false;bool hasNorm = false;//Temp variables to store into vectorsstd::wstring meshMaterialsTemp;int vertPosIndexTemp;int vertNormIndexTemp;int vertTCIndexTemp;wchar_t checkChar; //The variable we will use to store one char from file at a timestd::wstring face; //Holds the string containing our face verticesint vIndex = 0; //Keep track of our vertex index countint triangleCount = 0; //Total Trianglesint totalVerts = 0;int meshTriangles = 0;//Check to see if the file was openedif (fileIn){while(fileIn){ checkChar = fileIn.get(); //Get next charswitch (checkChar){ case '#':checkChar = fileIn.get();while(checkChar != '\n')checkChar = fileIn.get();break;case 'v': //Get Vertex DescriptionscheckChar = fileIn.get();if(checkChar == ' ') //v - vert position{float vz, vy, vx;fileIn >> vx >> vy >> vz; //Store the next three typesif(isRHCoordSys) //If model is from an RH Coord SystemvertPos.push_back(XMFLOAT3( vx, vy, vz * -1.0f)); //Invert the Z axiselsevertPos.push_back(XMFLOAT3( vx, vy, vz));}if(checkChar == 't') //vt - vert tex coords{ float vtcu, vtcv;fileIn >> vtcu >> vtcv; //Store next two typesif(isRHCoordSys) //If model is from an RH Coord SystemvertTexCoord.push_back(XMFLOAT2(vtcu, 1.0f-vtcv)); //Reverse the "v" axiselsevertTexCoord.push_back(XMFLOAT2(vtcu, vtcv)); hasTexCoord = true; //We know the model uses texture coords}//Since we compute the normals later, we don't need to check for normals//In the file, but i'll do it here anywayif(checkChar == 'n') //vn - vert normal{float vnx, vny, vnz;fileIn >> vnx >> vny >> vnz; //Store next three typesif(isRHCoordSys) //If model is from an RH Coord SystemvertNorm.push_back(XMFLOAT3( vnx, vny, vnz * -1.0f )); //Invert the Z axiselsevertNorm.push_back(XMFLOAT3( vnx, vny, vnz )); hasNorm = true; //We know the model defines normals}break;//New group (Subset)case 'g': //g - defines a groupcheckChar = fileIn.get();if(checkChar == ' '){subsetIndexStart.push_back(vIndex); //Start index for this subsetsubsetCount++;}break;//Get Face Indexcase 'f': //f - defines the facescheckChar = fileIn.get();if(checkChar == ' '){face = L"";std::wstring VertDef; //Holds one vertex definition at a timetriangleCount = 0;checkChar = fileIn.get();while(checkChar != '\n'){face += checkChar; //Add the char to our face stringcheckChar = fileIn.get(); //Get the next Characterif(checkChar == ' ') //If its a space...triangleCount++; //Increase our triangle count}//Check for space at the end of our face stringif(face[face.length()-1] == ' ')triangleCount--; //Each space adds to our triangle counttriangleCount -= 1; //Ever vertex in the face AFTER the first two are new facesstd::wstringstream ss(face);if(face.length() > 0){int firstVIndex, lastVIndex; //Holds the first and last vertice's indexfor(int i = 0; i < 3; ++i) //First three vertices (first triangle){ss >> VertDef; //Get vertex definition (vPos/vTexCoord/vNorm)std::wstring vertPart;int whichPart = 0; //(vPos, vTexCoord, or vNorm)//Parse this stringfor(int j = 0; j < VertDef.length(); ++j){if(VertDef[j] != '/') //If there is no divider "/", add a char to our vertPartvertPart += VertDef[j];//If the current char is a divider "/", or its the last character in the stringif(VertDef[j] == '/' || j == VertDef.length()-1){std::wistringstream wstringToInt(vertPart); //Used to convert wstring to intif(whichPart == 0) //If vPos{wstringToInt >> vertPosIndexTemp;vertPosIndexTemp -= 1; //subtract one since c++ arrays start with 0, and obj start with 1//Check to see if the vert pos was the only thing specifiedif(j == VertDef.length()-1){vertNormIndexTemp = 0;vertTCIndexTemp = 0;}}else if(whichPart == 1) //If vTexCoord{if(vertPart != L"") //Check to see if there even is a tex coord{wstringToInt >> vertTCIndexTemp;vertTCIndexTemp -= 1; //subtract one since c++ arrays start with 0, and obj start with 1}else //If there is no tex coord, make a defaultvertTCIndexTemp = 0;//If the cur. char is the second to last in the string, then//there must be no normal, so set a default normalif(j == VertDef.length()-1)vertNormIndexTemp = 0;} else if(whichPart == 2) //If vNorm{std::wistringstream wstringToInt(vertPart);wstringToInt >> vertNormIndexTemp;vertNormIndexTemp -= 1; //subtract one since c++ arrays start with 0, and obj start with 1}vertPart = L""; //Get ready for next vertex partwhichPart++; //Move on to next vertex part }}//Check to make sure there is at least one subsetif(subsetCount == 0){subsetIndexStart.push_back(vIndex); //Start index for this subsetsubsetCount++;}//Avoid duplicate verticesbool vertAlreadyExists = false;if(totalVerts >= 3) //Make sure we at least have one triangle to check{//Loop through all the verticesfor(int iCheck = 0; iCheck < totalVerts; ++iCheck){//If the vertex position and texture coordinate in memory are the same//As the vertex position and texture coordinate we just now got out//of the obj file, we will set this faces vertex index to the vertex's//index value in memory. This makes sure we don't create duplicate verticesif(vertPosIndexTemp == vertPosIndex[iCheck] && !vertAlreadyExists){if(vertTCIndexTemp == vertTCIndex[iCheck]){indices.push_back(iCheck); //Set index for this vertexvertAlreadyExists = true; //If we've made it here, the vertex already exists}}}}//If this vertex is not already in our vertex arrays, put it thereif(!vertAlreadyExists){vertPosIndex.push_back(vertPosIndexTemp);vertTCIndex.push_back(vertTCIndexTemp);vertNormIndex.push_back(vertNormIndexTemp);totalVerts++; //We created a new vertexindices.push_back(totalVerts-1); //Set index for this vertex} //If this is the very first vertex in the face, we need to//make sure the rest of the triangles use this vertexif(i == 0){firstVIndex = indices[vIndex]; //The first vertex index of this FACE}//If this was the last vertex in the first triangle, we will make sure//the next triangle uses this one (eg. tri1(1,2,3) tri2(1,3,4) tri3(1,4,5))if(i == 2){ lastVIndex = indices[vIndex]; //The last vertex index of this TRIANGLE}vIndex++; //Increment index count}meshTriangles++; //One triangle down//If there are more than three vertices in the face definition, we need to make sure//we convert the face to triangles. We created our first triangle above, now we will//create a new triangle for every new vertex in the face, using the very first vertex//of the face, and the last vertex from the triangle before the current trianglefor(int l = 0; l < triangleCount-1; ++l) //Loop through the next vertices to create new triangles{//First vertex of this triangle (the very first vertex of the face too)indices.push_back(firstVIndex); //Set index for this vertexvIndex++;//Second Vertex of this triangle (the last vertex used in the tri before this one)indices.push_back(lastVIndex); //Set index for this vertexvIndex++;//Get the third vertex for this triangless >> VertDef;std::wstring vertPart;int whichPart = 0;//Parse this string (same as above)for(int j = 0; j < VertDef.length(); ++j){if(VertDef[j] != '/')vertPart += VertDef[j];if(VertDef[j] == '/' || j == VertDef.length()-1){std::wistringstream wstringToInt(vertPart);if(whichPart == 0){wstringToInt >> vertPosIndexTemp;vertPosIndexTemp -= 1;//Check to see if the vert pos was the only thing specifiedif(j == VertDef.length()-1){vertTCIndexTemp = 0;vertNormIndexTemp = 0;}}else if(whichPart == 1){if(vertPart != L""){wstringToInt >> vertTCIndexTemp;vertTCIndexTemp -= 1;}elsevertTCIndexTemp = 0;if(j == VertDef.length()-1)vertNormIndexTemp = 0;} else if(whichPart == 2){std::wistringstream wstringToInt(vertPart);wstringToInt >> vertNormIndexTemp;vertNormIndexTemp -= 1;}vertPart = L"";whichPart++; }} //Check for duplicate verticesbool vertAlreadyExists = false;if(totalVerts >= 3) //Make sure we at least have one triangle to check{for(int iCheck = 0; iCheck < totalVerts; ++iCheck){if(vertPosIndexTemp == vertPosIndex[iCheck] && !vertAlreadyExists){if(vertTCIndexTemp == vertTCIndex[iCheck]){indices.push_back(iCheck); //Set index for this vertexvertAlreadyExists = true; //If we've made it here, the vertex already exists}}}}if(!vertAlreadyExists){vertPosIndex.push_back(vertPosIndexTemp);vertTCIndex.push_back(vertTCIndexTemp);vertNormIndex.push_back(vertNormIndexTemp);totalVerts++; //New vertex created, add to total vertsindices.push_back(totalVerts-1); //Set index for this vertex}//Set the second vertex for the next triangle to the last vertex we got lastVIndex = indices[vIndex]; //The last vertex index of this TRIANGLEmeshTriangles++; //New triangle definedvIndex++; }}}break;case 'm': //mtllib - material library filenamecheckChar = fileIn.get();if(checkChar == 't'){checkChar = fileIn.get();if(checkChar == 'l'){checkChar = fileIn.get();if(checkChar == 'l'){checkChar = fileIn.get();if(checkChar == 'i'){checkChar = fileIn.get();if(checkChar == 'b'){checkChar = fileIn.get();if(checkChar == ' '){//Store the material libraries file namefileIn >> meshMatLib;}}}}}}break;case 'u': //usemtl - which material to usecheckChar = fileIn.get();if(checkChar == 's'){checkChar = fileIn.get();if(checkChar == 'e'){checkChar = fileIn.get();if(checkChar == 'm'){checkChar = fileIn.get();if(checkChar == 't'){checkChar = fileIn.get();if(checkChar == 'l'){checkChar = fileIn.get();if(checkChar == ' '){meshMaterialsTemp = L""; //Make sure this is clearedfileIn >> meshMaterialsTemp; //Get next type (string)meshMaterials.push_back(meshMaterialsTemp);}}}}}}break;default: break;}}}else //If we could not open the file{SwapChain->SetFullscreenState(false, NULL); //Make sure we are out of fullscreen//create messagestd::wstring message = L"Could not open: ";message += filename;MessageBox(0, message.c_str(), //display messageL"Error", MB_OK);return false;}subsetIndexStart.push_back(vIndex); //There won't be another index start after our last subset, so set it here//sometimes "g" is defined at the very top of the file, then again before the first group of faces.//This makes sure the first subset does not conatain "0" indices.if(subsetIndexStart[1] == 0){subsetIndexStart.erase(subsetIndexStart.begin()+1);meshSubsets--;}//Make sure we have a default for the tex coord and normal//if one or both are not specifiedif(!hasNorm)vertNorm.push_back(XMFLOAT3(0.0f, 0.0f, 0.0f));if(!hasTexCoord)vertTexCoord.push_back(XMFLOAT2(0.0f, 0.0f));//Close the obj file, and open the mtl filefileIn.close();fileIn.open(meshMatLib.c_str());std::wstring lastStringRead;int matCount = 0; //total materials//kdset - If our diffuse color was not set, we can use the ambient color (which is usually the same)//If the diffuse color WAS set, then we don't need to set our diffuse color to ambientbool kdset = false;if (fileIn){while(fileIn){checkChar = fileIn.get(); //Get next charswitch (checkChar){//Check for commentcase '#':checkChar = fileIn.get();while(checkChar != '\n')checkChar = fileIn.get();break;//Set diffuse colorcase 'K':checkChar = fileIn.get();if(checkChar == 'd') //Diffuse Color{checkChar = fileIn.get(); //remove spacefileIn >> material[matCount-1].difColor.x;fileIn >> material[matCount-1].difColor.y;fileIn >> material[matCount-1].difColor.z;kdset = true;}//Ambient Color (We'll store it in diffuse if there isn't a diffuse already)if(checkChar == 'a') { checkChar = fileIn.get(); //remove spaceif(!kdset){fileIn >> material[matCount-1].difColor.x;fileIn >> material[matCount-1].difColor.y;fileIn >> material[matCount-1].difColor.z;}}break;//Check for transparencycase 'T':checkChar = fileIn.get();if(checkChar == 'r'){checkChar = fileIn.get(); //remove spacefloat Transparency;fileIn >> Transparency;material[matCount-1].difColor.w = Transparency;if(Transparency > 0.0f)material[matCount-1].transparent = true;}break;//Some obj files specify d for transparencycase 'd':checkChar = fileIn.get();if(checkChar == ' '){float Transparency;fileIn >> Transparency;//'d' - 0 being most transparent, and 1 being opaque, opposite of TrTransparency = 1.0f - Transparency;material[matCount-1].difColor.w = Transparency;if(Transparency > 0.0f)material[matCount-1].transparent = true; }break;//Get the diffuse map (texture)case 'm':checkChar = fileIn.get();if(checkChar == 'a'){checkChar = fileIn.get();if(checkChar == 'p'){checkChar = fileIn.get();if(checkChar == '_'){//map_Kd - Diffuse mapcheckChar = fileIn.get();if(checkChar == 'K'){checkChar = fileIn.get();if(checkChar == 'd'){std::wstring fileNamePath;fileIn.get(); //Remove whitespace between map_Kd and file//Get the file path - We read the pathname char by char since//pathnames can sometimes contain spaces, so we will read until//we find the file extensionbool texFilePathEnd = false;while(!texFilePathEnd){checkChar = fileIn.get();fileNamePath += checkChar;if(checkChar == '.'){for(int i = 0; i < 3; ++i)fileNamePath += fileIn.get();texFilePathEnd = true;} }//check if this texture has already been loadedbool alreadyLoaded = false;for(int i = 0; i < textureNameArray.size(); ++i){if(fileNamePath == textureNameArray[i]){alreadyLoaded = true;material[matCount-1].texArrayIndex = i;material[matCount-1].hasTexture = true;}}//if the texture is not already loaded, load it nowif(!alreadyLoaded){ID3D11ShaderResourceView* tempMeshSRV;hr = D3DX11CreateShaderResourceViewFromFile( d3d11Device, fileNamePath.c_str(),NULL, NULL, &tempMeshSRV, NULL );if(SUCCEEDED(hr)){textureNameArray.push_back(fileNamePath.c_str());material[matCount-1].texArrayIndex = meshSRV.size();meshSRV.push_back(tempMeshSRV);material[matCount-1].hasTexture = true;}} }}//map_d - alpha mapelse if(checkChar == 'd'){//Alpha maps are usually the same as the diffuse map//So we will assume that for now by only enabling//transparency for this material, as we will already//be using the alpha channel in the diffuse mapmaterial[matCount-1].transparent = true;}///**************new**************//map_bump - bump map (we're usinga normal map though)else if(checkChar == 'b'){checkChar = fileIn.get();if(checkChar == 'u'){checkChar = fileIn.get();if(checkChar == 'm'){checkChar = fileIn.get();if(checkChar == 'p'){std::wstring fileNamePath;fileIn.get(); //Remove whitespace between map_bump and file//Get the file path - We read the pathname char by char since//pathnames can sometimes contain spaces, so we will read until//we find the file extensionbool texFilePathEnd = false;while(!texFilePathEnd){checkChar = fileIn.get();fileNamePath += checkChar;if(checkChar == '.'){for(int i = 0; i < 3; ++i)fileNamePath += fileIn.get();texFilePathEnd = true;} }//check if this texture has already been loadedbool alreadyLoaded = false;for(int i = 0; i < textureNameArray.size(); ++i){if(fileNamePath == textureNameArray[i]){alreadyLoaded = true;material[matCount-1].normMapTexArrayIndex = i;material[matCount-1].hasNormMap = true;}}//if the texture is not already loaded, load it nowif(!alreadyLoaded){ID3D11ShaderResourceView* tempMeshSRV;hr = D3DX11CreateShaderResourceViewFromFile( d3d11Device, fileNamePath.c_str(),NULL, NULL, &tempMeshSRV, NULL );if(SUCCEEDED(hr)){textureNameArray.push_back(fileNamePath.c_str());material[matCount-1].normMapTexArrayIndex = meshSRV.size();meshSRV.push_back(tempMeshSRV);material[matCount-1].hasNormMap = true;}} }}}}///**************new**************}}}break;case 'n': //newmtl - Declare new materialcheckChar = fileIn.get();if(checkChar == 'e'){checkChar = fileIn.get();if(checkChar == 'w'){checkChar = fileIn.get();if(checkChar == 'm'){checkChar = fileIn.get();if(checkChar == 't'){checkChar = fileIn.get();if(checkChar == 'l'){checkChar = fileIn.get();if(checkChar == ' '){//New material, set its defaultsSurfaceMaterial tempMat;material.push_back(tempMat);fileIn >> material[matCount].matName;material[matCount].transparent = false;material[matCount].hasTexture = false;///**************new**************material[matCount].hasNormMap = false;material[matCount].normMapTexArrayIndex = 0;///**************new**************material[matCount].texArrayIndex = 0;matCount++;kdset = false;}}}}}}break;default:break;}}} else{SwapChain->SetFullscreenState(false, NULL); //Make sure we are out of fullscreenstd::wstring message = L"Could not open: ";message += meshMatLib;MessageBox(0, message.c_str(),L"Error", MB_OK);return false;}//Set the subsets material to the index value//of the its material in our material arrayfor(int i = 0; i < meshSubsets; ++i){bool hasMat = false;for(int j = 0; j < material.size(); ++j){if(meshMaterials[i] == material[j].matName){subsetMaterialArray.push_back(j);hasMat = true;}}if(!hasMat)subsetMaterialArray.push_back(0); //Use first material in array}std::vector<Vertex> vertices;Vertex tempVert;//Create our vertices using the information we got //from the file and store them in a vectorfor(int j = 0 ; j < totalVerts; ++j){tempVert.pos = vertPos[vertPosIndex[j]];tempVert.normal = vertNorm[vertNormIndex[j]];tempVert.texCoord = vertTexCoord[vertTCIndex[j]];vertices.push_back(tempVert);}//Compute Normals/////If computeNormals was set to true then we will create our own//normals, if it was set to false we will use the obj files normalsif(computeNormals){std::vector<XMFLOAT3> tempNormal;//normalized and unnormalized normalsXMFLOAT3 unnormalized = XMFLOAT3(0.0f, 0.0f, 0.0f);///**************new**************//tangent stuffstd::vector<XMFLOAT3> tempTangent;XMFLOAT3 tangent = XMFLOAT3(0.0f, 0.0f, 0.0f);float tcU1, tcV1, tcU2, tcV2;///**************new**************//Used to get vectors (sides) from the position of the vertsfloat vecX, vecY, vecZ;//Two edges of our triangleXMVECTOR edge1 = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);XMVECTOR edge2 = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);//Compute face normals//And Tangentsfor(int i = 0; i < meshTriangles; ++i){//Get the vector describing one edge of our triangle (edge 0,2)vecX = vertices[indices[(i*3)]].pos.x - vertices[indices[(i*3)+2]].pos.x;vecY = vertices[indices[(i*3)]].pos.y - vertices[indices[(i*3)+2]].pos.y;vecZ = vertices[indices[(i*3)]].pos.z - vertices[indices[(i*3)+2]].pos.z; edge1 = XMVectorSet(vecX, vecY, vecZ, 0.0f); //Create our first edge//Get the vector describing another edge of our triangle (edge 2,1)vecX = vertices[indices[(i*3)+2]].pos.x - vertices[indices[(i*3)+1]].pos.x;vecY = vertices[indices[(i*3)+2]].pos.y - vertices[indices[(i*3)+1]].pos.y;vecZ = vertices[indices[(i*3)+2]].pos.z - vertices[indices[(i*3)+1]].pos.z; edge2 = XMVectorSet(vecX, vecY, vecZ, 0.0f); //Create our second edge//Cross multiply the two edge vectors to get the un-normalized face normalXMStoreFloat3(&unnormalized, XMVector3Cross(edge1, edge2));tempNormal.push_back(unnormalized);///**************new**************//Find first texture coordinate edge 2d vectortcU1 = vertices[indices[(i*3)]].texCoord.x - vertices[indices[(i*3)+2]].texCoord.x;tcV1 = vertices[indices[(i*3)]].texCoord.y - vertices[indices[(i*3)+2]].texCoord.y;//Find second texture coordinate edge 2d vectortcU2 = vertices[indices[(i*3)+2]].texCoord.x - vertices[indices[(i*3)+1]].texCoord.x;tcV2 = vertices[indices[(i*3)+2]].texCoord.y - vertices[indices[(i*3)+1]].texCoord.y;//Find tangent using both tex coord edges and position edgestangent.x = (tcV1 * XMVectorGetX(edge1) - tcV2 * XMVectorGetX(edge2)) * (1.0f / (tcU1 * tcV2 - tcU2 * tcV1));tangent.y = (tcV1 * XMVectorGetY(edge1) - tcV2 * XMVectorGetY(edge2)) * (1.0f / (tcU1 * tcV2 - tcU2 * tcV1));tangent.z = (tcV1 * XMVectorGetZ(edge1) - tcV2 * XMVectorGetZ(edge2)) * (1.0f / (tcU1 * tcV2 - tcU2 * tcV1));tempTangent.push_back(tangent);///**************new**************}//Compute vertex normals (normal Averaging)XMVECTOR normalSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);XMVECTOR tangentSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);int facesUsing = 0;float tX, tY, tZ; //temp axis variables//Go through each vertexfor(int i = 0; i < totalVerts; ++i){//Check which triangles use this vertexfor(int j = 0; j < meshTriangles; ++j){if(indices[j*3] == i ||indices[(j*3)+1] == i ||indices[(j*3)+2] == i){tX = XMVectorGetX(normalSum) + tempNormal[j].x;tY = XMVectorGetY(normalSum) + tempNormal[j].y;tZ = XMVectorGetZ(normalSum) + tempNormal[j].z;normalSum = XMVectorSet(tX, tY, tZ, 0.0f); //If a face is using the vertex, add the unormalized face normal to the normalSum///**************new************** //We can reuse tX, tY, tZ to sum up tangentstX = XMVectorGetX(tangentSum) + tempTangent[j].x;tY = XMVectorGetY(tangentSum) + tempTangent[j].y;tZ = XMVectorGetZ(tangentSum) + tempTangent[j].z;tangentSum = XMVectorSet(tX, tY, tZ, 0.0f); //sum up face tangents using this vertex///**************new**************facesUsing++;}}//Get the actual normal by dividing the normalSum by the number of faces sharing the vertexnormalSum = normalSum / facesUsing;///**************new**************tangentSum = tangentSum / facesUsing;///**************new**************//Normalize the normalSum vector and tangentnormalSum = XMVector3Normalize(normalSum);///**************new**************tangentSum = XMVector3Normalize(tangentSum);///**************new**************//Store the normal and tangent in our current vertexvertices[i].normal.x = XMVectorGetX(normalSum);vertices[i].normal.y = XMVectorGetY(normalSum);vertices[i].normal.z = XMVectorGetZ(normalSum);///**************new**************vertices[i].tangent.x = XMVectorGetX(tangentSum);vertices[i].tangent.y = XMVectorGetY(tangentSum);vertices[i].tangent.z = XMVectorGetZ(tangentSum);///**************new**************//Clear normalSum, tangentSum and facesUsing for next vertexnormalSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);///**************new**************tangentSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);///**************new**************facesUsing = 0;}}//Create index bufferD3D11_BUFFER_DESC indexBufferDesc;ZeroMemory( &indexBufferDesc, sizeof(indexBufferDesc) );indexBufferDesc.Usage = D3D11_USAGE_DEFAULT;indexBufferDesc.ByteWidth = sizeof(DWORD) * meshTriangles*3;indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;indexBufferDesc.CPUAccessFlags = 0;indexBufferDesc.MiscFlags = 0;D3D11_SUBRESOURCE_DATA iinitData;iinitData.pSysMem = &indices[0];d3d11Device->CreateBuffer(&indexBufferDesc, &iinitData, indexBuff);//Create Vertex BufferD3D11_BUFFER_DESC vertexBufferDesc;ZeroMemory( &vertexBufferDesc, sizeof(vertexBufferDesc) );vertexBufferDesc.Usage = D3D11_USAGE_DEFAULT;vertexBufferDesc.ByteWidth = sizeof( Vertex ) * totalVerts;vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;vertexBufferDesc.CPUAccessFlags = 0;vertexBufferDesc.MiscFlags = 0;D3D11_SUBRESOURCE_DATA vertexBufferData; ZeroMemory( &vertexBufferData, sizeof(vertexBufferData) );vertexBufferData.pSysMem = &vertices[0];hr = d3d11Device->CreateBuffer( &vertexBufferDesc, &vertexBufferData, vertBuff);return true; }

加載法線貼圖

在obj模型mtl文件中搜索貼圖加載時(shí),是先搜素以map_bump開頭的行,它表示的是法線貼圖凹凸感的實(shí)現(xiàn)。這與之前加載漫反射紋理是一樣的。

//map_bump - bump map (we're usinga normal map though) else if(checkChar == 'b') {checkChar = fileIn.get();if(checkChar == 'u'){checkChar = fileIn.get();if(checkChar == 'm'){checkChar = fileIn.get();if(checkChar == 'p'){std::wstring fileNamePath;fileIn.get(); //Remove whitespace between map_bump and file//Get the file path - We read the pathname char by char since//pathnames can sometimes contain spaces, so we will read until//we find the file extensionbool texFilePathEnd = false;while(!texFilePathEnd){checkChar = fileIn.get();fileNamePath += checkChar;if(checkChar == '.'){for(int i = 0; i < 3; ++i)fileNamePath += fileIn.get();texFilePathEnd = true;} }//check if this texture has already been loadedbool alreadyLoaded = false;for(int i = 0; i < textureNameArray.size(); ++i){if(fileNamePath == textureNameArray[i]){alreadyLoaded = true;material[matCount-1].normMapTexArrayIndex = i;material[matCount-1].hasNormMap = true;}}//if the texture is not already loaded, load it nowif(!alreadyLoaded){ID3D11ShaderResourceView* tempMeshSRV;hr = D3DX11CreateShaderResourceViewFromFile( d3d11Device, fileNamePath.c_str(),NULL, NULL, &tempMeshSRV, NULL );if(SUCCEEDED(hr)){textureNameArray.push_back(fileNamePath.c_str());material[matCount-1].normMapTexArrayIndex = meshSRV.size();meshSRV.push_back(tempMeshSRV);material[matCount-1].hasNormMap = true;}} }}} }

創(chuàng)建一個(gè)新的材質(zhì)

當(dāng)創(chuàng)建新材質(zhì)時(shí),必須確保設(shè)置了它的默認(rèn)值來避免錯(cuò)誤或未知的結(jié)果。所以將法線貼圖索引數(shù)組設(shè)為0同時(shí)法線使能布爾值設(shè)為false。

checkChar = fileIn.get(); if(checkChar == ' ') {//New material, set its defaultsSurfaceMaterial tempMat;material.push_back(tempMat);fileIn >> material[matCount].matName;material[matCount].transparent = false;material[matCount].hasTexture = false;///**************new**************material[matCount].hasNormMap = false;material[matCount].normMapTexArrayIndex = 0;///**************new**************material[matCount].texArrayIndex = 0;matCount++;kdset = false; }
計(jì)算切線

由于計(jì)算切線和計(jì)算法線算法相似,所以在這里一起做了。

首先遍歷網(wǎng)格中的每個(gè)三角形并得到它的切線。這里不深入討論數(shù)學(xué)的東西了,若有興趣可參考網(wǎng)址。在為每個(gè)三角形計(jì)算完切線后,計(jì)算所有面(共享同樣頂點(diǎn)的面)切線的平均值,法線做平均值的方法也是一樣的。

這里本來是可以定義副切線的,但是由于在像素著色器中法線是被插值到整個(gè)表面的,因此若此時(shí)在這里定義了副切線,則必須確保法線,切線和副切線都正交,這比只確保切線和法線正交后將它們?cè)俨娉双@得副切線要復(fù)雜的多。

//Compute Normals/////If computeNormals was set to true then we will create our own//normals, if it was set to false we will use the obj files normalsif(computeNormals){std::vector<XMFLOAT3> tempNormal;//normalized and unnormalized normalsXMFLOAT3 unnormalized = XMFLOAT3(0.0f, 0.0f, 0.0f);///**************new**************//tangent stuffstd::vector<XMFLOAT3> tempTangent;XMFLOAT3 tangent = XMFLOAT3(0.0f, 0.0f, 0.0f);float tcU1, tcV1, tcU2, tcV2;///**************new**************//Used to get vectors (sides) from the position of the vertsfloat vecX, vecY, vecZ;//Two edges of our triangleXMVECTOR edge1 = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);XMVECTOR edge2 = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);//Compute face normals//And Tangentsfor(int i = 0; i < meshTriangles; ++i){//Get the vector describing one edge of our triangle (edge 0,2)vecX = vertices[indices[(i*3)]].pos.x - vertices[indices[(i*3)+2]].pos.x;vecY = vertices[indices[(i*3)]].pos.y - vertices[indices[(i*3)+2]].pos.y;vecZ = vertices[indices[(i*3)]].pos.z - vertices[indices[(i*3)+2]].pos.z; edge1 = XMVectorSet(vecX, vecY, vecZ, 0.0f); //Create our first edge//Get the vector describing another edge of our triangle (edge 2,1)vecX = vertices[indices[(i*3)+2]].pos.x - vertices[indices[(i*3)+1]].pos.x;vecY = vertices[indices[(i*3)+2]].pos.y - vertices[indices[(i*3)+1]].pos.y;vecZ = vertices[indices[(i*3)+2]].pos.z - vertices[indices[(i*3)+1]].pos.z; edge2 = XMVectorSet(vecX, vecY, vecZ, 0.0f); //Create our second edge//Cross multiply the two edge vectors to get the un-normalized face normalXMStoreFloat3(&unnormalized, XMVector3Cross(edge1, edge2));tempNormal.push_back(unnormalized);///**************new**************//Find first texture coordinate edge 2d vectortcU1 = vertices[indices[(i*3)]].texCoord.x - vertices[indices[(i*3)+2]].texCoord.x;tcV1 = vertices[indices[(i*3)]].texCoord.y - vertices[indices[(i*3)+2]].texCoord.y;//Find second texture coordinate edge 2d vectortcU2 = vertices[indices[(i*3)+2]].texCoord.x - vertices[indices[(i*3)+1]].texCoord.x;tcV2 = vertices[indices[(i*3)+2]].texCoord.y - vertices[indices[(i*3)+1]].texCoord.y;//Find tangent using both tex coord edges and position edgestangent.x = (tcV1 * XMVectorGetX(edge1) - tcV2 * XMVectorGetX(edge2)) * (1.0f / (tcU1 * tcV2 - tcU2 * tcV1));tangent.y = (tcV1 * XMVectorGetY(edge1) - tcV2 * XMVectorGetY(edge2)) * (1.0f / (tcU1 * tcV2 - tcU2 * tcV1));tangent.z = (tcV1 * XMVectorGetZ(edge1) - tcV2 * XMVectorGetZ(edge2)) * (1.0f / (tcU1 * tcV2 - tcU2 * tcV1));tempTangent.push_back(tangent);///**************new**************}//Compute vertex normals (normal Averaging)XMVECTOR normalSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);XMVECTOR tangentSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);int facesUsing = 0;float tX, tY, tZ; //temp axis variables//Go through each vertexfor(int i = 0; i < totalVerts; ++i){//Check which triangles use this vertexfor(int j = 0; j < meshTriangles; ++j){if(indices[j*3] == i ||indices[(j*3)+1] == i ||indices[(j*3)+2] == i){tX = XMVectorGetX(normalSum) + tempNormal[j].x;tY = XMVectorGetY(normalSum) + tempNormal[j].y;tZ = XMVectorGetZ(normalSum) + tempNormal[j].z;normalSum = XMVectorSet(tX, tY, tZ, 0.0f); //If a face is using the vertex, add the unormalized face normal to the normalSum///**************new************** //We can reuse tX, tY, tZ to sum up tangentstX = XMVectorGetX(tangentSum) + tempTangent[j].x;tY = XMVectorGetY(tangentSum) + tempTangent[j].y;tZ = XMVectorGetZ(tangentSum) + tempTangent[j].z;tangentSum = XMVectorSet(tX, tY, tZ, 0.0f); //sum up face tangents using this vertex///**************new**************facesUsing++;}}//Get the actual normal by dividing the normalSum by the number of faces sharing the vertexnormalSum = normalSum / facesUsing;///**************new**************tangentSum = tangentSum / facesUsing;///**************new**************//Normalize the normalSum vector and tangentnormalSum = XMVector3Normalize(normalSum);///**************new**************tangentSum = XMVector3Normalize(tangentSum);///**************new**************//Store the normal and tangent in our current vertexvertices[i].normal.x = XMVectorGetX(normalSum);vertices[i].normal.y = XMVectorGetY(normalSum);vertices[i].normal.z = XMVectorGetZ(normalSum);///**************new**************vertices[i].tangent.x = XMVectorGetX(tangentSum);vertices[i].tangent.y = XMVectorGetY(tangentSum);vertices[i].tangent.z = XMVectorGetZ(tangentSum);///**************new**************//Clear normalSum, tangentSum and facesUsing for next vertexnormalSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);///**************new**************tangentSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);///**************new**************facesUsing = 0;}}

加載ground.obj模型

使用不同于上一章節(jié)的模型,在init scene函數(shù)中修改:

if(!LoadObjModel(L"ground.obj", &meshVertBuff, &meshIndexBuff, meshSubsetIndexStart, meshSubsetTexture, material, meshSubsets, true, true))return false;

繪制模型

要確保傳入布爾變量到著色器以表示法線貼圖是否使能,同時(shí)傳入的是否為法線貼圖。

之前是怎樣將漫反射紋理通過第0個(gè)槽傳入到像素著色器的,同時(shí)怎樣將法線貼圖通過第1個(gè)槽傳入的。如果通過第一個(gè)槽來發(fā)送法線貼圖,它將會(huì)保存在效果文件的漫反射變量中。

for(int i = 0; i < meshSubsets; ++i){//Set the grounds index bufferd3d11DevCon->IASetIndexBuffer( meshIndexBuff, DXGI_FORMAT_R32_UINT, 0);//Set the grounds vertex bufferd3d11DevCon->IASetVertexBuffers( 0, 1, &meshVertBuff, &stride, &offset );//Set the WVP matrix and send it to the constant buffer in effect fileWVP = meshWorld * camView * camProjection;cbPerObj.WVP = XMMatrixTranspose(WVP); cbPerObj.World = XMMatrixTranspose(meshWorld); cbPerObj.difColor = material[meshSubsetTexture[i]].difColor;cbPerObj.hasTexture = material[meshSubsetTexture[i]].hasTexture;///**************new**************cbPerObj.hasNormMap = material[meshSubsetTexture[i]].hasNormMap;///**************new**************d3d11DevCon->UpdateSubresource( cbPerObjectBuffer, 0, NULL, &cbPerObj, 0, 0 );d3d11DevCon->VSSetConstantBuffers( 0, 1, &cbPerObjectBuffer );d3d11DevCon->PSSetConstantBuffers( 1, 1, &cbPerObjectBuffer );if(material[meshSubsetTexture[i]].hasTexture)d3d11DevCon->PSSetShaderResources( 0, 1, &meshSRV[material[meshSubsetTexture[i]].texArrayIndex] );///**************new**************if(material[meshSubsetTexture[i]].hasNormMap)d3d11DevCon->PSSetShaderResources( 1, 1, &meshSRV[material[meshSubsetTexture[i]].normMapTexArrayIndex] );///**************new**************d3d11DevCon->PSSetSamplers( 0, 1, &CubesTexSamplerState );d3d11DevCon->RSSetState(RSCullNone);int indexStart = meshSubsetIndexStart[i];int indexDrawAmount = meshSubsetIndexStart[i+1] - meshSubsetIndexStart[i];if(!material[meshSubsetTexture[i]].transparent)d3d11DevCon->DrawIndexed( indexDrawAmount, indexStart, 0 );}
效果文件

這里修改效果文件以實(shí)現(xiàn)真實(shí)法線貼圖。首先修改常量緩沖以保存使能凹凸貼圖的布爾變量。然后添加一個(gè)新的2d紋理,用于存儲(chǔ)法線貼圖數(shù)據(jù)。之后修改頂點(diǎn)結(jié)構(gòu)體輸出以包含法線。需要確保將切線放入到世界空間中,就像之間在法線上做的一樣。

struct Light {float3 pos;float range;float3 dir;float cone;float3 att;float4 ambient;float4 diffuse; };cbuffer cbPerFrame {Light light; };cbuffer cbPerObject {float4x4 WVP;float4x4 World;float4 difColor;bool hasTexture;bool hasNormMap; };Texture2D ObjTexture; Texture2D ObjNormMap; SamplerState ObjSamplerState; TextureCube SkyMap;struct VS_OUTPUT {float4 Pos : SV_POSITION;float4 worldPos : POSITION;float2 TexCoord : TEXCOORD;float3 normal : NORMAL;float3 tangent : TANGENT; };struct SKYMAP_VS_OUTPUT //output structure for skymap vertex shader {float4 Pos : SV_POSITION;float3 texCoord : TEXCOORD; };VS_OUTPUT VS(float4 inPos : POSITION, float2 inTexCoord : TEXCOORD, float3 normal : NORMAL, float3 tangent : TANGENT) {VS_OUTPUT output;output.Pos = mul(inPos, WVP);output.worldPos = mul(inPos, World);output.normal = mul(normal, World);output.tangent = mul(tangent, World);output.TexCoord = inTexCoord;return output; }SKYMAP_VS_OUTPUT SKYMAP_VS(float3 inPos : POSITION, float2 inTexCoord : TEXCOORD, float3 normal : NORMAL, float3 tangent : TANGENT) {SKYMAP_VS_OUTPUT output = (SKYMAP_VS_OUTPUT)0;//Set Pos to xyww instead of xyzw, so that z will always be 1 (furthest from camera)output.Pos = mul(float4(inPos, 1.0f), WVP).xyww;output.texCoord = inPos;return output; }float4 PS(VS_OUTPUT input) : SV_TARGET {input.normal = normalize(input.normal); //Set diffuse color of materialfloat4 diffuse = difColor;//If material has a diffuse texture map, set it nowif(hasTexture == true)diffuse = ObjTexture.Sample( ObjSamplerState, input.TexCoord );//If material has a normal map, we can set it nowif(hasNormMap == true){//Load normal from normal mapfloat4 normalMap = ObjNormMap.Sample( ObjSamplerState, input.TexCoord );//Change normal map range from [0, 1] to [-1, 1]normalMap = (2.0f*normalMap) - 1.0f;//Make sure tangent is completely orthogonal to normalinput.tangent = normalize(input.tangent - dot(input.tangent, input.normal)*input.normal);//Create the biTangentfloat3 biTangent = cross(input.normal, input.tangent);//Create the "Texture Space"float3x3 texSpace = float3x3(input.tangent, biTangent, input.normal);//Convert normal from normal map to texture space and store in input.normalinput.normal = normalize(mul(normalMap, texSpace));}float3 finalColor;finalColor = diffuse * light.ambient;finalColor += saturate(dot(light.dir, input.normal) * light.diffuse * diffuse);return float4(finalColor, diffuse.a); }float4 SKYMAP_PS(SKYMAP_VS_OUTPUT input) : SV_Target {return SkyMap.Sample(ObjSamplerState, input.texCoord); }float4 D2D_PS(VS_OUTPUT input) : SV_TARGET {float4 diffuse = ObjTexture.Sample( ObjSamplerState, input.TexCoord );return diffuse; }

像素著色器

首先檢測(cè)法線貼圖是否在該面上使能,若沒有,則跳過,若有,則從法線貼圖中給當(dāng)前的像素加載法線,就像之前為當(dāng)前像素加載顏色一樣。該值范圍是位于0和1之間的,還需要將它轉(zhuǎn)為-1到1之間的值,因此在下一行就乘以2減去1得到該值。

下一行是確認(rèn)切線和法線為正交,通過減去切線指向法線的方向值,這將得到一個(gè)45度的角度。

現(xiàn)在正交且一切OK后,需要?jiǎng)?chuàng)建紋理空間的第三個(gè)軸:副切線。這可通過叉乘法線和切線得到。

最終,將這三個(gè)向量存進(jìn)一個(gè)3X3的矩陣中,這為該像素定義了紋理空間texSpace。

最后一步,從法線貼圖上獲得法線再乘以texSpace矩陣,并將結(jié)果保存到默認(rèn)法線變量中,這樣就可實(shí)現(xiàn)光照同時(shí)給表面一個(gè)凹凸的3d視覺感。

float4 PS(VS_OUTPUT input) : SV_TARGET {input.normal = normalize(input.normal); //Set diffuse color of materialfloat4 diffuse = difColor;//If material has a diffuse texture map, set it nowif(hasTexture == true)diffuse = ObjTexture.Sample( ObjSamplerState, input.TexCoord );//If material has a normal map, we can set it nowif(hasNormMap == true){//Load normal from normal mapfloat4 normalMap = ObjNormMap.Sample( ObjSamplerState, input.TexCoord );//Change normal map range from [0, 1] to [-1, 1]normalMap = (2.0f*normalMap) - 1.0f;//Make sure tangent is completely orthogonal to normalinput.tangent = normalize(input.tangent - dot(input.tangent, input.normal)*input.normal);//Create the biTangentfloat3 biTangent = cross(input.normal, input.tangent);//Create the "Texture Space"float3x3 texSpace = float3x3(input.tangent, biTangent, input.normal);//Convert normal from normal map to texture space and store in input.normalinput.normal = normalize(mul(normalMap, texSpace));}float3 finalColor;finalColor = diffuse * light.ambient;finalColor += saturate(dot(light.dir, input.normal) * light.diffuse * diffuse);return float4(finalColor, diffuse.a); }

草地法線圖片:


草地圖片:




效果文件:

struct Light {float3 pos;float range;float3 dir;float cone;float3 att;float4 ambient;float4 diffuse; };cbuffer cbPerFrame {Light light; };cbuffer cbPerObject {float4x4 WVP;float4x4 World;float4 difColor;bool hasTexture;bool hasNormMap; };Texture2D ObjTexture; Texture2D ObjNormMap; SamplerState ObjSamplerState; TextureCube SkyMap;struct VS_OUTPUT {float4 Pos : SV_POSITION;float4 worldPos : POSITION;float2 TexCoord : TEXCOORD;float3 normal : NORMAL;float3 tangent : TANGENT; };struct SKYMAP_VS_OUTPUT //output structure for skymap vertex shader {float4 Pos : SV_POSITION;float3 texCoord : TEXCOORD; };VS_OUTPUT VS(float4 inPos : POSITION, float2 inTexCoord : TEXCOORD, float3 normal : NORMAL, float3 tangent : TANGENT) {VS_OUTPUT output;output.Pos = mul(inPos, WVP);output.worldPos = mul(inPos, World);output.normal = mul(normal, World);output.tangent = mul(tangent, World);output.TexCoord = inTexCoord;return output; }SKYMAP_VS_OUTPUT SKYMAP_VS(float3 inPos : POSITION, float2 inTexCoord : TEXCOORD, float3 normal : NORMAL, float3 tangent : TANGENT) {SKYMAP_VS_OUTPUT output = (SKYMAP_VS_OUTPUT)0;//Set Pos to xyww instead of xyzw, so that z will always be 1 (furthest from camera)output.Pos = mul(float4(inPos, 1.0f), WVP).xyww;output.texCoord = inPos;return output; }float4 PS(VS_OUTPUT input) : SV_TARGET {input.normal = normalize(input.normal);//Set diffuse color of materialfloat4 diffuse = difColor;//If material has a diffuse texture map, set it nowif(hasTexture == true)diffuse = ObjTexture.Sample( ObjSamplerState, input.TexCoord );//If material has a normal map, we can set it nowif(hasNormMap == true){//Load normal from normal mapfloat4 normalMap = ObjNormMap.Sample( ObjSamplerState, input.TexCoord );//Change normal map range from [0, 1] to [-1, 1]normalMap = (2.0f*normalMap) - 1.0f;//Make sure tangent is completely orthogonal to normalinput.tangent = normalize(input.tangent - dot(input.tangent, input.normal)*input.normal);//Create the biTangentfloat3 biTangent = cross(input.normal, input.tangent);//Create the "Texture Space"float3x3 texSpace = float3x3(input.tangent, biTangent, input.normal);//Convert normal from normal map to texture space and store in input.normalinput.normal = normalize(mul(normalMap, texSpace));}float3 finalColor;finalColor = diffuse * light.ambient;finalColor += saturate(dot(light.dir, input.normal) * light.diffuse * diffuse);return float4(finalColor, diffuse.a); }float4 SKYMAP_PS(SKYMAP_VS_OUTPUT input) : SV_Target {return SkyMap.Sample(ObjSamplerState, input.texCoord); }float4 D2D_PS(VS_OUTPUT input) : SV_TARGET {float4 diffuse = ObjTexture.Sample( ObjSamplerState, input.TexCoord );return diffuse; }

實(shí)例代碼:

#include "stdafx.h" #pragma comment(lib, "d3d11.lib") #pragma comment(lib, "d3dx11.lib") #pragma comment(lib, "d3dx10.lib")#pragma comment(lib, "D3D10_1.lib") #pragma comment(lib, "DXGI.lib") #pragma comment(lib, "D2D1.lib") #pragma comment(lib, "dwrite.lib") ///**************new************** #pragma comment (lib, "dinput8.lib") #pragma comment (lib, "dxguid.lib") ///**************new**************#include <windows.h> #include "Resource.h" #include <d3d11.h> #include <d3dx11.h> #include <d3dx10.h> #include <xnamath.h> #include <D3D10_1.h> #include <DXGI.h> #include <D2D1.h> #include <sstream> #include <dwrite.h> ///**************new************** #include <dinput.h> ///**************new************** ///**************new************** #include <vector> #include <fstream> #include <istream> ///**************new************** //全局描述符 IDXGISwapChain* SwapChain; ID3D11Device* d3d11Device; ID3D11DeviceContext* d3d11DevCon; ID3D11RenderTargetView* renderTargetView;//索引緩沖 //ID3D11Buffer* squareIndexBuffer;//深度值-20170927 ID3D11DepthStencilView* depthStencilView; ID3D11Texture2D* depthStencilBuffer;//著色器 //ID3D11Buffer* squareVertBuffer; ID3D11VertexShader* VS; ID3D11PixelShader* PS; ID3D11PixelShader* D2D_PS; ID3D10Blob* VS_Buffer; ID3D10Blob* PS_Buffer; ID3D10Blob* D2D_PS_Buffer; ID3D11InputLayout* vertLayout;/// ID3D11Buffer* cbPerObjectBuffer; ID3D11BlendState* d2dTransparency; ID3D11RasterizerState* CCWcullMode; ID3D11RasterizerState* CWcullMode; //ID3D11ShaderResourceView* CubesTexture; ID3D11SamplerState* CubesTexSamplerState;ID3D11Buffer* cbPerFrameBuffer;ID3D10Device1 *d3d101Device; IDXGIKeyedMutex *keyedMutex11; IDXGIKeyedMutex *keyedMutex10; ID2D1RenderTarget *D2DRenderTarget; ID2D1SolidColorBrush *Brush; ID3D11Texture2D *BackBuffer11; ID3D11Texture2D *sharedTex11; ID3D11Buffer *d2dVertBuffer; ID3D11Buffer *d2dIndexBuffer; ID3D11ShaderResourceView *d2dTexture; IDWriteFactory *DWriteFactory; IDWriteTextFormat *TextFormat; ///**************new************** IDirectInputDevice8* DIKeyboard; IDirectInputDevice8* DIMouse; ///**************new************** ID3D11Buffer* sphereIndexBuffer; ID3D11Buffer* sphereVertBuffer;ID3D11VertexShader* SKYMAP_VS; ID3D11PixelShader* SKYMAP_PS; ID3D10Blob* SKYMAP_VS_Buffer; ID3D10Blob* SKYMAP_PS_Buffer;ID3D11ShaderResourceView* smrv;ID3D11DepthStencilState* DSLessEqual; ID3D11RasterizerState* RSCullNone; ///**************new************** ID3D11BlendState* Transparency; //網(wǎng)格變量,每個(gè)被加載的網(wǎng)格需要它自己的集 ID3D11Buffer* meshVertBuff; ID3D11Buffer* meshIndexBuff; XMMATRIX meshWorld; int meshSubsets = 0; std::vector<int> meshSubsetIndexStart; std::vector<int> meshSubsetTexture;//紋理和材質(zhì)變量,用于所有的網(wǎng)格的加載 std::vector<ID3D11ShaderResourceView*> meshSRV; std::vector<std::wstring> textureNameArray; ///**************new************** std::wstring printText; / LPCTSTR WndClassName = L"firstwindow"; HWND hwnd = NULL; HRESULT hr;const int Width = 1920; //設(shè)置寬 const int Height = 1200; // 設(shè)置高///**************new************** DIMOUSESTATE mouseLastState; LPDIRECTINPUT8 DirectInput;float rotx = 0; float rotz = 0; float scaleX = 1.0f; float scaleY = 1.0f;XMMATRIX Rotationx; //XMMATRIX Rotationy; XMMATRIX Rotationz; XMMATRIX Rotationy; ///**************new************** ///四個(gè)空間以及相機(jī)屬性 XMMATRIX WVP; //立方體 //XMMATRIX cube1World; //XMMATRIX cube2World; // //XMMATRIX World; XMMATRIX camView; XMMATRIX camProjection;XMMATRIX d2dWorld; XMVECTOR camPosition; XMVECTOR camTarget; XMVECTOR camUp; ///**************new************** XMVECTOR DefaultForward = XMVectorSet(0.0f,0.0f,1.0f, 0.0f); XMVECTOR DefaultRight = XMVectorSet(1.0f,0.0f,0.0f, 0.0f); XMVECTOR camForward = XMVectorSet(0.0f,0.0f,1.0f, 0.0f); XMVECTOR camRight = XMVectorSet(1.0f,0.0f,0.0f, 0.0f);XMMATRIX camRotationMatrix; //XMMATRIX groundWorld;float moveLeftRight = 0.0f; float moveBackForward = 0.0f;float camYaw = 0.0f; float camPitch = 0.0f; ///**************new************** int NumSphereVertices; int NumSphereFaces;XMMATRIX sphereWorld; ///**************new************** XMMATRIX Rotation; XMMATRIX Scale; XMMATRIX Translation; float rot = 0.01f;///**************new************** double countsPerSecond = 0.0; __int64 CounterStart = 0;int frameCount = 0; int fps = 0;__int64 frameTimeOld = 0; double frameTime; ///**************new************** //Function Prototypes// bool InitializeDirect3d11App(HINSTANCE hInstance); void CleanUp(); bool InitScene(); void DrawScene(); bool InitD2D_D3D101_DWrite(IDXGIAdapter1 *Adapter); void InitD2DScreenTexture(); ///**************new************** void UpdateScene(double time); ///**************new************** void UpdateCamera();void RenderText(std::wstring text, int inInt); //void RenderText(std::wstring text);void StartTimer(); double GetTime(); double GetFrameTime();// 初始化窗口 bool InitializeWindow(HINSTANCE hInstance,int ShowWnd,int width, int height,bool windowed);//初始化消息循環(huán)函數(shù) int messageloop(); //初始化窗口回調(diào)過程。Windows API是事件驅(qū)動(dòng)型的編程模型。在該函數(shù)中捕獲Windows消息,比如一個(gè)按鍵按下(也叫事件)以及程序操作流程。 ///**************new************** bool InitDirectInput(HINSTANCE hInstance); void DetectInput(double time); ///**************new************** void CreateSphere(int LatLines, int LongLines); LRESULT CALLBACK WndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);///new //創(chuàng)建效果常量緩沖的結(jié)構(gòu)體 struct cbPerObject {XMMATRIX WVP;XMMATRIX World;///**************new**************//用于像素著色器XMFLOAT4 difColor;BOOL hasTexture;///**************new**************//Because of HLSL structure packing, we will use windows BOOL//instead of bool because HLSL packs things into 4 bytes, and//bool is only one byte, where BOOL is 4 bytesBOOL hasNormMap;///**************new************** };cbPerObject cbPerObj;///**************new************** //創(chuàng)建材質(zhì)結(jié)構(gòu)體 struct SurfaceMaterial {std::wstring matName;XMFLOAT4 difColor;int texArrayIndex;///**************new**************int normMapTexArrayIndex;bool hasNormMap;///**************new**************bool hasTexture;bool transparent; };std::vector<SurfaceMaterial> material;//自創(chuàng)建surfaceMaterial結(jié)構(gòu)體后,定義函數(shù)LoadObjModel bool LoadObjModel(std::wstring filename, //.obj filenameID3D11Buffer** vertBuff, //mesh vertex bufferID3D11Buffer** indexBuff, //mesh index bufferstd::vector<int>& subsetIndexStart, //start index of each subsetstd::vector<int>& subsetMaterialArray, //index value of material for each subsetstd::vector<SurfaceMaterial>& material, //vector of material structuresint& subsetCount, //Number of subsets in meshbool isRHCoordSys, //true if model was created in right hand coord systembool computeNormals); //true to compute the normals, false to use the files normals ///**************new************** struct Light {Light(){ZeroMemory(this, sizeof(Light));}XMFLOAT3 pos;float range;XMFLOAT3 dir;float cone;XMFLOAT3 att;float pad2;XMFLOAT4 ambient;XMFLOAT4 diffuse;}; Light light;struct cbPerFrame {Light light; };cbPerFrame constbuffPerFrame;//頂點(diǎn)結(jié)構(gòu)體以及頂點(diǎn)布局(輸入布局)struct Vertex {Vertex(){}Vertex(float x, float y, float z,float u, float v,float nx, float ny, float nz,float tx, float ty, float tz): pos(x,y,z), texCoord(u, v), normal(nx, ny, nz),tangent(tx, ty, tz){}XMFLOAT3 pos;XMFLOAT2 texCoord;XMFLOAT3 normal;///**************new**************XMFLOAT3 tangent;XMFLOAT3 biTangent;///**************new************** };D3D11_INPUT_ELEMENT_DESC layout[] = {{"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0},{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 20, D3D11_INPUT_PER_VERTEX_DATA, 0},///**************new**************{ "TANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 32, D3D11_INPUT_PER_VERTEX_DATA, 0}///**************new************** }; UINT numElements = ARRAYSIZE(layout);//主函數(shù),傳入應(yīng)用程序句柄hInstance,前一個(gè)應(yīng)用程序句柄hPrevInstance,傳給函數(shù)處理的命令行l(wèi)pCmdLine以及窗口顯示方式的nShowCmd int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd) {//創(chuàng)建并注冊(cè)窗口if (!InitializeWindow(hInstance, nShowCmd, Width, Height, true)){MessageBox(0, L"Window Initialization - Failed",L"Error", MB_OK);return 0;}/newif (!InitializeDirect3d11App(hInstance)) // 初始化D3D{MessageBox(0, L"Direct3D Initialization - Failed",L"Error", MB_OK);return 0;}if(!InitScene()) //Initialize our scene{MessageBox(0, L"Scene Initialization - Failed",L"Error", MB_OK);return 0;}///**************new**************if(!InitDirectInput(hInstance)){MessageBox(0, L"Direct Input Initialization - Failed",L"Error", MB_OK);return 0;}///**************new**************messageloop();CleanUp();//ReleaseObjects();return 0; } // windowed 若為true則為窗口模式顯示,若為false則為全屏模式顯示 bool InitializeWindow(HINSTANCE hInstance,int ShowWnd,int width, int height,bool windowed) {/*typedef struct _WNDCLASS{UINT cbSize;UINT style;WNDPROC lpfnWndProc;int cbClsExtra;int cbWndExtra;HANDLE hInstance;HICON hIcon;HCURSOR hCursor;HBRUSH hbrBackground;LPCTSTR lpszMenuName;LPCTSTR lpszClassName;}WNDCLASS;*/WNDCLASSEX wc;wc.cbSize = sizeof(WNDCLASSEX); //window類的大小/********windows類風(fēng)格*CS_CLASSDC 一個(gè)使用該類創(chuàng)建的在所有窗口間共享的設(shè)備上下文*CS_DBLCLKS 在窗口上使能雙擊功能*CS_HREDRAW 若窗口的寬度有改變或者窗口水平地移動(dòng),窗口將會(huì)刷新*CS_NOCLOSE 窗口菜單上禁止關(guān)閉選項(xiàng)*CS_OWNDC 為每個(gè)窗口創(chuàng)建自己的設(shè)備上下文。正好與CS_CLASSDC相反*CS_PARENTDC 這會(huì)設(shè)置創(chuàng)建的子窗口的剪裁四邊形到父窗口,這允許子窗口能夠在父窗口上繪畫*CS_VERDRAW 若在窗口的高度或窗口在垂直方向有移動(dòng)窗口會(huì)重繪**/wc.style = CS_HREDRAW | CS_VREDRAW;//lpfnWndProc是一個(gè)指向處理窗口消息函數(shù)的指針,設(shè)置窗口處理函數(shù)的函數(shù)名WndProcwc.lpfnWndProc = WndProc;//cbClsExtra是WNDCLASSEX之后額外申請(qǐng)的字節(jié)數(shù)wc.cbClsExtra = NULL;//cbWndExtra指定窗口實(shí)例之后所申請(qǐng)的字節(jié)數(shù)wc.cbWndExtra = NULL;//當(dāng)前窗口應(yīng)用程序的句柄,通過給函數(shù)GetModuleHandle()函數(shù)第一個(gè)參數(shù)傳入NULL可獲取當(dāng)前窗口應(yīng)用程序。wc.hInstance = hInstance;//hIcon用來指定窗口標(biāo)題欄左上角的圖標(biāo)。以下是一些標(biāo)準(zhǔn)圖標(biāo):/**IDI_APPLICATION 默認(rèn)應(yīng)用程序圖標(biāo)*IDI_HAND 手形狀的圖標(biāo)*IDI_EXCLAMATION 感嘆號(hào)圖標(biāo)*IDI_INFORMATION 星號(hào)圖標(biāo)*IDI_QUESTION 問號(hào)圖標(biāo)*IDI_WINLOGO 若使用的是XP則是默認(rèn)應(yīng)用程序圖標(biāo),否則是窗口logo*/wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);/*定義光標(biāo)圖標(biāo)*IDC_APPSTARTING 標(biāo)準(zhǔn)箭頭以及小型沙漏光標(biāo)*IDC_ARROW 標(biāo)準(zhǔn)箭頭光標(biāo)*IDC_CROSS 十字線光標(biāo)*IDC_HAND 手型光標(biāo)*IDC_NO 斜線圈光標(biāo)*IDC_WAIT 沙漏光標(biāo)*/wc.hCursor = LoadCursor(NULL, IDC_ARROW);//hbrBackground是一個(gè)刷子的句柄,可使得背景黑色。wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 2);//附加到窗口的菜單名字,不需要的話設(shè)置為NULLwc.lpszMenuName = NULL;//對(duì)類進(jìn)行命名wc.lpszClassName = WndClassName;//指定任務(wù)欄的圖標(biāo),使用上面的IDI_圖標(biāo)wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);//注冊(cè)類。若失敗則會(huì)獲得一個(gè)錯(cuò)誤,若成功,則繼續(xù)創(chuàng)建窗口if (!RegisterClassEx(&wc)){MessageBox(NULL, L"Error registering class",L"Error", MB_OK | MB_ICONERROR);return 1;}//創(chuàng)建窗口hwnd = CreateWindowEx(NULL, WndClassName, L"normal mapping",WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, width,height, NULL,NULL,hInstance,NULL);if (!hwnd){MessageBox(NULL, L"Error registering class", L"Error", MB_OK | MB_ICONERROR);return 1;}//BOOL ShowWindow(HWND hWnd, int nCmdShow);//BOOL UpdateWindow(HWND hWnd);ShowWindow(hwnd, ShowWnd);UpdateWindow(hwnd);// 發(fā)送WM_PAINT消息到窗口過程,若窗口客戶區(qū)沒有任何東西要顯示,則不發(fā)送消息。返回true,繼續(xù)運(yùn)行到mainloop中去。return true; }bool InitializeDirect3d11App(HINSTANCE hInstance) {//聲明緩沖DXGI_MODE_DESC bufferDesc;ZeroMemory(&bufferDesc, sizeof(DXGI_MODE_DESC));bufferDesc.Width = Width;bufferDesc.Height = Height;bufferDesc.RefreshRate.Numerator = 60;bufferDesc.RefreshRate.Denominator = 1;bufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;bufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;bufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;//聲明交換鏈DXGI_SWAP_CHAIN_DESC swapChainDesc;ZeroMemory(&swapChainDesc, sizeof(DXGI_SWAP_CHAIN_DESC));swapChainDesc.BufferDesc = bufferDesc;swapChainDesc.SampleDesc.Count = 1;swapChainDesc.SampleDesc.Quality = 0;swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;swapChainDesc.BufferCount = 1;swapChainDesc.OutputWindow = hwnd;///**************new**************swapChainDesc.Windowed = true; ///**************new**************swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;//創(chuàng)建DXGI factory來枚舉顯卡IDXGIFactory1 *DXGIFactory;HRESULT hr = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void **)&DXGIFactory);//使用第一個(gè)顯卡IDXGIAdapter1 *Adapter;hr = DXGIFactory->EnumAdapters1(0, &Adapter);DXGIFactory->Release();//創(chuàng)建D3D11設(shè)備和交換鏈//hr = D3D11C//創(chuàng)建交換鏈D3D11CreateDeviceAndSwapChain(Adapter, D3D_DRIVER_TYPE_UNKNOWN, NULL, D3D11_CREATE_DEVICE_BGRA_SUPPORT, NULL, NULL, D3D11_SDK_VERSION, &swapChainDesc, &SwapChain, &d3d11Device, NULL, &d3d11DevCon);//初始化D2D D3D10.1和DirectWriteInitD2D_D3D101_DWrite(Adapter);//釋放Adapter接口Adapter->Release();//創(chuàng)建后緩沖ID3D11Texture2D* BackBuffer;SwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void**)&BackBuffer);//創(chuàng)建渲染目標(biāo)d3d11Device->CreateRenderTargetView(BackBuffer, NULL, &renderTargetView);BackBuffer->Release();//創(chuàng)建深度模板緩沖D3D11_TEXTURE2D_DESC depthStencilDesc;depthStencilDesc.Width = Width;depthStencilDesc.Height = Height;depthStencilDesc.MipLevels = 1;depthStencilDesc.ArraySize = 1;depthStencilDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;depthStencilDesc.SampleDesc.Count = 1;depthStencilDesc.SampleDesc.Quality = 0;depthStencilDesc.Usage = D3D11_USAGE_DEFAULT;depthStencilDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL; //綁定到OMdepthStencilDesc.CPUAccessFlags = 0;depthStencilDesc.MiscFlags = 0;//創(chuàng)建深度模板視圖d3d11Device->CreateTexture2D(&depthStencilDesc, NULL, &depthStencilBuffer);d3d11Device->CreateDepthStencilView(depthStencilBuffer, NULL, &depthStencilView);return true; }bool InitD2D_D3D101_DWrite(IDXGIAdapter1 *Adapter) {//創(chuàng)建D3D101設(shè)備hr = D3D10CreateDevice1(Adapter, D3D10_DRIVER_TYPE_HARDWARE, NULL, D3D10_CREATE_DEVICE_BGRA_SUPPORT,D3D10_FEATURE_LEVEL_9_3, D3D10_1_SDK_VERSION, &d3d101Device);//創(chuàng)建共享紋理,D3D101將會(huì)渲染它D3D11_TEXTURE2D_DESC sharedTexDesc;ZeroMemory(&sharedTexDesc, sizeof(sharedTexDesc));sharedTexDesc.Width = Width;sharedTexDesc.Height = Height;sharedTexDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;// DXGI_FORMAT_R8G8B8A8_UNORM;// DXGI_FORMAT_B8G8R8A8_UNORM;sharedTexDesc.MipLevels = 1;sharedTexDesc.ArraySize = 1;sharedTexDesc.SampleDesc.Count = 1;sharedTexDesc.Usage = D3D11_USAGE_DEFAULT;sharedTexDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;sharedTexDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;hr = d3d11Device->CreateTexture2D(&sharedTexDesc, NULL, &sharedTex11);//為共享紋理獲取key互斥量(為D3D11)hr = sharedTex11->QueryInterface(__uuidof(IDXGIKeyedMutex), (void **)&keyedMutex11);//獲取共享句柄需要在D3D10.1中打開共享紋理IDXGIResource *sharedResource10;HANDLE sharedHandle10;hr = sharedTex11->QueryInterface(__uuidof(IDXGIResource), (void **)&sharedResource10);hr = sharedResource10->GetSharedHandle(&sharedHandle10);sharedResource10->Release();//在D3D10.1中為共享紋理打開界面IDXGISurface1 *sharedSurface10;hr = d3d101Device->OpenSharedResource(sharedHandle10, __uuidof(IDXGISurface1), (void **)(&sharedSurface10));hr = sharedSurface10->QueryInterface(__uuidof(IDXGIKeyedMutex), (void **)&keyedMutex10);//創(chuàng)建D2D factoryID2D1Factory *D2DFactory;hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, __uuidof(ID2D1Factory), (void **)&D2DFactory);D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties;ZeroMemory(&renderTargetProperties, sizeof(renderTargetProperties));renderTargetProperties.type = D2D1_RENDER_TARGET_TYPE_HARDWARE;renderTargetProperties.pixelFormat = D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_PREMULTIPLIED);hr = D2DFactory->CreateDxgiSurfaceRenderTarget(sharedSurface10, &renderTargetProperties, &D2DRenderTarget);sharedSurface10->Release();D2DFactory->Release();//創(chuàng)建立體彩色畫筆繪制一些東西hr = D2DRenderTarget->CreateSolidColorBrush(D2D1::ColorF(1.0f, 1.0f, 1.0f, 1.0f), &Brush);//DirectWritehr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), reinterpret_cast<IUnknown **>(&DWriteFactory));hr = DWriteFactory->CreateTextFormat(L"Script",NULL,DWRITE_FONT_WEIGHT_REGULAR,DWRITE_FONT_STYLE_NORMAL,DWRITE_FONT_STRETCH_NORMAL,24.0f,L"en-us",&TextFormat);hr = TextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);hr = TextFormat->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);d3d101Device->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_POINTLIST); return true; }///**************new************** bool InitDirectInput(HINSTANCE hInstance) {hr = DirectInput8Create(hInstance,DIRECTINPUT_VERSION,IID_IDirectInput8,(void**)&DirectInput,NULL); hr = DirectInput->CreateDevice(GUID_SysKeyboard,&DIKeyboard,NULL);hr = DirectInput->CreateDevice(GUID_SysMouse,&DIMouse,NULL);hr = DIKeyboard->SetDataFormat(&c_dfDIKeyboard);hr = DIKeyboard->SetCooperativeLevel(hwnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);hr = DIMouse->SetDataFormat(&c_dfDIMouse);hr = DIMouse->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_NOWINKEY | DISCL_FOREGROUND);return true; }void UpdateCamera() {camRotationMatrix = XMMatrixRotationRollPitchYaw(camPitch, camYaw, 0);camTarget = XMVector3TransformCoord(DefaultForward, camRotationMatrix );camTarget = XMVector3Normalize(camTarget);XMMATRIX RotateYTempMatrix;RotateYTempMatrix = XMMatrixRotationY(camYaw);camRight = XMVector3TransformCoord(DefaultRight, RotateYTempMatrix);camUp = XMVector3TransformCoord(camUp, RotateYTempMatrix);camForward = XMVector3TransformCoord(DefaultForward, RotateYTempMatrix);camPosition += moveLeftRight*camRight;camPosition += moveBackForward*camForward;moveLeftRight = 0.0f;moveBackForward = 0.0f;camTarget = camPosition + camTarget; camView = XMMatrixLookAtLH( camPosition, camTarget, camUp ); } void DetectInput(double time) {DIMOUSESTATE mouseCurrState;BYTE keyboardState[256];DIKeyboard->Acquire();DIMouse->Acquire();DIMouse->GetDeviceState(sizeof(DIMOUSESTATE), &mouseCurrState);DIKeyboard->GetDeviceState(sizeof(keyboardState),(LPVOID)&keyboardState);if(keyboardState[DIK_ESCAPE] & 0x80)PostMessage(hwnd, WM_DESTROY, 0, 0);float speed = 10.0f * time;if(keyboardState[DIK_A] & 0x80){moveLeftRight -= speed;}if(keyboardState[DIK_D] & 0x80){moveLeftRight += speed;}if(keyboardState[DIK_W] & 0x80){moveBackForward += speed;}if(keyboardState[DIK_S] & 0x80){moveBackForward -= speed;}if((mouseCurrState.lX != mouseLastState.lX) || (mouseCurrState.lY != mouseLastState.lY)){camYaw += mouseLastState.lX * 0.001f;camPitch += mouseCurrState.lY * 0.001f;mouseLastState = mouseCurrState;}UpdateCamera();return; } ///**************new************** void CleanUp() {///**************new**************SwapChain->SetFullscreenState(false, NULL);PostMessage(hwnd, WM_DESTROY, 0, 0);///**************new**************SwapChain->Release();d3d11Device->Release();d3d11DevCon->Release();renderTargetView->Release();//squareVertBuffer->Release();//squareIndexBuffer->Release();//triangleVertBuffer->Release();VS->Release();PS->Release();VS_Buffer->Release();PS_Buffer->Release();vertLayout->Release();depthStencilView->Release();depthStencilBuffer->Release();//cbPerObjectBuffer->Release();//釋放不裁剪對(duì)象 // noCull->Release();//釋放混合對(duì)象 #if 1Transparency->Release();CCWcullMode->Release();CWcullMode->Release(); #endif //釋放線框//WireFrame->Release();d3d101Device->Release();keyedMutex11->Release();keyedMutex10->Release();D2DRenderTarget->Release();Brush->Release(); // BackBuffer11->Release();sharedTex11->Release();DWriteFactory->Release();TextFormat->Release();d2dTexture->Release();/// newcbPerFrameBuffer->Release();///**************new**************DIKeyboard->Unacquire();DIMouse->Unacquire();DirectInput->Release();sphereIndexBuffer->Release();sphereVertBuffer->Release();SKYMAP_VS->Release();SKYMAP_PS->Release();SKYMAP_VS_Buffer->Release();SKYMAP_PS_Buffer->Release();smrv->Release();DSLessEqual->Release();RSCullNone->Release();///**************new**************meshVertBuff->Release();meshIndexBuff->Release();///**************new************** }///**************new************** bool LoadObjModel(std::wstring filename, ID3D11Buffer** vertBuff, ID3D11Buffer** indexBuff,std::vector<int>& subsetIndexStart,std::vector<int>& subsetMaterialArray,std::vector<SurfaceMaterial>& material, int& subsetCount,bool isRHCoordSys,bool computeNormals) {HRESULT hr = 0;std::wifstream fileIn (filename.c_str()); //Open filestd::wstring meshMatLib; //String to hold our obj material library filename//存儲(chǔ)我們模型的信息的數(shù)組std::vector<DWORD> indices;std::vector<XMFLOAT3> vertPos;std::vector<XMFLOAT3> vertNorm;std::vector<XMFLOAT2> vertTexCoord;std::vector<std::wstring> meshMaterials;//頂點(diǎn)定義索引std::vector<int> vertPosIndex;std::vector<int> vertNormIndex;std::vector<int> vertTCIndex;//如果沒有定義紋理坐標(biāo)或發(fā)現(xiàn),確保有一個(gè)默認(rèn)的值bool hasTexCoord = false;bool hasNorm = false;//用于存儲(chǔ)向量的臨時(shí)變量std::wstring meshMaterialsTemp;int vertPosIndexTemp;int vertNormIndexTemp;int vertTCIndexTemp;wchar_t checkChar; //The variable we will use to store one char from file at a timestd::wstring face; //Holds the string containing our face verticesint vIndex = 0; //Keep track of our vertex index countint triangleCount = 0; //Total Trianglesint totalVerts = 0;int meshTriangles = 0;//檢測(cè)文件是否被打開if (fileIn){while(fileIn){ checkChar = fileIn.get(); //Get next charswitch (checkChar){ case '#':checkChar = fileIn.get();while(checkChar != '\n')checkChar = fileIn.get();break;case 'v': //獲取向量描述符checkChar = fileIn.get();if(checkChar == ' ') //v - vert position{float vz, vy, vx;fileIn >> vx >> vy >> vz; //Store the next three typesif(isRHCoordSys) //If model is from an RH Coord SystemvertPos.push_back(XMFLOAT3( vx, vy, vz * -1.0f)); //Invert the Z axiselsevertPos.push_back(XMFLOAT3( vx, vy, vz));}if(checkChar == 't') //vt - vert tex coords{ float vtcu, vtcv;fileIn >> vtcu >> vtcv; //Store next two typesif(isRHCoordSys) //If model is from an RH Coord SystemvertTexCoord.push_back(XMFLOAT2(vtcu, 1.0f-vtcv)); //Reverse the "v" axiselsevertTexCoord.push_back(XMFLOAT2(vtcu, vtcv)); hasTexCoord = true; //We know the model uses texture coords}//由于我們?cè)诤髞碛?jì)算法線,我們不必在此檢測(cè)法線//In the file, but i'll do it here anywayif(checkChar == 'n') //vn - vert normal{float vnx, vny, vnz;fileIn >> vnx >> vny >> vnz; //Store next three typesif(isRHCoordSys) //If model is from an RH Coord SystemvertNorm.push_back(XMFLOAT3( vnx, vny, vnz * -1.0f )); //Invert the Z axiselsevertNorm.push_back(XMFLOAT3( vnx, vny, vnz )); hasNorm = true; //We know the model defines normals}break;//新組(子集)case 'g': //g - defines a groupcheckChar = fileIn.get();if(checkChar == ' '){subsetIndexStart.push_back(vIndex); //Start index for this subsetsubsetCount++;}break;//獲取面索引case 'f': //f - defines the facescheckChar = fileIn.get();if(checkChar == ' '){face = L"";std::wstring VertDef; //Holds one vertex definition at a timetriangleCount = 0;checkChar = fileIn.get();while(checkChar != '\n'){face += checkChar; //Add the char to our face stringcheckChar = fileIn.get(); //Get the next Characterif(checkChar == ' ') //If its a space...triangleCount++; //Increase our triangle count}//Check for space at the end of our face stringif(face[face.length()-1] == ' ')triangleCount--; //Each space adds to our triangle counttriangleCount -= 1; //Ever vertex in the face AFTER the first two are new facesstd::wstringstream ss(face);if(face.length() > 0){int firstVIndex, lastVIndex; //Holds the first and last vertice's indexfor(int i = 0; i < 3; ++i) //First three vertices (first triangle){ss >> VertDef; //Get vertex definition (vPos/vTexCoord/vNorm)std::wstring vertPart;int whichPart = 0; //(vPos, vTexCoord, or vNorm)//Parse this stringfor(int j = 0; j < VertDef.length(); ++j){if(VertDef[j] != '/') //If there is no divider "/", add a char to our vertPartvertPart += VertDef[j];//If the current char is a divider "/", or its the last character in the stringif(VertDef[j] == '/' || j == VertDef.length()-1){std::wistringstream wstringToInt(vertPart); //Used to convert wstring to intif(whichPart == 0) //If vPos{wstringToInt >> vertPosIndexTemp;vertPosIndexTemp -= 1; //subtract one since c++ arrays start with 0, and obj start with 1//Check to see if the vert pos was the only thing specifiedif(j == VertDef.length()-1){vertNormIndexTemp = 0;vertTCIndexTemp = 0;}}else if(whichPart == 1) //If vTexCoord{if(vertPart != L"") //Check to see if there even is a tex coord{wstringToInt >> vertTCIndexTemp;vertTCIndexTemp -= 1; //subtract one since c++ arrays start with 0, and obj start with 1}else //If there is no tex coord, make a defaultvertTCIndexTemp = 0;//If the cur. char is the second to last in the string, then//there must be no normal, so set a default normalif(j == VertDef.length()-1)vertNormIndexTemp = 0;} else if(whichPart == 2) //If vNorm{std::wistringstream wstringToInt(vertPart);wstringToInt >> vertNormIndexTemp;vertNormIndexTemp -= 1; //subtract one since c++ arrays start with 0, and obj start with 1}vertPart = L""; //Get ready for next vertex partwhichPart++; //Move on to next vertex part }}//Check to make sure there is at least one subsetif(subsetCount == 0){subsetIndexStart.push_back(vIndex); //Start index for this subsetsubsetCount++;}//Avoid duplicate verticesbool vertAlreadyExists = false;if(totalVerts >= 3) //Make sure we at least have one triangle to check{//Loop through all the verticesfor(int iCheck = 0; iCheck < totalVerts; ++iCheck){//If the vertex position and texture coordinate in memory are the same//As the vertex position and texture coordinate we just now got out//of the obj file, we will set this faces vertex index to the vertex's//index value in memory. This makes sure we don't create duplicate verticesif(vertPosIndexTemp == vertPosIndex[iCheck] && !vertAlreadyExists){if(vertTCIndexTemp == vertTCIndex[iCheck]){indices.push_back(iCheck); //Set index for this vertexvertAlreadyExists = true; //If we've made it here, the vertex already exists}}}}//If this vertex is not already in our vertex arrays, put it thereif(!vertAlreadyExists){vertPosIndex.push_back(vertPosIndexTemp);vertTCIndex.push_back(vertTCIndexTemp);vertNormIndex.push_back(vertNormIndexTemp);totalVerts++; //We created a new vertexindices.push_back(totalVerts-1); //Set index for this vertex} //If this is the very first vertex in the face, we need to//make sure the rest of the triangles use this vertexif(i == 0){firstVIndex = indices[vIndex]; //The first vertex index of this FACE}//If this was the last vertex in the first triangle, we will make sure//the next triangle uses this one (eg. tri1(1,2,3) tri2(1,3,4) tri3(1,4,5))if(i == 2){ lastVIndex = indices[vIndex]; //The last vertex index of this TRIANGLE}vIndex++; //Increment index count}meshTriangles++; //One triangle down//If there are more than three vertices in the face definition, we need to make sure//we convert the face to triangles. We created our first triangle above, now we will//create a new triangle for every new vertex in the face, using the very first vertex//of the face, and the last vertex from the triangle before the current trianglefor(int l = 0; l < triangleCount-1; ++l) //Loop through the next vertices to create new triangles{//First vertex of this triangle (the very first vertex of the face too)indices.push_back(firstVIndex); //Set index for this vertexvIndex++;//Second Vertex of this triangle (the last vertex used in the tri before this one)indices.push_back(lastVIndex); //Set index for this vertexvIndex++;//Get the third vertex for this triangless >> VertDef;std::wstring vertPart;int whichPart = 0;//Parse this string (same as above)for(int j = 0; j < VertDef.length(); ++j){if(VertDef[j] != '/')vertPart += VertDef[j];if(VertDef[j] == '/' || j == VertDef.length()-1){std::wistringstream wstringToInt(vertPart);if(whichPart == 0){wstringToInt >> vertPosIndexTemp;vertPosIndexTemp -= 1;//Check to see if the vert pos was the only thing specifiedif(j == VertDef.length()-1){vertTCIndexTemp = 0;vertNormIndexTemp = 0;}}else if(whichPart == 1){if(vertPart != L""){wstringToInt >> vertTCIndexTemp;vertTCIndexTemp -= 1;}elsevertTCIndexTemp = 0;if(j == VertDef.length()-1)vertNormIndexTemp = 0;} else if(whichPart == 2){std::wistringstream wstringToInt(vertPart);wstringToInt >> vertNormIndexTemp;vertNormIndexTemp -= 1;}vertPart = L"";whichPart++; }} //Check for duplicate verticesbool vertAlreadyExists = false;if(totalVerts >= 3) //Make sure we at least have one triangle to check{for(int iCheck = 0; iCheck < totalVerts; ++iCheck){if(vertPosIndexTemp == vertPosIndex[iCheck] && !vertAlreadyExists){if(vertTCIndexTemp == vertTCIndex[iCheck]){indices.push_back(iCheck); //Set index for this vertexvertAlreadyExists = true; //If we've made it here, the vertex already exists}}}}if(!vertAlreadyExists){vertPosIndex.push_back(vertPosIndexTemp);vertTCIndex.push_back(vertTCIndexTemp);vertNormIndex.push_back(vertNormIndexTemp);totalVerts++; //New vertex created, add to total vertsindices.push_back(totalVerts-1); //Set index for this vertex}//Set the second vertex for the next triangle to the last vertex we got lastVIndex = indices[vIndex]; //The last vertex index of this TRIANGLEmeshTriangles++; //New triangle definedvIndex++; }}}break;case 'm': //mtllib - material library filenamecheckChar = fileIn.get();if(checkChar == 't'){checkChar = fileIn.get();if(checkChar == 'l'){checkChar = fileIn.get();if(checkChar == 'l'){checkChar = fileIn.get();if(checkChar == 'i'){checkChar = fileIn.get();if(checkChar == 'b'){checkChar = fileIn.get();if(checkChar == ' '){//Store the material libraries file namefileIn >> meshMatLib;}}}}}}break;case 'u': //usemtl - which material to usecheckChar = fileIn.get();if(checkChar == 's'){checkChar = fileIn.get();if(checkChar == 'e'){checkChar = fileIn.get();if(checkChar == 'm'){checkChar = fileIn.get();if(checkChar == 't'){checkChar = fileIn.get();if(checkChar == 'l'){checkChar = fileIn.get();if(checkChar == ' '){meshMaterialsTemp = L""; //Make sure this is clearedfileIn >> meshMaterialsTemp; //Get next type (string)meshMaterials.push_back(meshMaterialsTemp);}}}}}}break;default: break;}}}else //If we could not open the file{SwapChain->SetFullscreenState(false, NULL); //Make sure we are out of fullscreen//create messagestd::wstring message = L"Could not open: ";message += filename;MessageBox(0, message.c_str(), //display messageL"Error", MB_OK);return false;}subsetIndexStart.push_back(vIndex); //There won't be another index start after our last subset, so set it here//sometimes "g" is defined at the very top of the file, then again before the first group of faces.//This makes sure the first subset does not conatain "0" indices.if(subsetIndexStart[1] == 0){subsetIndexStart.erase(subsetIndexStart.begin()+1);meshSubsets--;}//Make sure we have a default for the tex coord and normal//if one or both are not specifiedif(!hasNorm)vertNorm.push_back(XMFLOAT3(0.0f, 0.0f, 0.0f));if(!hasTexCoord)vertTexCoord.push_back(XMFLOAT2(0.0f, 0.0f));//Close the obj file, and open the mtl filefileIn.close();fileIn.open(meshMatLib.c_str());std::wstring lastStringRead;int matCount = material.size(); //total materials//kdset - 若沒有設(shè)置漫反射顏色,則使用環(huán)境光顏色(通常是一樣的)//If the diffuse color WAS set, then we don't need to set our diffuse color to ambientbool kdset = false;if (fileIn){while(fileIn){checkChar = fileIn.get(); //Get next charswitch (checkChar){//Check for commentcase '#':checkChar = fileIn.get();while(checkChar != '\n')checkChar = fileIn.get();break;//Set diffuse colorcase 'K':checkChar = fileIn.get();if(checkChar == 'd') //Diffuse Color{checkChar = fileIn.get(); //remove spacefileIn >> material[matCount-1].difColor.x;fileIn >> material[matCount-1].difColor.y;fileIn >> material[matCount-1].difColor.z;kdset = true;}//Ambient Color (We'll store it in diffuse if there isn't a diffuse already)if(checkChar == 'a') { checkChar = fileIn.get(); //remove spaceif(!kdset){fileIn >> material[matCount-1].difColor.x;fileIn >> material[matCount-1].difColor.y;fileIn >> material[matCount-1].difColor.z;}}break;//Check for transparencycase 'T':checkChar = fileIn.get();if(checkChar == 'r'){checkChar = fileIn.get(); //remove spacefloat Transparency;fileIn >> Transparency;material[matCount-1].difColor.w = Transparency;if(Transparency > 0.0f)material[matCount-1].transparent = true;}break;//Some obj files specify d for transparencycase 'd':checkChar = fileIn.get();if(checkChar == ' '){float Transparency;fileIn >> Transparency;//'d' - 0 being most transparent, and 1 being opaque, opposite of TrTransparency = 1.0f - Transparency;material[matCount-1].difColor.w = Transparency;if(Transparency > 0.0f)material[matCount-1].transparent = true; }break;//Get the diffuse map (texture)case 'm':checkChar = fileIn.get();if(checkChar == 'a'){checkChar = fileIn.get();if(checkChar == 'p'){checkChar = fileIn.get();if(checkChar == '_'){//map_Kd - Diffuse mapcheckChar = fileIn.get();if(checkChar == 'K'){checkChar = fileIn.get();if(checkChar == 'd'){std::wstring fileNamePath;fileIn.get(); //Remove whitespace between map_Kd and file//Get the file path - We read the pathname char by char since//pathnames can sometimes contain spaces, so we will read until//we find the file extensionbool texFilePathEnd = false;while(!texFilePathEnd){checkChar = fileIn.get();fileNamePath += checkChar;if(checkChar == '.'){for(int i = 0; i < 3; ++i)fileNamePath += fileIn.get();texFilePathEnd = true;} }//check if this texture has already been loadedbool alreadyLoaded = false;for(int i = 0; i < textureNameArray.size(); ++i){if(fileNamePath == textureNameArray[i]){alreadyLoaded = true;material[matCount-1].texArrayIndex = i;material[matCount-1].hasTexture = true;}}//if the texture is not already loaded, load it nowif(!alreadyLoaded){ID3D11ShaderResourceView* tempMeshSRV;hr = D3DX11CreateShaderResourceViewFromFile( d3d11Device, fileNamePath.c_str(),NULL, NULL, &tempMeshSRV, NULL );if(SUCCEEDED(hr)){textureNameArray.push_back(fileNamePath.c_str());material[matCount-1].texArrayIndex = meshSRV.size();meshSRV.push_back(tempMeshSRV);material[matCount-1].hasTexture = true;}} }}//map_d - alpha mapelse if(checkChar == 'd'){//Alpha maps are usually the same as the diffuse map//So we will assume that for now by only enabling//transparency for this material, as we will already//be using the alpha channel in the diffuse mapmaterial[matCount-1].transparent = true;}///**************new**************//map_bump - bump map (we're usinga normal map though)else if(checkChar == 'b'){checkChar = fileIn.get();if(checkChar == 'u'){checkChar = fileIn.get();if(checkChar == 'm'){checkChar = fileIn.get();if(checkChar == 'p'){std::wstring fileNamePath;fileIn.get(); //Remove whitespace between map_bump and file//Get the file path - We read the pathname char by char since//pathnames can sometimes contain spaces, so we will read until//we find the file extensionbool texFilePathEnd = false;while(!texFilePathEnd){checkChar = fileIn.get();fileNamePath += checkChar;if(checkChar == '.'){for(int i = 0; i < 3; ++i)fileNamePath += fileIn.get();texFilePathEnd = true;} }//check if this texture has already been loadedbool alreadyLoaded = false;for(int i = 0; i < textureNameArray.size(); ++i){if(fileNamePath == textureNameArray[i]){alreadyLoaded = true;material[matCount-1].normMapTexArrayIndex = i;material[matCount-1].hasNormMap = true;}}//if the texture is not already loaded, load it nowif(!alreadyLoaded){ID3D11ShaderResourceView* tempMeshSRV;hr = D3DX11CreateShaderResourceViewFromFile( d3d11Device, fileNamePath.c_str(),NULL, NULL, &tempMeshSRV, NULL );if(SUCCEEDED(hr)){textureNameArray.push_back(fileNamePath.c_str());material[matCount-1].normMapTexArrayIndex = meshSRV.size();meshSRV.push_back(tempMeshSRV);material[matCount-1].hasNormMap = true;}} }}}}///**************new**************}}}break;case 'n': //newmtl - Declare new materialcheckChar = fileIn.get();if(checkChar == 'e'){checkChar = fileIn.get();if(checkChar == 'w'){checkChar = fileIn.get();if(checkChar == 'm'){checkChar = fileIn.get();if(checkChar == 't'){checkChar = fileIn.get();if(checkChar == 'l'){checkChar = fileIn.get();if(checkChar == ' '){//New material, set its defaultsSurfaceMaterial tempMat;material.push_back(tempMat);fileIn >> material[matCount].matName;material[matCount].transparent = false;material[matCount].hasTexture = false;///**************new**************material[matCount].hasNormMap = false;material[matCount].normMapTexArrayIndex = 0;///**************new**************material[matCount].texArrayIndex = 0;matCount++;kdset = false;}}}}}}break;default:break;}}} else{SwapChain->SetFullscreenState(false, NULL); //Make sure we are out of fullscreenstd::wstring message = L"Could not open: ";message += meshMatLib;MessageBox(0, message.c_str(),L"Error", MB_OK);return false;}//Set the subsets material to the index value//of the its material in our material arrayfor(int i = 0; i < meshSubsets; ++i){bool hasMat = false;for(int j = 0; j < material.size(); ++j){if(meshMaterials[i] == material[j].matName){subsetMaterialArray.push_back(j);hasMat = true;}}if(!hasMat)subsetMaterialArray.push_back(0); //Use first material in array}std::vector<Vertex> vertices;Vertex tempVert;//Create our vertices using the information we got //from the file and store them in a vectorfor(int j = 0 ; j < totalVerts; ++j){tempVert.pos = vertPos[vertPosIndex[j]];tempVert.normal = vertNorm[vertNormIndex[j]];tempVert.texCoord = vertTexCoord[vertTCIndex[j]];vertices.push_back(tempVert);}//Compute Normals/////If computeNormals was set to true then we will create our own//normals, if it was set to false we will use the obj files normalsif(computeNormals){std::vector<XMFLOAT3> tempNormal;//normalized and unnormalized normalsXMFLOAT3 unnormalized = XMFLOAT3(0.0f, 0.0f, 0.0f);///**************new**************//tangent stuffstd::vector<XMFLOAT3> tempTangent;XMFLOAT3 tangent = XMFLOAT3(0.0f, 0.0f, 0.0f);float tcU1, tcV1, tcU2, tcV2;///**************new**************//Used to get vectors (sides) from the position of the vertsfloat vecX, vecY, vecZ;//Two edges of our triangleXMVECTOR edge1 = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);XMVECTOR edge2 = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);//Compute face normalsfor(int i = 0; i < meshTriangles; ++i){//Get the vector describing one edge of our triangle (edge 0,2)vecX = vertices[indices[(i*3)]].pos.x - vertices[indices[(i*3)+2]].pos.x;vecY = vertices[indices[(i*3)]].pos.y - vertices[indices[(i*3)+2]].pos.y;vecZ = vertices[indices[(i*3)]].pos.z - vertices[indices[(i*3)+2]].pos.z; edge1 = XMVectorSet(vecX, vecY, vecZ, 0.0f); //Create our first edge//Get the vector describing another edge of our triangle (edge 2,1)vecX = vertices[indices[(i*3)+2]].pos.x - vertices[indices[(i*3)+1]].pos.x;vecY = vertices[indices[(i*3)+2]].pos.y - vertices[indices[(i*3)+1]].pos.y;vecZ = vertices[indices[(i*3)+2]].pos.z - vertices[indices[(i*3)+1]].pos.z; edge2 = XMVectorSet(vecX, vecY, vecZ, 0.0f); //Create our second edge//Cross multiply the two edge vectors to get the un-normalized face normalXMStoreFloat3(&unnormalized, XMVector3Cross(edge1, edge2));tempNormal.push_back(unnormalized);///**************new**************//Find first texture coordinate edge 2d vectortcU1 = vertices[indices[(i*3)]].texCoord.x - vertices[indices[(i*3)+2]].texCoord.x;tcV1 = vertices[indices[(i*3)]].texCoord.y - vertices[indices[(i*3)+2]].texCoord.y;//Find second texture coordinate edge 2d vectortcU2 = vertices[indices[(i*3)+2]].texCoord.x - vertices[indices[(i*3)+1]].texCoord.x;tcV2 = vertices[indices[(i*3)+2]].texCoord.y - vertices[indices[(i*3)+1]].texCoord.y;//Find tangent using both tex coord edges and position edgestangent.x = (tcV1 * XMVectorGetX(edge1) - tcV2 * XMVectorGetX(edge2)) * (1.0f / (tcU1 * tcV2 - tcU2 * tcV1));tangent.y = (tcV1 * XMVectorGetY(edge1) - tcV2 * XMVectorGetY(edge2)) * (1.0f / (tcU1 * tcV2 - tcU2 * tcV1));tangent.z = (tcV1 * XMVectorGetZ(edge1) - tcV2 * XMVectorGetZ(edge2)) * (1.0f / (tcU1 * tcV2 - tcU2 * tcV1));tempTangent.push_back(tangent);///**************new**************}//Compute vertex normals (normal Averaging)XMVECTOR normalSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);XMVECTOR tangentSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);int facesUsing = 0;float tX, tY, tZ; //temp axis variables//Go through each vertexfor(int i = 0; i < totalVerts; ++i){//Check which triangles use this vertexfor(int j = 0; j < meshTriangles; ++j){if(indices[j*3] == i ||indices[(j*3)+1] == i ||indices[(j*3)+2] == i){tX = XMVectorGetX(normalSum) + tempNormal[j].x;tY = XMVectorGetY(normalSum) + tempNormal[j].y;tZ = XMVectorGetZ(normalSum) + tempNormal[j].z;normalSum = XMVectorSet(tX, tY, tZ, 0.0f); //If a face is using the vertex, add the unormalized face normal to the normalSum///**************new************** //We can reuse tX, tY, tZ to sum up tangentstX = XMVectorGetX(tangentSum) + tempTangent[j].x;tY = XMVectorGetY(tangentSum) + tempTangent[j].y;tZ = XMVectorGetZ(tangentSum) + tempTangent[j].z;tangentSum = XMVectorSet(tX, tY, tZ, 0.0f); //sum up face tangents using this vertex///**************new**************facesUsing++;}}//Get the actual normal by dividing the normalSum by the number of faces sharing the vertexnormalSum = normalSum / facesUsing;///**************new**************tangentSum = tangentSum / facesUsing;///**************new**************//Normalize the normalSum vectornormalSum = XMVector3Normalize(normalSum);///**************new**************tangentSum = XMVector3Normalize(tangentSum);///**************new**************//Store the normal in our current vertexvertices[i].normal.x = XMVectorGetX(normalSum);vertices[i].normal.y = XMVectorGetY(normalSum);vertices[i].normal.z = XMVectorGetZ(normalSum);///**************new**************vertices[i].tangent.x = XMVectorGetX(tangentSum);vertices[i].tangent.y = XMVectorGetY(tangentSum);vertices[i].tangent.z = XMVectorGetZ(tangentSum);///**************new**************//Clear normalSum and facesUsing for next vertexnormalSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);///**************new**************tangentSum = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);///**************new**************facesUsing = 0;}}//Create index bufferD3D11_BUFFER_DESC indexBufferDesc;ZeroMemory( &indexBufferDesc, sizeof(indexBufferDesc) );indexBufferDesc.Usage = D3D11_USAGE_DEFAULT;indexBufferDesc.ByteWidth = sizeof(DWORD) * meshTriangles*3;indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;indexBufferDesc.CPUAccessFlags = 0;indexBufferDesc.MiscFlags = 0;D3D11_SUBRESOURCE_DATA iinitData;iinitData.pSysMem = &indices[0];d3d11Device->CreateBuffer(&indexBufferDesc, &iinitData, indexBuff);//Create Vertex BufferD3D11_BUFFER_DESC vertexBufferDesc;ZeroMemory( &vertexBufferDesc, sizeof(vertexBufferDesc) );vertexBufferDesc.Usage = D3D11_USAGE_DEFAULT;vertexBufferDesc.ByteWidth = sizeof( Vertex ) * totalVerts;vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;vertexBufferDesc.CPUAccessFlags = 0;vertexBufferDesc.MiscFlags = 0;D3D11_SUBRESOURCE_DATA vertexBufferData; ZeroMemory( &vertexBufferData, sizeof(vertexBufferData) );vertexBufferData.pSysMem = &vertices[0];hr = d3d11Device->CreateBuffer( &vertexBufferDesc, &vertexBufferData, vertBuff);return true; } ///**************new**************void CreateSphere(int LatLines, int LongLines) {NumSphereVertices = ((LatLines-2) * LongLines) + 2;NumSphereFaces = ((LatLines-3)*(LongLines)*2) + (LongLines*2);float sphereYaw = 0.0f;float spherePitch = 0.0f;std::vector<Vertex> vertices(NumSphereVertices);XMVECTOR currVertPos = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f);vertices[0].pos.x = 0.0f;vertices[0].pos.y = 0.0f;vertices[0].pos.z = 1.0f;for(DWORD i = 0; i < LatLines-2; ++i){spherePitch = (i+1) * (3.14f/(LatLines-1));Rotationx = XMMatrixRotationX(spherePitch);for(DWORD j = 0; j < LongLines; ++j){sphereYaw = j * (6.28f/(LongLines));Rotationy = XMMatrixRotationZ(sphereYaw);currVertPos = XMVector3TransformNormal( XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f), (Rotationx * Rotationy) ); currVertPos = XMVector3Normalize( currVertPos );vertices[i*LongLines+j+1].pos.x = XMVectorGetX(currVertPos);vertices[i*LongLines+j+1].pos.y = XMVectorGetY(currVertPos);vertices[i*LongLines+j+1].pos.z = XMVectorGetZ(currVertPos);}}vertices[NumSphereVertices-1].pos.x = 0.0f;vertices[NumSphereVertices-1].pos.y = 0.0f;vertices[NumSphereVertices-1].pos.z = -1.0f;D3D11_BUFFER_DESC vertexBufferDesc;ZeroMemory( &vertexBufferDesc, sizeof(vertexBufferDesc) );vertexBufferDesc.Usage = D3D11_USAGE_DEFAULT;vertexBufferDesc.ByteWidth = sizeof( Vertex ) * NumSphereVertices;vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;vertexBufferDesc.CPUAccessFlags = 0;vertexBufferDesc.MiscFlags = 0;D3D11_SUBRESOURCE_DATA vertexBufferData; ZeroMemory( &vertexBufferData, sizeof(vertexBufferData) );vertexBufferData.pSysMem = &vertices[0];hr = d3d11Device->CreateBuffer( &vertexBufferDesc, &vertexBufferData, &sphereVertBuffer);std::vector<DWORD> indices(NumSphereFaces * 3);int k = 0;for(DWORD l = 0; l < LongLines-1; ++l){indices[k] = 0;indices[k+1] = l+1;indices[k+2] = l+2;k += 3;}indices[k] = 0;indices[k+1] = LongLines;indices[k+2] = 1;k += 3;for(DWORD i = 0; i < LatLines-3; ++i){for(DWORD j = 0; j < LongLines-1; ++j){indices[k] = i*LongLines+j+1;indices[k+1] = i*LongLines+j+2;indices[k+2] = (i+1)*LongLines+j+1;indices[k+3] = (i+1)*LongLines+j+1;indices[k+4] = i*LongLines+j+2;indices[k+5] = (i+1)*LongLines+j+2;k += 6; // next quad}indices[k] = (i*LongLines)+LongLines;indices[k+1] = (i*LongLines)+1;indices[k+2] = ((i+1)*LongLines)+LongLines;indices[k+3] = ((i+1)*LongLines)+LongLines;indices[k+4] = (i*LongLines)+1;indices[k+5] = ((i+1)*LongLines)+1;k += 6;}for(DWORD l = 0; l < LongLines-1; ++l){indices[k] = NumSphereVertices-1;indices[k+1] = (NumSphereVertices-1)-(l+1);indices[k+2] = (NumSphereVertices-1)-(l+2);k += 3;}indices[k] = NumSphereVertices-1;indices[k+1] = (NumSphereVertices-1)-LongLines;indices[k+2] = NumSphereVertices-2;D3D11_BUFFER_DESC indexBufferDesc;ZeroMemory( &indexBufferDesc, sizeof(indexBufferDesc) );indexBufferDesc.Usage = D3D11_USAGE_DEFAULT;indexBufferDesc.ByteWidth = sizeof(DWORD) * NumSphereFaces * 3;indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;indexBufferDesc.CPUAccessFlags = 0;indexBufferDesc.MiscFlags = 0;D3D11_SUBRESOURCE_DATA iinitData;iinitData.pSysMem = &indices[0];d3d11Device->CreateBuffer(&indexBufferDesc, &iinitData, &sphereIndexBuffer);} void InitD2DScreenTexture() {//創(chuàng)建頂點(diǎn)緩沖Vertex v[] ={// Front FaceVertex(-1.0f, -1.0f, -1.0f, 0.0f, 1.0f,-1.0f, -1.0f, -1.0f, 0.0f, 0.0f, 0.0f),Vertex(-1.0f, 1.0f, -1.0f, 0.0f, 0.0f,-1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f),Vertex( 1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f),Vertex( 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 0.0f, 0.0f, 0.0f),};DWORD indices[] = {//字體面0, 1, 2,0, 2, 3,};D3D11_BUFFER_DESC indexBufferDesc;ZeroMemory(&indexBufferDesc, sizeof(indexBufferDesc));indexBufferDesc.Usage = D3D11_USAGE_DEFAULT;indexBufferDesc.ByteWidth = sizeof(DWORD) * 2 * 3;indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;indexBufferDesc.CPUAccessFlags = 0;indexBufferDesc.MiscFlags = 0;D3D11_SUBRESOURCE_DATA iinitData;iinitData.pSysMem = indices;d3d11Device->CreateBuffer(&indexBufferDesc, &iinitData, &d2dIndexBuffer);D3D11_BUFFER_DESC vertexBufferDesc;ZeroMemory(&vertexBufferDesc, sizeof(vertexBufferDesc));vertexBufferDesc.Usage = D3D11_USAGE_DEFAULT;vertexBufferDesc.ByteWidth = sizeof(Vertex) * 4;vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;vertexBufferDesc.CPUAccessFlags = 0;vertexBufferDesc.MiscFlags = 0;D3D11_SUBRESOURCE_DATA vertexBufferData;ZeroMemory(&vertexBufferData, sizeof(vertexBufferData));vertexBufferData.pSysMem = v;hr = d3d11Device->CreateBuffer(&vertexBufferDesc, &vertexBufferData, &d2dVertBuffer);//從紋理D2D,創(chuàng)建一個(gè)著色器資源視圖//因此,能夠使用它來創(chuàng)建一個(gè)矩形紋理,用于覆蓋場(chǎng)景d3d11Device->CreateShaderResourceView(sharedTex11, NULL, &d2dTexture);}//void ReleaseObjects() //{ //釋放創(chuàng)建的COM對(duì)象 // SwapChain->Release(); // d3d11Device->Release(); // d3d11DevCon->Release(); //}bool InitScene() {//InitD2DScreenTexture();//編譯著色器CreateSphere(10, 10);///**************new**************if(!LoadObjModel(L"ground.obj", &meshVertBuff, &meshIndexBuff, meshSubsetIndexStart, meshSubsetTexture, material, meshSubsets, true, true))return false;///**************new**************///**************new**************hr = D3DX11CompileFromFile(L"Effects.fx", 0, 0, "VS", "vs_4_0", 0, 0, 0, &VS_Buffer, 0, 0);hr = D3DX11CompileFromFile(L"Effects.fx", 0, 0, "PS", "ps_4_0", 0, 0, 0, &PS_Buffer, 0, 0);/// newhr = D3DX11CompileFromFile(L"Effects.fx", 0, 0, "D2D_PS", "ps_4_0", 0, 0, 0, &D2D_PS_Buffer, 0, 0);hr = D3DX11CompileFromFile(L"Effects.fx", 0, 0, "SKYMAP_VS", "vs_4_0", 0, 0, 0, &SKYMAP_VS_Buffer, 0, 0);hr = D3DX11CompileFromFile(L"Effects.fx", 0, 0, "SKYMAP_PS", "ps_4_0", 0, 0, 0, &SKYMAP_PS_Buffer, 0, 0);///**************new**************//創(chuàng)建著色器對(duì)象hr = d3d11Device->CreateVertexShader(VS_Buffer->GetBufferPointer(), VS_Buffer->GetBufferSize(), NULL, &VS);hr = d3d11Device->CreatePixelShader(PS_Buffer->GetBufferPointer(), PS_Buffer->GetBufferSize(), NULL, &PS);///newhr = d3d11Device->CreatePixelShader(D2D_PS_Buffer->GetBufferPointer(), D2D_PS_Buffer->GetBufferSize(), NULL, &D2D_PS);hr = d3d11Device->CreateVertexShader(SKYMAP_VS_Buffer->GetBufferPointer(), SKYMAP_VS_Buffer->GetBufferSize(), NULL, &SKYMAP_VS);hr = d3d11Device->CreatePixelShader(SKYMAP_PS_Buffer->GetBufferPointer(), SKYMAP_PS_Buffer->GetBufferSize(), NULL, &SKYMAP_PS);///**************new**************///**************new**************//設(shè)置頂點(diǎn)和像素著色器d3d11DevCon->VSSetShader(VS, 0, 0);d3d11DevCon->PSSetShader(PS, 0, 0);///**************new**************light.pos = XMFLOAT3(0.0f, 7.0f, 0.0f);light.dir = XMFLOAT3(0.5f, 0.75f, -0.5f);light.range = 1000.0f;light.cone = 12.0f;light.att = XMFLOAT3(0.4f, 0.02f, 0.000f);light.ambient = XMFLOAT4(0.2f, 0.2f, 0.2f, 1.0f);light.diffuse = XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f);//Create the Input Layout//創(chuàng)建輸入布局d3d11Device->CreateInputLayout(layout, numElements, VS_Buffer->GetBufferPointer(),VS_Buffer->GetBufferSize(), &vertLayout);//設(shè)置輸入布局d3d11DevCon->IASetInputLayout(vertLayout);//設(shè)置圖元拓?fù)鋎3d11DevCon->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);//創(chuàng)建視口D3D11_VIEWPORT viewport;ZeroMemory(&viewport, sizeof(D3D11_VIEWPORT));viewport.TopLeftX = 0;viewport.TopLeftY = 0;viewport.Width = Width;viewport.Height = Height;viewport.MinDepth = 0.0f;viewport.MaxDepth = 1.0f;//設(shè)置視口d3d11DevCon->RSSetViewports(1, &viewport);//創(chuàng)建緩沖用來發(fā)送到效果文件的cbufferD3D11_BUFFER_DESC cbbd;ZeroMemory(&cbbd, sizeof(D3D11_BUFFER_DESC));cbbd.Usage = D3D11_USAGE_DEFAULT;cbbd.ByteWidth = sizeof(cbPerObject);cbbd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;cbbd.CPUAccessFlags = 0;cbbd.MiscFlags = 0;hr = d3d11Device->CreateBuffer(&cbbd, NULL, &cbPerObjectBuffer);//創(chuàng)建緩沖用于每幀發(fā)送cbuffer到著色器文件ZeroMemory(&cbbd, sizeof(D3D11_BUFFER_DESC));cbbd.Usage = D3D11_USAGE_DEFAULT;cbbd.ByteWidth = sizeof(cbPerFrame);cbbd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;cbbd.CPUAccessFlags = 0;cbbd.MiscFlags = 0;d3d11Device->CreateBuffer(&cbbd, NULL, &cbPerFrameBuffer);//相機(jī)信息//相機(jī)信息camPosition = XMVectorSet( 0.0f, 5.0f, -8.0f, 0.0f );//camPosition = XMVectorSet(0.0f, 0.0f, -0.5f, 0.0f);camTarget = XMVectorSet( 0.0f, 0.5f, 0.0f, 0.0f );camUp = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f);//設(shè)置視圖矩陣camView = XMMatrixLookAtLH(camPosition, camTarget, camUp);//設(shè)置投影矩陣camProjection = XMMatrixPerspectiveFovLH(0.4f*3.14f, (float)Width / Height, 1.0f, 1000.0f);D3D11_BLEND_DESC blendDesc;ZeroMemory( &blendDesc, sizeof(blendDesc) );D3D11_RENDER_TARGET_BLEND_DESC rtbd;ZeroMemory( &rtbd, sizeof(rtbd) );rtbd.BlendEnable = true;rtbd.SrcBlend = D3D11_BLEND_SRC_COLOR;///**************new**************rtbd.DestBlend = D3D11_BLEND_INV_SRC_ALPHA;///**************new**************rtbd.BlendOp = D3D11_BLEND_OP_ADD;rtbd.SrcBlendAlpha = D3D11_BLEND_ONE;rtbd.DestBlendAlpha = D3D11_BLEND_ZERO;rtbd.BlendOpAlpha = D3D11_BLEND_OP_ADD;rtbd.RenderTargetWriteMask = D3D10_COLOR_WRITE_ENABLE_ALL;blendDesc.AlphaToCoverageEnable = false;blendDesc.RenderTarget[0] = rtbd;d3d11Device->CreateBlendState(&blendDesc, &d2dTransparency);///**************new**************ZeroMemory( &rtbd, sizeof(rtbd) );rtbd.BlendEnable = true;rtbd.SrcBlend = D3D11_BLEND_INV_SRC_ALPHA;rtbd.DestBlend = D3D11_BLEND_SRC_ALPHA;rtbd.BlendOp = D3D11_BLEND_OP_ADD;rtbd.SrcBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;rtbd.DestBlendAlpha = D3D11_BLEND_SRC_ALPHA;rtbd.BlendOpAlpha = D3D11_BLEND_OP_ADD;rtbd.RenderTargetWriteMask = D3D10_COLOR_WRITE_ENABLE_ALL;blendDesc.AlphaToCoverageEnable = false;blendDesc.RenderTarget[0] = rtbd;d3d11Device->CreateBlendState(&blendDesc, &Transparency);///**************new**************//加載圖像紋理//hr = //#if 1 // hr = D3DX11CreateShaderResourceViewFromFile(d3d11Device, L"grass.jpg", // NULL, NULL, &CubesTexture, NULL); #if 1///**************new**************//告訴D3D我們正在加載一個(gè)立方體紋理D3DX11_IMAGE_LOAD_INFO loadSMInfo;loadSMInfo.MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;//加載紋理ID3D11Texture2D* SMTexture = 0;hr = D3DX11CreateTextureFromFile(d3d11Device, L"skymap.dds",&loadSMInfo, 0, (ID3D11Resource**)&SMTexture, 0);//創(chuàng)建紋理描述符D3D11_TEXTURE2D_DESC SMTextureDesc;SMTexture->GetDesc(&SMTextureDesc);//告訴D3D我們有一個(gè)立方體紋理,它是一個(gè)2D紋理的數(shù)組D3D11_SHADER_RESOURCE_VIEW_DESC SMViewDesc;SMViewDesc.Format = SMTextureDesc.Format;SMViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;SMViewDesc.TextureCube.MipLevels = SMTextureDesc.MipLevels;SMViewDesc.TextureCube.MostDetailedMip = 0;//創(chuàng)建資源視圖hr = d3d11Device->CreateShaderResourceView(SMTexture, &SMViewDesc, &smrv);///**************new************** #endif//配置采樣狀態(tài)D3D11_SAMPLER_DESC sampDesc;ZeroMemory(&sampDesc, sizeof(sampDesc));sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;sampDesc.MinLOD = 0;sampDesc.MaxLOD = D3D11_FLOAT32_MAX;//創(chuàng)建采樣狀態(tài)hr = d3d11Device->CreateSamplerState(&sampDesc, &CubesTexSamplerState);//d3d11Device->CreateBlendState(&blendDesc, &Transparency);//創(chuàng)建逆時(shí)針和順時(shí)針狀態(tài)D3D11_RASTERIZER_DESC cmdesc;ZeroMemory(&cmdesc, sizeof(D3D11_RASTERIZER_DESC));cmdesc.FillMode = D3D11_FILL_SOLID;cmdesc.CullMode = D3D11_CULL_BACK;cmdesc.FrontCounterClockwise = true;hr = d3d11Device->CreateRasterizerState(&cmdesc, &CCWcullMode);cmdesc.FrontCounterClockwise = false;hr = d3d11Device->CreateRasterizerState(&cmdesc, &CWcullMode); #if 1///**************new**************cmdesc.CullMode = D3D11_CULL_NONE;hr = d3d11Device->CreateRasterizerState(&cmdesc, &RSCullNone);D3D11_DEPTH_STENCIL_DESC dssDesc;ZeroMemory(&dssDesc, sizeof(D3D11_DEPTH_STENCIL_DESC));dssDesc.DepthEnable = true;dssDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;dssDesc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;d3d11Device->CreateDepthStencilState(&dssDesc, &DSLessEqual);///**************new************** #endifreturn true; }///**************new************** void StartTimer() {LARGE_INTEGER frequencyCount;QueryPerformanceFrequency(&frequencyCount);countsPerSecond = double(frequencyCount.QuadPart);QueryPerformanceCounter(&frequencyCount);CounterStart = frequencyCount.QuadPart; }double GetTime() {LARGE_INTEGER currentTime;QueryPerformanceCounter(¤tTime);return double(currentTime.QuadPart-CounterStart)/countsPerSecond; }double GetFrameTime() {LARGE_INTEGER currentTime;__int64 tickCount;QueryPerformanceCounter(¤tTime);tickCount = currentTime.QuadPart-frameTimeOld;frameTimeOld = currentTime.QuadPart;if(tickCount < 0.0f)tickCount = 0.0f;return float(tickCount)/countsPerSecond; } ///**************new**************///**************new************** void UpdateScene(double time)///**************new************** //void UpdateScene() {//Reset cube1World // groundWorld = XMMatrixIdentity();//Define cube1's world space matrix///**************new************** // Scale = XMMatrixScaling( 500.0f, 10.0f, 500.0f ); // Translation = XMMatrixTranslation( 0.0f, 10.0f, 0.0f );//Set cube1's world space using the transformations // groundWorld = Scale * Translation;//復(fù)位球面世界sphereWorld = XMMatrixIdentity();//Define sphereWorld's world space matrixScale = XMMatrixScaling( 5.0f, 5.0f, 5.0f );//Make sure the sphere is always centered around cameraTranslation = XMMatrixTranslation( XMVectorGetX(camPosition), XMVectorGetY(camPosition), XMVectorGetZ(camPosition) );//Set sphereWorld's world space using the transformationssphereWorld = Scale * Translation;///**************new**************meshWorld = XMMatrixIdentity();//Define cube1's world space matrixRotation = XMMatrixRotationY(3.14f);Scale = XMMatrixScaling( 1.0f, 1.0f, 1.0f );Translation = XMMatrixTranslation( 0.0f, 0.0f, 0.0f );meshWorld = Rotation * Scale * Translation;///**************new**************///**************new************** // light.pos.x = XMVectorGetX(camPosition); // light.pos.y = XMVectorGetY(camPosition); // light.pos.z = XMVectorGetZ(camPosition);// light.dir.x = XMVectorGetX(camTarget) - light.pos.x; // light.dir.y = XMVectorGetY(camTarget) - light.pos.y; // light.dir.z = XMVectorGetZ(camTarget) - light.pos.z;///**************new************** }///**************new************** void RenderText(std::wstring text, int inInt) //void RenderText(std::wstring text) {//釋放D3D11設(shè)備d3d11DevCon->PSSetShader(D2D_PS, 0, 0);keyedMutex11->ReleaseSync(0);//使用D3D10.1設(shè)備keyedMutex10->AcquireSync(0, 5);//繪制D2D內(nèi)容D2DRenderTarget->BeginDraw();//清空D2D背景色D2DRenderTarget->Clear(D2D1::ColorF(0.0f, 0.0f, 0.0f, 0.0f));//創(chuàng)建字符串std::wostringstream printString;///**************new**************printString << text << inInt;// printString << text;///**************new**************printText = printString.str();//設(shè)置字體顏色D2D1_COLOR_F FontColor = D2D1::ColorF(1.0f, 1.0f, 1.0f, 1.0f);//設(shè)置D2D繪制要用到的畫筆顏色Brush->SetColor(FontColor);//創(chuàng)建D2D渲染區(qū)域D2D1_RECT_F layoutRect = D2D1::RectF(0, 0, Width, Height);//繪制文本D2DRenderTarget->DrawText(printText.c_str(),wcslen(printText.c_str()),TextFormat,layoutRect,Brush);D2DRenderTarget->EndDraw();//釋放D3D10.1設(shè)備keyedMutex10->ReleaseSync(1);//使用D3D11設(shè)備keyedMutex11->AcquireSync(1, 5);//使用著色器資源表示d2d渲染目標(biāo)來創(chuàng)建一個(gè)矩形紋理,該矩形是被渲染進(jìn)屏幕空間的。使用α混合以便整個(gè)D2D//渲染目標(biāo)的背景為不可見的,且只有使用D2D繪制的東西才可見(文本)。//為D2D渲染目標(biāo)紋理對(duì)象設(shè)置混合狀態(tài)d3d11DevCon->OMSetBlendState(d2dTransparency, NULL, 0xffffffff);//Set d2d's pixel shader so lighting calculations are not done// d3d11DevCon->PSSetShader(D2D_PS, 0, 0);//設(shè)置d2d索引緩沖d3d11DevCon->IASetIndexBuffer(d2dIndexBuffer, DXGI_FORMAT_R32_UINT, 0);//設(shè)置d2d頂點(diǎn)緩沖UINT stride = sizeof(Vertex);UINT offset = 0;d3d11DevCon->IASetVertexBuffers(0, 1, &d2dVertBuffer, &stride, &offset);WVP = XMMatrixIdentity();///new // cbPerObj.World = XMMatrixTranspose(WVP);cbPerObj.WVP = XMMatrixTranspose(WVP);d3d11DevCon->UpdateSubresource(cbPerObjectBuffer, 0, NULL, &cbPerObj, 0, 0);d3d11DevCon->VSSetConstantBuffers(0, 1, &cbPerObjectBuffer);d3d11DevCon->PSSetShaderResources(0, 1, &d2dTexture);d3d11DevCon->PSSetSamplers(0, 1, &CubesTexSamplerState);d3d11DevCon->RSSetState(CWcullMode);//畫第二個(gè)立方體d3d11DevCon->DrawIndexed(6, 0, 0);}void DrawScene() {//將更新的顏色填充后緩沖 // D3DXCOLOR bgColor(red, green, blue, 1.0f);float bgColor[4] = { 0.1f, 0.1f, 0.1f, 1.0f };d3d11DevCon->ClearRenderTargetView(renderTargetView, bgColor);//刷新深度模板視圖d3d11DevCon->ClearDepthStencilView(depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);//newconstbuffPerFrame.light = light;d3d11DevCon->UpdateSubresource(cbPerFrameBuffer, 0, NULL, &constbuffPerFrame, 0, 0);d3d11DevCon->PSSetConstantBuffers(0, 1, &cbPerFrameBuffer);//復(fù)位頂點(diǎn)和像素著色器 // d3d11DevCon->VSSetShader(VS, 0, 0); // d3d11DevCon->PSSetShader(PS, 0, 0);//使能默認(rèn)光柵化狀態(tài) // d3d11DevCon->RSSetState(NULL);//繪制使用背面裁剪的對(duì)象//關(guān)閉背面裁剪// d3d11DevCon->RSSetState(noCull);d3d11DevCon->OMSetRenderTargets( 1, &renderTargetView, depthStencilView );d3d11DevCon->OMSetBlendState(0, 0, 0xffffffff);d3d11DevCon->VSSetShader(VS, 0, 0);d3d11DevCon->PSSetShader(PS, 0, 0);//Set the cubes index buffer//設(shè)置立方體的索引緩沖 // d3d11DevCon->IASetIndexBuffer(squareIndexBuffer, DXGI_FORMAT_R32_UINT, 0);//設(shè)置立方體的頂點(diǎn)緩沖UINT stride = sizeof(Vertex);UINT offset = 0; // d3d11DevCon->IASetVertexBuffers(0, 1, &squareVertBuffer, &stride, &offset);//設(shè)置WVP矩陣并將它送到效果文件中的常量緩沖中 // WVP = groundWorld * camView * camProjection; // cbPerObj.WVP = XMMatrixTranspose(WVP); // cbPerObj.World = XMMatrixTranspose(groundWorld); // d3d11DevCon->UpdateSubresource( cbPerObjectBuffer, 0, NULL, &cbPerObj, 0, 0 ); // d3d11DevCon->VSSetConstantBuffers( 0, 1, &cbPerObjectBuffer ); // d3d11DevCon->PSSetShaderResources( 0, 1, &CubesTexture ); // d3d11DevCon->PSSetSamplers( 0, 1, &CubesTexSamplerState ); // // d3d11DevCon->RSSetState(CCWcullMode); // d3d11DevCon->DrawIndexed( 6, 0, 0 );///**************new**************//繪制我們模型的非透明子集for(int i = 0; i < meshSubsets; ++i){//設(shè)置地面索引緩沖d3d11DevCon->IASetIndexBuffer( meshIndexBuff, DXGI_FORMAT_R32_UINT, 0);//設(shè)置地面頂點(diǎn)緩沖d3d11DevCon->IASetVertexBuffers( 0, 1, &meshVertBuff, &stride, &offset );//設(shè)置WVP矩陣并發(fā)送它到效果文件中的常量緩沖中WVP = meshWorld * camView * camProjection;cbPerObj.WVP = XMMatrixTranspose(WVP); cbPerObj.World = XMMatrixTranspose(meshWorld); cbPerObj.difColor = material[meshSubsetTexture[i]].difColor;cbPerObj.hasTexture = material[meshSubsetTexture[i]].hasTexture;///**************new**************cbPerObj.hasNormMap = material[meshSubsetTexture[i]].hasNormMap;///**************new**************d3d11DevCon->UpdateSubresource( cbPerObjectBuffer, 0, NULL, &cbPerObj, 0, 0 );d3d11DevCon->VSSetConstantBuffers( 0, 1, &cbPerObjectBuffer );d3d11DevCon->PSSetConstantBuffers( 1, 1, &cbPerObjectBuffer );if(material[meshSubsetTexture[i]].hasTexture)d3d11DevCon->PSSetShaderResources( 0, 1, &meshSRV[material[meshSubsetTexture[i]].texArrayIndex] );///**************new**************if(material[meshSubsetTexture[i]].hasNormMap)d3d11DevCon->PSSetShaderResources( 1, 1, &meshSRV[material[meshSubsetTexture[i]].normMapTexArrayIndex] );///**************new**************d3d11DevCon->PSSetSamplers( 0, 1, &CubesTexSamplerState );d3d11DevCon->RSSetState(RSCullNone);int indexStart = meshSubsetIndexStart[i];int indexDrawAmount = meshSubsetIndexStart[i+1] - meshSubsetIndexStart[i];if(!material[meshSubsetTexture[i]].transparent)d3d11DevCon->DrawIndexed( indexDrawAmount, indexStart, 0 );}///**************new**************/繪制天空的球面////設(shè)置球面的索引緩沖d3d11DevCon->IASetIndexBuffer( sphereIndexBuffer, DXGI_FORMAT_R32_UINT, 0);//設(shè)置球面的頂點(diǎn)緩沖d3d11DevCon->IASetVertexBuffers( 0, 1, &sphereVertBuffer, &stride, &offset );//設(shè)置WVP矩陣并將它發(fā)送給效果文件中的常量緩沖WVP = sphereWorld * camView * camProjection;cbPerObj.WVP = XMMatrixTranspose(WVP); cbPerObj.World = XMMatrixTranspose(sphereWorld); d3d11DevCon->UpdateSubresource( cbPerObjectBuffer, 0, NULL, &cbPerObj, 0, 0 );d3d11DevCon->VSSetConstantBuffers( 0, 1, &cbPerObjectBuffer );//發(fā)送我們的天空貼圖資源視圖到像素著色器d3d11DevCon->PSSetShaderResources( 0, 1, &smrv );d3d11DevCon->PSSetSamplers( 0, 1, &CubesTexSamplerState );//設(shè)置新的VS和PS著色器d3d11DevCon->VSSetShader(SKYMAP_VS, 0, 0);d3d11DevCon->PSSetShader(SKYMAP_PS, 0, 0);//設(shè)置新的深度模板和RS狀態(tài)d3d11DevCon->OMSetDepthStencilState(DSLessEqual, 0);d3d11DevCon->RSSetState(RSCullNone);d3d11DevCon->DrawIndexed( NumSphereFaces * 3, 0, 0 ); //設(shè)置默認(rèn)的VS,PS著色器和深度模板狀態(tài)d3d11DevCon->VSSetShader(VS, 0, 0);d3d11DevCon->PSSetShader(PS, 0, 0);d3d11DevCon->OMSetDepthStencilState(NULL, 0);///**************new************** //繪制我們的模型的透明度子集//設(shè)置我們的混合狀態(tài)d3d11DevCon->OMSetBlendState(Transparency, NULL, 0xffffffff);for(int i = 0; i < meshSubsets; ++i){//設(shè)置地面索引緩沖d3d11DevCon->IASetIndexBuffer( meshIndexBuff, DXGI_FORMAT_R32_UINT, 0);//設(shè)置地面頂點(diǎn)緩沖d3d11DevCon->IASetVertexBuffers( 0, 1, &meshVertBuff, &stride, &offset );//設(shè)置WVP矩陣并將它發(fā)送給效果文件中的常量緩沖中WVP = meshWorld * camView * camProjection;cbPerObj.WVP = XMMatrixTranspose(WVP); cbPerObj.World = XMMatrixTranspose(meshWorld); cbPerObj.difColor = material[meshSubsetTexture[i]].difColor;cbPerObj.hasTexture = material[meshSubsetTexture[i]].hasTexture;///**************new**************cbPerObj.hasNormMap = material[meshSubsetTexture[i]].hasNormMap;///**************new**************d3d11DevCon->UpdateSubresource( cbPerObjectBuffer, 0, NULL, &cbPerObj, 0, 0 );d3d11DevCon->VSSetConstantBuffers( 0, 1, &cbPerObjectBuffer );d3d11DevCon->PSSetConstantBuffers( 1, 1, &cbPerObjectBuffer );if(material[meshSubsetTexture[i]].hasTexture)d3d11DevCon->PSSetShaderResources( 0, 1, &meshSRV[material[meshSubsetTexture[i]].texArrayIndex] );///**************new**************if(material[meshSubsetTexture[i]].hasNormMap)d3d11DevCon->PSSetShaderResources( 1, 1, &meshSRV[material[meshSubsetTexture[i]].normMapTexArrayIndex] );///**************new**************d3d11DevCon->PSSetSamplers( 0, 1, &CubesTexSamplerState );d3d11DevCon->RSSetState(RSCullNone);int indexStart = meshSubsetIndexStart[i];int indexDrawAmount = meshSubsetIndexStart[i+1] - meshSubsetIndexStart[i];if(material[meshSubsetTexture[i]].transparent)d3d11DevCon->DrawIndexed( indexDrawAmount, indexStart, 0 );}///**************new************** RenderText(L"FPS: ", fps);//Present the backbuffer to the screenSwapChain->Present(0, 0); }int messageloop(){MSG msg;ZeroMemory(&msg, sizeof(MSG));//清除結(jié)構(gòu)體被設(shè)為NULL。while (true){//使用PeekMessage()檢查是否有消息傳進(jìn)來/*LPMSG lpMsg 消息結(jié)構(gòu)體的指針*HWND hWnd 發(fā)送消息的窗口句柄。若設(shè)為NULL,那么它會(huì)從當(dāng)前程序中接收來自任何一個(gè)窗口的消息*UINT wMsgFilterMin 指定消息范圍內(nèi)第一個(gè)要檢查的消息的值。若wMsgFilterMin和wMsgFilterMax都設(shè)為0,那么PeekMessage將會(huì)檢查素有的消息*UINT wMsgFilterMax 指定消息范圍內(nèi)最后一個(gè)要檢測(cè)的消息的值*UINT wRemoveMsg 指定消息的處理方式。若設(shè)置為PM_REMOVE,則在讀取之后會(huì)被刪除*/if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)){if (msg.message == WM_QUIT)break;//若消息為窗口消息,則解析并分發(fā)它。TranslateMessage()將會(huì)讓窗口做一些解析,類似鍵盤的虛擬鍵值轉(zhuǎn)換到字符形式。//而DispatchMessage()則發(fā)送消息到窗口過程WndProc。TranslateMessage(&msg);DispatchMessage(&msg);}else //若沒有窗口消息,則運(yùn)行游戲///**************new**************{frameCount++;if(GetTime() > 1.0f){fps = frameCount;frameCount = 0;StartTimer();} frameTime = GetFrameTime();///**************new**************DetectInput(frameTime);///**************new**************UpdateScene(frameTime);DrawScene();}}return msg.wParam; }//窗口消息處理函數(shù) //HWND hwnd 獲取消息的窗口句柄 //UINT msg 消息的內(nèi)容 /* *WM_ACTIVE 當(dāng)窗口激活時(shí)發(fā)送的消息 *WM_CLOSE 當(dāng)窗口關(guān)閉時(shí)發(fā)送的消息 *WM_CREATE 當(dāng)窗口創(chuàng)建時(shí)發(fā)送的消息 *WM_DESTROY 當(dāng)窗口銷毀時(shí)發(fā)送的消息 */ //wParam和lParam時(shí)消息的額外信息。使用wParam來檢測(cè)鍵盤輸入消息 LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) {// 這是事件檢測(cè)消息的地方,若escape鍵被按下,會(huì)顯示一個(gè)消息框,詢問是否真的退出。若點(diǎn)擊yes,則程序關(guān)閉。若不點(diǎn)擊,則消息框關(guān)閉。若消息包含WM_DESTROY// 則意味著窗口正在被銷毀,返回0并且程序關(guān)閉switch (msg){case WM_KEYDOWN:if (wParam == VK_ESCAPE){if (MessageBox(0, L"Are you sure you want to exit?",L"Really?", MB_YESNO | MB_ICONASTERISK) == IDYES){DestroyWindow(hwnd);}return 0;}break;case WM_DESTROY:PostQuitMessage(0);return 0;break;default:break;}//調(diào)用默認(rèn)窗口過程函數(shù)return DefWindowProc(hwnd,msg,wParam,lParam); }


效果:




參考網(wǎng)址



===》修訂20171212

總結(jié)

以上是生活随笔為你收集整理的D3D11 法线贴图(凹凸贴图)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

67194成是人免费无码 | 国产性猛交╳xxx乱大交 国产精品久久久久久无码 欧洲欧美人成视频在线 | 成人精品一区二区三区中文字幕 | 亚洲欧美日韩成人高清在线一区 | 精品久久久久久人妻无码中文字幕 | 强奷人妻日本中文字幕 | 久久99精品久久久久久动态图 | 女人被男人躁得好爽免费视频 | 亚洲の无码国产の无码影院 | 鲁鲁鲁爽爽爽在线视频观看 | 无码精品国产va在线观看dvd | 亚洲第一网站男人都懂 | 国产精品办公室沙发 | 色婷婷欧美在线播放内射 | 2020最新国产自产精品 | 在线观看国产午夜福利片 | 久久亚洲中文字幕无码 | 亚洲一区二区三区在线观看网站 | 无码毛片视频一区二区本码 | 国内精品久久久久久中文字幕 | 九九热爱视频精品 | 一本色道久久综合亚洲精品不卡 | 少妇一晚三次一区二区三区 | 无码精品人妻一区二区三区av | 欧美xxxxx精品 | 乱人伦人妻中文字幕无码久久网 | 国产精品亚洲五月天高清 | 日韩欧美成人免费观看 | 7777奇米四色成人眼影 | 女人色极品影院 | 国产内射老熟女aaaa | 亚洲 激情 小说 另类 欧美 | 亚洲精品一区三区三区在线观看 | 久久精品人人做人人综合 | 久热国产vs视频在线观看 | 六十路熟妇乱子伦 | 三上悠亚人妻中文字幕在线 | 亚洲乱码日产精品bd | 亚洲自偷精品视频自拍 | 亚洲精品中文字幕乱码 | 人人妻人人澡人人爽欧美精品 | 2019nv天堂香蕉在线观看 | 夜夜影院未满十八勿进 | 蜜桃av蜜臀av色欲av麻 999久久久国产精品消防器材 | 女人被爽到呻吟gif动态图视看 | 中文字幕无码免费久久9一区9 | 2019nv天堂香蕉在线观看 | 无遮挡国产高潮视频免费观看 | 男女下面进入的视频免费午夜 | 国产精品无码一区二区桃花视频 | 欧美阿v高清资源不卡在线播放 | 美女极度色诱视频国产 | 国产精品亚洲lv粉色 | av香港经典三级级 在线 | 国色天香社区在线视频 | 熟女少妇人妻中文字幕 | 欧美亚洲国产一区二区三区 | 国内少妇偷人精品视频免费 | 蜜臀aⅴ国产精品久久久国产老师 | 国产在线无码精品电影网 | 欧美xxxx黑人又粗又长 | 啦啦啦www在线观看免费视频 | 人妻少妇被猛烈进入中文字幕 | 漂亮人妻洗澡被公强 日日躁 | 成人精品视频一区二区三区尤物 | 秋霞成人午夜鲁丝一区二区三区 | 欧美 丝袜 自拍 制服 另类 | 免费网站看v片在线18禁无码 | 精品水蜜桃久久久久久久 | 亚洲精品久久久久久久久久久 | 成人影院yy111111在线观看 | 久久久精品456亚洲影院 | 久久精品国产日本波多野结衣 | 午夜丰满少妇性开放视频 | 激情人妻另类人妻伦 | 无码成人精品区在线观看 | 国产激情无码一区二区 | 精品久久久中文字幕人妻 | 夜夜躁日日躁狠狠久久av | 亚洲精品成人福利网站 | 在线天堂新版最新版在线8 | 无码乱肉视频免费大全合集 | 亚洲精品久久久久久一区二区 | 一二三四社区在线中文视频 | 久久久久久久久888 | 中文字幕乱码中文乱码51精品 | 国产乡下妇女做爰 | 又大又黄又粗又爽的免费视频 | 久久综合激激的五月天 | 精品国产av色一区二区深夜久久 | 亚洲国产一区二区三区在线观看 | 嫩b人妻精品一区二区三区 | 无码福利日韩神码福利片 | 欧美日韩一区二区免费视频 | 无遮无挡爽爽免费视频 | 日本一区二区三区免费播放 | 亚洲色欲久久久综合网东京热 | 久久精品女人天堂av免费观看 | 精品国产一区二区三区四区 | 成在人线av无码免费 | 高潮毛片无遮挡高清免费 | 亚洲精品欧美二区三区中文字幕 | 香港三级日本三级妇三级 | 中文字幕乱码中文乱码51精品 | 少妇性l交大片 | 在线观看国产午夜福利片 | 欧美丰满少妇xxxx性 | 国产精华av午夜在线观看 | 成人三级无码视频在线观看 | 捆绑白丝粉色jk震动捧喷白浆 | 亚洲精品无码人妻无码 | 99久久久无码国产精品免费 | 亚洲国产高清在线观看视频 | 无码国内精品人妻少妇 | 欧美丰满熟妇xxxx性ppx人交 | 欧美丰满熟妇xxxx性ppx人交 | 久久zyz资源站无码中文动漫 | 日韩av无码一区二区三区 | 狠狠色噜噜狠狠狠7777奇米 | 六十路熟妇乱子伦 | 久久视频在线观看精品 | 婷婷色婷婷开心五月四房播播 | 人妻人人添人妻人人爱 | 久久97精品久久久久久久不卡 | 亚洲色欲久久久综合网东京热 | 久久精品丝袜高跟鞋 | 强辱丰满人妻hd中文字幕 | 国产亚洲精品久久久久久 | 漂亮人妻洗澡被公强 日日躁 | 中文字幕日产无线码一区 | 377p欧洲日本亚洲大胆 | 18无码粉嫩小泬无套在线观看 | 国产成人无码av在线影院 | 欧美人与动性行为视频 | 无码人妻久久一区二区三区不卡 | 亚洲精品久久久久久一区二区 | 国内精品人妻无码久久久影院 | 国产人成高清在线视频99最全资源 | 国产精品久久久一区二区三区 | 亚洲欧美精品伊人久久 | 综合网日日天干夜夜久久 | 成人性做爰aaa片免费看不忠 | 亚洲欧洲中文日韩av乱码 | 国产在线aaa片一区二区99 | 丰腴饱满的极品熟妇 | 日韩视频 中文字幕 视频一区 | 国产午夜视频在线观看 | 亚洲a无码综合a国产av中文 | 亚洲区欧美区综合区自拍区 | 国内精品人妻无码久久久影院蜜桃 | 欧美阿v高清资源不卡在线播放 | 久久久久久久久888 | 中文字幕无码热在线视频 | 乱码av麻豆丝袜熟女系列 | 国产又爽又黄又刺激的视频 | 乱人伦中文视频在线观看 | 一本久久a久久精品vr综合 | 国产成人无码av片在线观看不卡 | 亚洲精品中文字幕 | 久久亚洲日韩精品一区二区三区 | 亚洲欧洲无卡二区视頻 | 无码人妻出轨黑人中文字幕 | 风流少妇按摩来高潮 | 亚洲一区av无码专区在线观看 | 亚洲 激情 小说 另类 欧美 | 扒开双腿疯狂进出爽爽爽视频 | 网友自拍区视频精品 | 国产凸凹视频一区二区 | 精品国产成人一区二区三区 | 熟妇人妻中文av无码 | 免费人成网站视频在线观看 | 久久久久久九九精品久 | 国产无av码在线观看 | 亚洲国产日韩a在线播放 | 欧美 日韩 人妻 高清 中文 | 99久久精品国产一区二区蜜芽 | 国产成人精品视频ⅴa片软件竹菊 | 精品熟女少妇av免费观看 | 帮老师解开蕾丝奶罩吸乳网站 | 日韩少妇内射免费播放 | 人妻无码αv中文字幕久久琪琪布 | 国产乱人伦app精品久久 国产在线无码精品电影网 国产国产精品人在线视 | 一二三四在线观看免费视频 | 国产卡一卡二卡三 | 久久国语露脸国产精品电影 | 99国产精品白浆在线观看免费 | aa片在线观看视频在线播放 | 亚洲 另类 在线 欧美 制服 | 欧美自拍另类欧美综合图片区 | 国产高清av在线播放 | 国产一区二区三区日韩精品 | 丰满少妇弄高潮了www | 国产精品视频免费播放 | 久久国产自偷自偷免费一区调 | 人妻互换免费中文字幕 | 欧美三级a做爰在线观看 | 欧美日韩色另类综合 | 一本一道久久综合久久 | 国产精品久久久一区二区三区 | 网友自拍区视频精品 | 狠狠综合久久久久综合网 | 亚洲成av人影院在线观看 | 一个人看的www免费视频在线观看 | 人人妻人人澡人人爽精品欧美 | 骚片av蜜桃精品一区 | 牲欲强的熟妇农村老妇女视频 | 国产无套内射久久久国产 | 免费无码午夜福利片69 | 18无码粉嫩小泬无套在线观看 | 十八禁视频网站在线观看 | 欧美性黑人极品hd | 久久无码中文字幕免费影院蜜桃 | 欧美野外疯狂做受xxxx高潮 | 欧美精品无码一区二区三区 | 在线播放亚洲第一字幕 | 欧美性生交活xxxxxdddd | 国产成人精品无码播放 | 成在人线av无码免观看麻豆 | 欧美日本日韩 | 一本久久a久久精品vr综合 | 成人三级无码视频在线观看 | 国产精品久久久av久久久 | 亚洲中文字幕无码中字 | 亚洲日韩一区二区三区 | 亚洲性无码av中文字幕 | 一本精品99久久精品77 | 国产超级va在线观看视频 | 成人毛片一区二区 | 999久久久国产精品消防器材 | 日产精品高潮呻吟av久久 | 日本一区二区三区免费高清 | 一本精品99久久精品77 | 午夜精品久久久内射近拍高清 | 日本在线高清不卡免费播放 | 国产三级久久久精品麻豆三级 | 日韩 欧美 动漫 国产 制服 | 在线天堂新版最新版在线8 | 亚洲第一无码av无码专区 | 久久久婷婷五月亚洲97号色 | 欧美丰满熟妇xxxx性ppx人交 | 欧洲熟妇精品视频 | 东京热无码av男人的天堂 | 国产乱码精品一品二品 | 人人妻人人澡人人爽欧美一区九九 | 国产精品丝袜黑色高跟鞋 | 日韩少妇白浆无码系列 | 中文毛片无遮挡高清免费 | √8天堂资源地址中文在线 | 天天躁日日躁狠狠躁免费麻豆 | 午夜男女很黄的视频 | 国产精品美女久久久 | 美女极度色诱视频国产 | 欧美人与牲动交xxxx | 超碰97人人射妻 | 亚洲а∨天堂久久精品2021 | 在线a亚洲视频播放在线观看 | 东京热一精品无码av | 无码av最新清无码专区吞精 | 国产亚洲视频中文字幕97精品 | 丰满人妻翻云覆雨呻吟视频 | 免费男性肉肉影院 | 色欲综合久久中文字幕网 | 欧美日韩一区二区三区自拍 | 天天摸天天透天天添 | 欧美午夜特黄aaaaaa片 | 久9re热视频这里只有精品 | 国精产品一品二品国精品69xx | 少妇无套内谢久久久久 | 亚洲人成网站免费播放 | 精品国产成人一区二区三区 | 国产无套内射久久久国产 | 精品一区二区不卡无码av | 少妇被粗大的猛进出69影院 | 曰本女人与公拘交酡免费视频 | 国产黑色丝袜在线播放 | 十八禁真人啪啪免费网站 | 亚洲 日韩 欧美 成人 在线观看 | 久久无码人妻影院 | 久青草影院在线观看国产 | 欧美色就是色 | 99国产欧美久久久精品 | 久久zyz资源站无码中文动漫 | 精品aⅴ一区二区三区 | 强辱丰满人妻hd中文字幕 | 久久99国产综合精品 | 久9re热视频这里只有精品 | 国产人妻精品一区二区三区不卡 | 国产精品igao视频网 | av香港经典三级级 在线 | 亚洲日本一区二区三区在线 | 一本久久伊人热热精品中文字幕 | 一本色道久久综合狠狠躁 | 久久久精品人妻久久影视 | 亚洲日韩av一区二区三区中文 | 国产精品亚洲а∨无码播放麻豆 | 夜夜躁日日躁狠狠久久av | 最近中文2019字幕第二页 | 亚洲国产一区二区三区在线观看 | 欧美国产亚洲日韩在线二区 | 久久综合给久久狠狠97色 | 丰满岳乱妇在线观看中字无码 | 久久伊人色av天堂九九小黄鸭 | 国产精品怡红院永久免费 | 亚洲精品国偷拍自产在线观看蜜桃 | 国产成人无码av在线影院 | 免费无码的av片在线观看 | 精品欧洲av无码一区二区三区 | 亚洲日韩精品欧美一区二区 | 久久国产精品萌白酱免费 | 国产一区二区三区四区五区加勒比 | 啦啦啦www在线观看免费视频 | 两性色午夜免费视频 | 俺去俺来也www色官网 | 亚洲国产精品无码久久久久高潮 | 国产在线一区二区三区四区五区 | 女高中生第一次破苞av | 性做久久久久久久久 | 国产av人人夜夜澡人人爽麻豆 | 牛和人交xxxx欧美 | 国产女主播喷水视频在线观看 | av无码久久久久不卡免费网站 | 精品国精品国产自在久国产87 | 亚洲中文字幕成人无码 | 国产在线无码精品电影网 | 成人免费视频一区二区 | 色综合久久88色综合天天 | 熟妇女人妻丰满少妇中文字幕 | 人人妻人人澡人人爽欧美精品 | 日本熟妇大屁股人妻 | 欧美放荡的少妇 | 双乳奶水饱满少妇呻吟 | 99久久婷婷国产综合精品青草免费 | 爆乳一区二区三区无码 | 在线精品亚洲一区二区 | 色情久久久av熟女人妻网站 | 国产亚av手机在线观看 | 中国女人内谢69xxxxxa片 | 日日摸夜夜摸狠狠摸婷婷 | 亚拍精品一区二区三区探花 | 少妇性俱乐部纵欲狂欢电影 | 亚无码乱人伦一区二区 | 久久久精品国产sm最大网站 | 久久久久av无码免费网 | 久久精品中文字幕一区 | 欧美丰满老熟妇xxxxx性 | 欧美兽交xxxx×视频 | 久久久国产一区二区三区 | 麻豆md0077饥渴少妇 | 女人被男人爽到呻吟的视频 | 精品无码成人片一区二区98 | 欧美乱妇无乱码大黄a片 | 水蜜桃色314在线观看 | 国产精品亚洲一区二区三区喷水 | 色诱久久久久综合网ywww | 亚洲a无码综合a国产av中文 | 特大黑人娇小亚洲女 | 丝袜美腿亚洲一区二区 | 久久久久久久人妻无码中文字幕爆 | 日本爽爽爽爽爽爽在线观看免 | 日日碰狠狠躁久久躁蜜桃 | 成人综合网亚洲伊人 | 婷婷丁香五月天综合东京热 | 成人免费视频视频在线观看 免费 | 国产熟妇高潮叫床视频播放 | 无码精品人妻一区二区三区av | 六十路熟妇乱子伦 | 少妇无码一区二区二三区 | 麻豆国产97在线 | 欧洲 | 亚洲国产精品美女久久久久 | 国产乱人伦av在线无码 | 免费人成在线视频无码 | 99在线 | 亚洲 | 女人被爽到呻吟gif动态图视看 | 中文字幕无码热在线视频 | 少妇性l交大片欧洲热妇乱xxx | 亚洲日韩av一区二区三区四区 | 亚洲精品一区国产 | 亚洲熟妇色xxxxx欧美老妇y | 午夜福利不卡在线视频 | 亚洲国产欧美在线成人 | 98国产精品综合一区二区三区 | 女人被男人爽到呻吟的视频 | 国产亚洲人成a在线v网站 | 色一情一乱一伦 | 久久五月精品中文字幕 | 国产真实夫妇视频 | 亚洲国产成人a精品不卡在线 | 国产乱人伦偷精品视频 | 欧美日韩久久久精品a片 | 美女张开腿让人桶 | 无码吃奶揉捏奶头高潮视频 | 88国产精品欧美一区二区三区 | 国产精华av午夜在线观看 | 中文字幕人成乱码熟女app | 又大又黄又粗又爽的免费视频 | 国产精品第一国产精品 | 国产人妖乱国产精品人妖 | 国产口爆吞精在线视频 | 性欧美大战久久久久久久 | 亚洲精品一区二区三区大桥未久 | 欧美亚洲国产一区二区三区 | 男女作爱免费网站 | 亚洲va欧美va天堂v国产综合 | 综合激情五月综合激情五月激情1 | 精品国产成人一区二区三区 | 国产99久久精品一区二区 | 欧美精品免费观看二区 | 久精品国产欧美亚洲色aⅴ大片 | 色欲av亚洲一区无码少妇 | 白嫩日本少妇做爰 | 久久精品国产99久久6动漫 | 在线精品亚洲一区二区 | 国产色精品久久人妻 | 日本熟妇人妻xxxxx人hd | aⅴ亚洲 日韩 色 图网站 播放 | 久久精品国产一区二区三区肥胖 | 中文久久乱码一区二区 | 国产精品国产自线拍免费软件 | 两性色午夜视频免费播放 | 成人一在线视频日韩国产 | 一本久道久久综合狠狠爱 | 天天拍夜夜添久久精品大 | 扒开双腿吃奶呻吟做受视频 | 人妻少妇精品视频专区 | 中文字幕人妻无码一夲道 | 99riav国产精品视频 | 97se亚洲精品一区 | av在线亚洲欧洲日产一区二区 | 日日摸日日碰夜夜爽av | 精品亚洲成av人在线观看 | 久久午夜无码鲁丝片午夜精品 | 无码帝国www无码专区色综合 | 亚洲国产精品无码久久久久高潮 | 俄罗斯老熟妇色xxxx | 国产真实夫妇视频 | 国产又粗又硬又大爽黄老大爷视 | 粗大的内捧猛烈进出视频 | 久久久久99精品国产片 | 国产精品丝袜黑色高跟鞋 | 久久久久久久人妻无码中文字幕爆 | 国产精品久久久久久无码 | 中文字幕av伊人av无码av | 国产精品igao视频网 | 欧美乱妇无乱码大黄a片 | 日韩亚洲欧美精品综合 | 亚洲欧美综合区丁香五月小说 | 欧美乱妇无乱码大黄a片 | 老司机亚洲精品影院 | 最近的中文字幕在线看视频 | 99久久精品午夜一区二区 | 国产莉萝无码av在线播放 | 无码中文字幕色专区 | 精品国产国产综合精品 | 无码午夜成人1000部免费视频 | 特黄特色大片免费播放器图片 | 国产精品第一区揄拍无码 | 永久免费精品精品永久-夜色 | 亚洲精品一区二区三区婷婷月 | 国产成人一区二区三区别 | 少妇性荡欲午夜性开放视频剧场 | 国产亚洲视频中文字幕97精品 | 久在线观看福利视频 | 亚洲一区二区三区四区 | 国产精品a成v人在线播放 | 18禁止看的免费污网站 | 国产精品内射视频免费 | 亚洲综合精品香蕉久久网 | 性啪啪chinese东北女人 | 国产成人无码专区 | 日本熟妇人妻xxxxx人hd | 亚洲乱亚洲乱妇50p | 国模大胆一区二区三区 | 性生交大片免费看l | 亚洲一区二区三区 | 免费网站看v片在线18禁无码 | 真人与拘做受免费视频 | 国产精品亚洲综合色区韩国 | 亚洲熟悉妇女xxx妇女av | 欧美日韩在线亚洲综合国产人 | 国产人妖乱国产精品人妖 | 强开小婷嫩苞又嫩又紧视频 | 中文字幕乱码亚洲无线三区 | 激情爆乳一区二区三区 | 精品国产一区二区三区av 性色 | 精品厕所偷拍各类美女tp嘘嘘 | 奇米影视7777久久精品人人爽 | 国产av一区二区三区最新精品 | 久久亚洲中文字幕无码 | 无码免费一区二区三区 | 美女毛片一区二区三区四区 | 精品久久久无码人妻字幂 | 国产精品亚洲五月天高清 | 欧美刺激性大交 | 无码人妻av免费一区二区三区 | 久久久久久久久蜜桃 | 亚洲性无码av中文字幕 | 国产免费久久久久久无码 | 亚洲天堂2017无码 | 国产偷自视频区视频 | 亚洲va中文字幕无码久久不卡 | 男人扒开女人内裤强吻桶进去 | 一本久道久久综合婷婷五月 | 欧洲精品码一区二区三区免费看 | 亚洲の无码国产の无码步美 | 中文字幕av无码一区二区三区电影 | 欧美成人午夜精品久久久 | 亚洲中文字幕乱码av波多ji | 日本一区二区三区免费高清 | 亚洲热妇无码av在线播放 | 色婷婷av一区二区三区之红樱桃 | 久久99精品国产.久久久久 | 亚洲自偷精品视频自拍 | 少妇被粗大的猛进出69影院 | 老太婆性杂交欧美肥老太 | 成人aaa片一区国产精品 | 精品久久久久香蕉网 | 国内揄拍国内精品人妻 | 大色综合色综合网站 | 国产在线一区二区三区四区五区 | 欧美国产日韩亚洲中文 | 国产免费久久久久久无码 | 亚洲综合伊人久久大杳蕉 | 免费看少妇作爱视频 | 久久综合网欧美色妞网 | 人妻体内射精一区二区三四 | 日日噜噜噜噜夜夜爽亚洲精品 | 亚洲综合另类小说色区 | 欧美成人高清在线播放 | 97色伦图片97综合影院 | 婷婷六月久久综合丁香 | 一本无码人妻在中文字幕免费 | 高潮喷水的毛片 | 乱人伦人妻中文字幕无码 | 久久这里只有精品视频9 | 99久久精品国产一区二区蜜芽 | 装睡被陌生人摸出水好爽 | 国产99久久精品一区二区 | 欧美真人作爱免费视频 | 无遮挡国产高潮视频免费观看 | 中文字幕人妻无码一区二区三区 | 精品亚洲韩国一区二区三区 | 强奷人妻日本中文字幕 | 国产亚洲精品久久久久久国模美 | 国产精品多人p群无码 | 国精产品一区二区三区 | 欧美丰满熟妇xxxx性ppx人交 | 狠狠色色综合网站 | 亚洲中文字幕成人无码 | 国产精品无码一区二区桃花视频 | 狠狠色噜噜狠狠狠7777奇米 | 性生交大片免费看女人按摩摩 | 人妻尝试又大又粗久久 | 成人动漫在线观看 | 亚洲国产精品毛片av不卡在线 | 亚洲精品国产第一综合99久久 | 亚洲中文字幕乱码av波多ji | 99精品国产综合久久久久五月天 | 免费视频欧美无人区码 | 日韩精品一区二区av在线 | 呦交小u女精品视频 | 一本久道久久综合婷婷五月 | 国产精品-区区久久久狼 | 日本熟妇大屁股人妻 | 久久精品人人做人人综合试看 | 日韩无码专区 | 亚洲色大成网站www | 色情久久久av熟女人妻网站 | 亚洲欧美日韩综合久久久 | 色一情一乱一伦 | 欧美大屁股xxxxhd黑色 | 国内精品人妻无码久久久影院蜜桃 | 夜先锋av资源网站 | 女人被男人爽到呻吟的视频 | 午夜性刺激在线视频免费 | 影音先锋中文字幕无码 | 精品厕所偷拍各类美女tp嘘嘘 | 日本大乳高潮视频在线观看 | 国产成人精品三级麻豆 | 日本大香伊一区二区三区 | 亚洲无人区午夜福利码高清完整版 | 国产xxx69麻豆国语对白 | 精品欧洲av无码一区二区三区 | 伊人久久大香线蕉av一区二区 | 欧美人与动性行为视频 | 2020久久超碰国产精品最新 | 日韩精品无码免费一区二区三区 | 成熟妇人a片免费看网站 | 成人女人看片免费视频放人 | 成人欧美一区二区三区 | 色欲av亚洲一区无码少妇 | 欧美大屁股xxxxhd黑色 | 免费国产成人高清在线观看网站 | 久久精品视频在线看15 | 日日天日日夜日日摸 | 在线精品国产一区二区三区 | 一本久道高清无码视频 | 无码人妻黑人中文字幕 | 国产农村乱对白刺激视频 | 午夜熟女插插xx免费视频 | 夜先锋av资源网站 | 亚洲精品国产a久久久久久 | 国产精品99爱免费视频 | 人妻少妇精品久久 | 丁香啪啪综合成人亚洲 | 久久精品成人欧美大片 | 日产国产精品亚洲系列 | 日本又色又爽又黄的a片18禁 | 夜夜影院未满十八勿进 | 精品成在人线av无码免费看 | www国产亚洲精品久久网站 | 久久久国产一区二区三区 | 亚洲中文字幕久久无码 | 丁香啪啪综合成人亚洲 | a片免费视频在线观看 | 色综合久久久无码网中文 | 澳门永久av免费网站 | 色一情一乱一伦一视频免费看 | 无码人中文字幕 | 国产精品久久久av久久久 | 高潮喷水的毛片 | 三级4级全黄60分钟 | 人妻熟女一区 | 国产人妻精品一区二区三区 | 欧美性生交xxxxx久久久 | 国产亚洲欧美日韩亚洲中文色 | 香港三级日本三级妇三级 | 色婷婷香蕉在线一区二区 | 无码人妻精品一区二区三区不卡 | 精品成人av一区二区三区 | 又大又紧又粉嫩18p少妇 | 国产亚洲精品久久久久久久久动漫 | 成人免费无码大片a毛片 | 色综合久久88色综合天天 | 欧美熟妇另类久久久久久多毛 | 亚洲人成网站在线播放942 | 青青久在线视频免费观看 | 色欲av亚洲一区无码少妇 | 国产成人精品无码播放 | 一区二区传媒有限公司 | 国内综合精品午夜久久资源 | 亚洲男人av天堂午夜在 | 高中生自慰www网站 | а√天堂www在线天堂小说 | 色五月五月丁香亚洲综合网 | 国产精品人人妻人人爽 | 性欧美牲交在线视频 | 国精产品一品二品国精品69xx | 亚洲区欧美区综合区自拍区 | 亚洲人亚洲人成电影网站色 | 亚洲欧美精品aaaaaa片 | 人妻有码中文字幕在线 | 国产人成高清在线视频99最全资源 | 精品厕所偷拍各类美女tp嘘嘘 | 亚洲国产高清在线观看视频 | 日韩精品久久久肉伦网站 | 亚洲娇小与黑人巨大交 | 亚洲国产高清在线观看视频 | 中文字幕人妻无码一区二区三区 | 国产猛烈高潮尖叫视频免费 | 99在线 | 亚洲 | 日韩少妇白浆无码系列 | 久久精品国产大片免费观看 | 欧美日韩一区二区三区自拍 | 久久人人爽人人爽人人片av高清 | 成年美女黄网站色大免费视频 | 丰满少妇弄高潮了www | 无码精品国产va在线观看dvd | 国产在线精品一区二区三区直播 | 亚洲小说春色综合另类 | 欧美精品一区二区精品久久 | 欧美黑人乱大交 | 97精品国产97久久久久久免费 | 国产亚洲人成a在线v网站 | 老头边吃奶边弄进去呻吟 | 人妻体内射精一区二区三四 | 久久久中文字幕日本无吗 | 中文字幕日产无线码一区 | 日本精品高清一区二区 | 波多野42部无码喷潮在线 | 午夜无码人妻av大片色欲 | 亚洲中文字幕无码中文字在线 | 国产人成高清在线视频99最全资源 | 妺妺窝人体色www在线小说 | 久激情内射婷内射蜜桃人妖 | 色狠狠av一区二区三区 | 欧美自拍另类欧美综合图片区 | 中文字幕色婷婷在线视频 | 国产人成高清在线视频99最全资源 | 丰满人妻一区二区三区免费视频 | 色 综合 欧美 亚洲 国产 | 欧美日韩综合一区二区三区 | 国产又粗又硬又大爽黄老大爷视 | 亚洲国产av精品一区二区蜜芽 | 露脸叫床粗话东北少妇 | 荫蒂添的好舒服视频囗交 | 激情内射亚州一区二区三区爱妻 | 亚洲 日韩 欧美 成人 在线观看 | 男人的天堂2018无码 | 成人女人看片免费视频放人 | 5858s亚洲色大成网站www | 久久99精品久久久久久动态图 | 国产香蕉尹人视频在线 | 性生交片免费无码看人 | 欧美午夜特黄aaaaaa片 | 久久综合久久自在自线精品自 | 日日夜夜撸啊撸 | 真人与拘做受免费视频 | 中文字幕av无码一区二区三区电影 | 波多野结衣aⅴ在线 | 国产深夜福利视频在线 | 国产精品对白交换视频 | 精品无码av一区二区三区 | 最近免费中文字幕中文高清百度 | 少妇无码av无码专区在线观看 | 国产乱人伦app精品久久 国产在线无码精品电影网 国产国产精品人在线视 | 在线观看欧美一区二区三区 | 国产卡一卡二卡三 | 又粗又大又硬毛片免费看 | 在线精品亚洲一区二区 | 日日摸日日碰夜夜爽av | 久久久久成人精品免费播放动漫 | 亚洲熟妇自偷自拍另类 | 亚洲成a人一区二区三区 | 国产av人人夜夜澡人人爽麻豆 | 丰满肥臀大屁股熟妇激情视频 | 亚洲成a人片在线观看日本 | 色综合久久久久综合一本到桃花网 | 自拍偷自拍亚洲精品被多人伦好爽 | 亚洲熟悉妇女xxx妇女av | 亚洲色偷偷男人的天堂 | 成人无码影片精品久久久 | 亚洲国产精品久久久久久 | 日日橹狠狠爱欧美视频 | 色一情一乱一伦一区二区三欧美 | 麻豆国产丝袜白领秘书在线观看 | 精品人妻人人做人人爽夜夜爽 | 狂野欧美激情性xxxx | 纯爱无遮挡h肉动漫在线播放 | 午夜精品一区二区三区在线观看 | 免费看男女做好爽好硬视频 | 国产亚洲精品久久久ai换 | 狠狠噜狠狠狠狠丁香五月 | 荡女精品导航 | 久久久成人毛片无码 | 精品一区二区三区无码免费视频 | 久久精品人人做人人综合试看 | 人妻互换免费中文字幕 | 亚洲精品鲁一鲁一区二区三区 | 亚洲国产精品成人久久蜜臀 | 欧美 亚洲 国产 另类 | 亚洲成av人片在线观看无码不卡 | 99久久精品无码一区二区毛片 | 少妇激情av一区二区 | 特黄特色大片免费播放器图片 | 国内揄拍国内精品少妇国语 | 夜夜夜高潮夜夜爽夜夜爰爰 | 日韩av无码一区二区三区 | 无码人妻丰满熟妇区五十路百度 | 日韩欧美成人免费观看 | 亚洲乱码国产乱码精品精 | 亚洲乱码国产乱码精品精 | 日本乱人伦片中文三区 | 一本无码人妻在中文字幕免费 | 欧美35页视频在线观看 | 欧洲极品少妇 | 国产乱人伦av在线无码 | 日韩精品无码免费一区二区三区 | 亚洲成色www久久网站 | 亚洲中文字幕成人无码 | 国产免费久久久久久无码 | 日本一卡2卡3卡4卡无卡免费网站 国产一区二区三区影院 | 日日碰狠狠丁香久燥 | 77777熟女视频在线观看 а天堂中文在线官网 | 曰韩少妇内射免费播放 | 国产人妻精品午夜福利免费 | 老子影院午夜伦不卡 | 亚洲欧洲日本无在线码 | 日本精品久久久久中文字幕 | 国产成人一区二区三区在线观看 | 久久久久av无码免费网 | 毛片内射-百度 | 装睡被陌生人摸出水好爽 | 波多野42部无码喷潮在线 | 精品国产青草久久久久福利 | 日本大香伊一区二区三区 | 久久久久久九九精品久 | 亚洲人成人无码网www国产 | 精品 日韩 国产 欧美 视频 | 久9re热视频这里只有精品 | 少妇高潮一区二区三区99 | 国产亚洲欧美在线专区 | 1000部夫妻午夜免费 | 亚洲国产精品无码久久久久高潮 | 国产熟妇另类久久久久 | 精品夜夜澡人妻无码av蜜桃 | 无码乱肉视频免费大全合集 | 九九在线中文字幕无码 | 无遮无挡爽爽免费视频 | 久久99久久99精品中文字幕 | 丰满人妻翻云覆雨呻吟视频 | 国产办公室秘书无码精品99 | 麻花豆传媒剧国产免费mv在线 | 99久久婷婷国产综合精品青草免费 | 亚洲欧美日韩综合久久久 | 午夜不卡av免费 一本久久a久久精品vr综合 | 高清无码午夜福利视频 | 天堂一区人妻无码 | 亚洲gv猛男gv无码男同 | 天天躁夜夜躁狠狠是什么心态 | 欧美人妻一区二区三区 | 国产免费久久精品国产传媒 | 午夜熟女插插xx免费视频 | 国产亚洲人成a在线v网站 | 无码一区二区三区在线观看 | 久久久精品成人免费观看 | 美女黄网站人色视频免费国产 | 色综合久久88色综合天天 | 国产区女主播在线观看 | 日本又色又爽又黄的a片18禁 | 无码纯肉视频在线观看 | 免费中文字幕日韩欧美 | 乌克兰少妇xxxx做受 | 中文字幕日产无线码一区 | 天海翼激烈高潮到腰振不止 | 婷婷丁香五月天综合东京热 | 小鲜肉自慰网站xnxx | 99久久精品午夜一区二区 | 亚洲精品国产a久久久久久 | 呦交小u女精品视频 | 18无码粉嫩小泬无套在线观看 | 国产成人一区二区三区在线观看 | 亚洲一区av无码专区在线观看 | 久久综合香蕉国产蜜臀av | 乱中年女人伦av三区 | 少女韩国电视剧在线观看完整 | 国产明星裸体无码xxxx视频 | 国产精品无码永久免费888 | 国产色在线 | 国产 | 欧美性生交活xxxxxdddd | 午夜福利试看120秒体验区 | 久久人人爽人人爽人人片av高清 | 日韩亚洲欧美精品综合 | 强开小婷嫩苞又嫩又紧视频 | 日本饥渴人妻欲求不满 | 欧洲欧美人成视频在线 | 国产亚洲精品久久久久久久久动漫 | 美女极度色诱视频国产 | 国产乱人无码伦av在线a | 久久精品无码一区二区三区 | 久久久精品人妻久久影视 | 日日麻批免费40分钟无码 | 久久精品成人欧美大片 | 男女爱爱好爽视频免费看 | 狠狠色噜噜狠狠狠狠7777米奇 | 丝袜美腿亚洲一区二区 | 国产偷自视频区视频 | 内射白嫩少妇超碰 | 国产热a欧美热a在线视频 | 国产97在线 | 亚洲 | 在线а√天堂中文官网 | 国产亚洲tv在线观看 | 51国偷自产一区二区三区 | 亚洲七七久久桃花影院 | 免费看男女做好爽好硬视频 | 小泽玛莉亚一区二区视频在线 | 亚洲色偷偷偷综合网 | 国产精品久久久久久亚洲影视内衣 | 伊人色综合久久天天小片 | 国产黄在线观看免费观看不卡 | 色欲av亚洲一区无码少妇 | 人人澡人人妻人人爽人人蜜桃 | 中国女人内谢69xxxxxa片 | 精品无码国产一区二区三区av | 一区二区三区乱码在线 | 欧洲 | a在线亚洲男人的天堂 | 亚欧洲精品在线视频免费观看 | 97夜夜澡人人双人人人喊 | 免费人成在线视频无码 | 亚洲 高清 成人 动漫 | 国产人妻久久精品二区三区老狼 | 扒开双腿吃奶呻吟做受视频 | 久9re热视频这里只有精品 | 日韩欧美群交p片內射中文 | 国产精品久久久久久无码 | 久久久成人毛片无码 | 欧美激情一区二区三区成人 | 国产激情无码一区二区app | 国产激情精品一区二区三区 | 亚洲精品久久久久中文第一幕 | 国产高清av在线播放 | 四虎影视成人永久免费观看视频 | 人妻少妇精品久久 | 玩弄人妻少妇500系列视频 | 青草视频在线播放 | 日韩亚洲欧美中文高清在线 | 野狼第一精品社区 | 久久国产精品萌白酱免费 | 国产精品无码久久av | 久久zyz资源站无码中文动漫 | 午夜理论片yy44880影院 | a在线观看免费网站大全 | 中文字幕+乱码+中文字幕一区 | 亚洲成色www久久网站 | 午夜时刻免费入口 | 成年美女黄网站色大免费视频 | 国内精品九九久久久精品 | 精品无码国产自产拍在线观看蜜 | 亚洲精品午夜国产va久久成人 | 婷婷六月久久综合丁香 | 亚洲日韩中文字幕在线播放 | 国产猛烈高潮尖叫视频免费 | 精品久久综合1区2区3区激情 | 无码精品国产va在线观看dvd | 久精品国产欧美亚洲色aⅴ大片 | 噜噜噜亚洲色成人网站 | 久久精品无码一区二区三区 | 西西人体www44rt大胆高清 | 无码播放一区二区三区 | 精品夜夜澡人妻无码av蜜桃 | 国产无遮挡又黄又爽免费视频 | 中文字幕日韩精品一区二区三区 | 国产精品无码一区二区三区不卡 | 蜜桃av抽搐高潮一区二区 | 国产午夜无码视频在线观看 | 国产人妻人伦精品 | 国精产品一品二品国精品69xx | 欧美性生交xxxxx久久久 | 国产真人无遮挡作爱免费视频 | 国产乡下妇女做爰 | 精品国产av色一区二区深夜久久 | 国产极品美女高潮无套在线观看 | 欧美 亚洲 国产 另类 | 曰韩少妇内射免费播放 | 久久久精品人妻久久影视 | 在线播放亚洲第一字幕 | 久久久久免费精品国产 | 欧美人妻一区二区三区 | 久久午夜无码鲁丝片 | 性色欲情网站iwww九文堂 | 俺去俺来也www色官网 | 少妇无码一区二区二三区 | av小次郎收藏 | 亚洲中文无码av永久不收费 | 色综合久久久久综合一本到桃花网 | 久激情内射婷内射蜜桃人妖 | 东京无码熟妇人妻av在线网址 | v一区无码内射国产 | 亚洲日韩乱码中文无码蜜桃臀网站 | 97人妻精品一区二区三区 | 中文字幕av无码一区二区三区电影 | 国产超碰人人爽人人做人人添 | 国产精品va在线播放 | 亚洲国产综合无码一区 | yw尤物av无码国产在线观看 | 亚洲天堂2017无码中文 | 国产精品无套呻吟在线 | 午夜福利一区二区三区在线观看 | 东京热男人av天堂 | 亚洲熟妇自偷自拍另类 | 欧美日本日韩 | 亚洲欧洲中文日韩av乱码 | 欧美老妇与禽交 | 人人妻人人澡人人爽欧美一区九九 | 67194成是人免费无码 | 精品无码一区二区三区的天堂 | 强伦人妻一区二区三区视频18 | 麻豆国产人妻欲求不满谁演的 | 丰满少妇女裸体bbw | 图片小说视频一区二区 | 日本xxxx色视频在线观看免费 | 国产av无码专区亚洲awww | 精品无人区无码乱码毛片国产 | 日本精品人妻无码77777 天堂一区人妻无码 | a片免费视频在线观看 | 国产香蕉尹人综合在线观看 | 欧美激情内射喷水高潮 | 丝袜足控一区二区三区 | 日本免费一区二区三区最新 | 国产乱人偷精品人妻a片 | 亚洲国产成人av在线观看 | 少妇人妻偷人精品无码视频 | 精品国产成人一区二区三区 | 人妻人人添人妻人人爱 | 精品久久综合1区2区3区激情 | 初尝人妻少妇中文字幕 | 99久久精品国产一区二区蜜芽 | 久精品国产欧美亚洲色aⅴ大片 | 少妇太爽了在线观看 | 牲欲强的熟妇农村老妇女 | 97资源共享在线视频 | 精品午夜福利在线观看 | 日韩av无码中文无码电影 | 中文字幕无码免费久久99 | 精品国偷自产在线视频 | 成熟人妻av无码专区 | 九一九色国产 | 午夜精品久久久内射近拍高清 | 欧美国产日产一区二区 | 精品无码国产自产拍在线观看蜜 | 亚洲精品久久久久久久久久久 | 亚洲欧美日韩国产精品一区二区 | 国产一区二区三区日韩精品 | 中文字幕无码热在线视频 | 国精品人妻无码一区二区三区蜜柚 | 久久视频在线观看精品 | 对白脏话肉麻粗话av | 国产口爆吞精在线视频 | 久久久中文字幕日本无吗 | 久久久久国色av免费观看性色 | 少妇无码一区二区二三区 | 国产舌乚八伦偷品w中 | 无码帝国www无码专区色综合 | 欧美野外疯狂做受xxxx高潮 | 国产97人人超碰caoprom | 亚洲一区二区三区播放 | 97无码免费人妻超级碰碰夜夜 | 精品一区二区不卡无码av | 久久综合九色综合97网 | 国产精品人妻一区二区三区四 | 亚洲成a人一区二区三区 | 任你躁国产自任一区二区三区 | 亚洲无人区一区二区三区 | 麻豆果冻传媒2021精品传媒一区下载 | av无码电影一区二区三区 | 国产电影无码午夜在线播放 | 六月丁香婷婷色狠狠久久 | 波多野结衣一区二区三区av免费 | 丰满人妻精品国产99aⅴ | 男人扒开女人内裤强吻桶进去 | 国产精品va在线播放 | 理论片87福利理论电影 | 丰满妇女强制高潮18xxxx | 欧美日本免费一区二区三区 | 男女下面进入的视频免费午夜 | 亚洲国产精品一区二区第一页 | 欧美老妇交乱视频在线观看 | 日韩人妻无码一区二区三区久久99 | 欧美老熟妇乱xxxxx | 国内少妇偷人精品视频免费 | 丰满人妻翻云覆雨呻吟视频 | 成人亚洲精品久久久久软件 | 无码午夜成人1000部免费视频 | 国产特级毛片aaaaaaa高清 | 大肉大捧一进一出视频出来呀 | 东京一本一道一二三区 | 国产精品永久免费视频 | 国产精品久久国产精品99 | 国内揄拍国内精品人妻 | 久9re热视频这里只有精品 | 亚洲性无码av中文字幕 | 色五月丁香五月综合五月 | 强开小婷嫩苞又嫩又紧视频 | 在线观看国产午夜福利片 | 天堂亚洲免费视频 | 久久精品99久久香蕉国产色戒 | 夜夜影院未满十八勿进 | 国产乱人无码伦av在线a | 国产成人无码区免费内射一片色欲 | 午夜肉伦伦影院 | 亚洲精品www久久久 | 国产激情精品一区二区三区 | 无码av免费一区二区三区试看 | 丰满诱人的人妻3 | a在线观看免费网站大全 | 特黄特色大片免费播放器图片 | 免费播放一区二区三区 | 欧美丰满熟妇xxxx性ppx人交 | 青春草在线视频免费观看 | 在线播放无码字幕亚洲 | 在线亚洲高清揄拍自拍一品区 | 亚洲成av人片天堂网无码】 | 无套内谢的新婚少妇国语播放 | 久久99热只有频精品8 | 国产农村妇女aaaaa视频 撕开奶罩揉吮奶头视频 | 中国女人内谢69xxxxxa片 | 午夜福利一区二区三区在线观看 | 国产精品福利视频导航 | 色老头在线一区二区三区 | 日本一卡2卡3卡4卡无卡免费网站 国产一区二区三区影院 | 久久天天躁夜夜躁狠狠 | 精品乱子伦一区二区三区 | 性欧美videos高清精品 | 国产午夜福利100集发布 | 中文字幕+乱码+中文字幕一区 | 亚洲综合无码久久精品综合 | 强辱丰满人妻hd中文字幕 | 成熟人妻av无码专区 | 午夜精品久久久内射近拍高清 | 亚洲精品成人av在线 | 国产成人无码a区在线观看视频app | 日本乱人伦片中文三区 | 日日摸天天摸爽爽狠狠97 | 人人妻人人澡人人爽人人精品浪潮 | 人妻中文无码久热丝袜 | 88国产精品欧美一区二区三区 | 国产偷自视频区视频 | 欧美freesex黑人又粗又大 | 欧美丰满熟妇xxxx性ppx人交 | 国产精品18久久久久久麻辣 | 免费观看又污又黄的网站 | 久久久中文字幕日本无吗 | 精品国产一区二区三区四区在线看 | 老司机亚洲精品影院无码 | 丝袜美腿亚洲一区二区 | 欧美精品国产综合久久 | 扒开双腿吃奶呻吟做受视频 | 一本色道久久综合亚洲精品不卡 | 岛国片人妻三上悠亚 | 亚洲精品鲁一鲁一区二区三区 | 国产电影无码午夜在线播放 | 香蕉久久久久久av成人 | 色综合久久久久综合一本到桃花网 | 久久久久99精品国产片 | 亚洲精品久久久久久久久久久 | 中文字幕无码人妻少妇免费 | 高清不卡一区二区三区 | 亚洲人亚洲人成电影网站色 | 十八禁视频网站在线观看 | 人人澡人人妻人人爽人人蜜桃 | 欧美日韩久久久精品a片 | 国产激情无码一区二区app | 久久午夜无码鲁丝片秋霞 | 精品日本一区二区三区在线观看 | 国产特级毛片aaaaaaa高清 | 99久久精品国产一区二区蜜芽 | 真人与拘做受免费视频一 | 国产av一区二区三区最新精品 | 国产精品理论片在线观看 | 亚洲精品国偷拍自产在线麻豆 | 亚洲无人区午夜福利码高清完整版 | 日韩人妻系列无码专区 | 无套内谢的新婚少妇国语播放 | 久久精品国产99精品亚洲 | 一本色道久久综合狠狠躁 | 国产乱人偷精品人妻a片 | 精品夜夜澡人妻无码av蜜桃 | 最近免费中文字幕中文高清百度 | 国产精品久久久久无码av色戒 | 99久久人妻精品免费一区 | 好男人社区资源 | 99精品视频在线观看免费 | 久久综合网欧美色妞网 | 亚洲人成网站在线播放942 | 婷婷综合久久中文字幕蜜桃三电影 | 无码精品国产va在线观看dvd | 理论片87福利理论电影 | 国产亲子乱弄免费视频 | 色偷偷av老熟女 久久精品人妻少妇一区二区三区 | 久久www免费人成人片 | 亚洲成色www久久网站 | 青青青爽视频在线观看 | 精品偷拍一区二区三区在线看 | 在教室伦流澡到高潮hnp视频 | 在线播放亚洲第一字幕 | 国产精品毛多多水多 | 中文字幕 亚洲精品 第1页 | 亚洲中文字幕成人无码 | 久久伊人色av天堂九九小黄鸭 | 人妻体内射精一区二区三四 | 久久天天躁狠狠躁夜夜免费观看 | 成人无码视频免费播放 | 色综合久久久久综合一本到桃花网 | 人人澡人人妻人人爽人人蜜桃 | 国产真实伦对白全集 | 熟妇人妻无码xxx视频 | 无码一区二区三区在线观看 | 麻豆国产人妻欲求不满谁演的 | 国内精品人妻无码久久久影院 | 亚洲一区二区观看播放 | 日韩欧美群交p片內射中文 | 国产成人无码a区在线观看视频app | 久久婷婷五月综合色国产香蕉 | 精品无人区无码乱码毛片国产 | 乱码av麻豆丝袜熟女系列 | 日韩成人一区二区三区在线观看 | aa片在线观看视频在线播放 | 欧美精品免费观看二区 | 色综合久久88色综合天天 | 亚洲爆乳精品无码一区二区三区 | 精品国产国产综合精品 | 伊在人天堂亚洲香蕉精品区 | 日日躁夜夜躁狠狠躁 | 麻豆国产人妻欲求不满谁演的 | 午夜不卡av免费 一本久久a久久精品vr综合 | 日本大乳高潮视频在线观看 | √8天堂资源地址中文在线 | 人妻体内射精一区二区三四 | 婷婷色婷婷开心五月四房播播 | 人人妻人人澡人人爽人人精品 | 亚洲娇小与黑人巨大交 | 国产特级毛片aaaaaa高潮流水 | 波多野结衣一区二区三区av免费 | 亚洲中文字幕在线观看 | 日日摸夜夜摸狠狠摸婷婷 | 国产真人无遮挡作爱免费视频 | 国产av一区二区精品久久凹凸 | 欧洲vodafone精品性 | 国产成人精品视频ⅴa片软件竹菊 | 久久久婷婷五月亚洲97号色 | 欧美人与牲动交xxxx | 成人影院yy111111在线观看 | 久久精品中文闷骚内射 | 国产亚洲人成在线播放 | 乱人伦人妻中文字幕无码久久网 | 国产香蕉尹人视频在线 | 熟妇人妻中文av无码 | 人妻熟女一区 | 国产莉萝无码av在线播放 | 亚洲色在线无码国产精品不卡 | 欧美精品一区二区精品久久 | 欧美性色19p | 精品偷拍一区二区三区在线看 | 内射欧美老妇wbb | 精品国产一区二区三区四区 | 1000部啪啪未满十八勿入下载 | 国产亚洲精品久久久闺蜜 | 亚洲七七久久桃花影院 | 国产人妖乱国产精品人妖 | 午夜无码人妻av大片色欲 | www国产亚洲精品久久久日本 | 色综合久久88色综合天天 | 久久精品国产一区二区三区 | 88国产精品欧美一区二区三区 | 国产av久久久久精东av | 亚洲第一网站男人都懂 | 午夜福利不卡在线视频 | 久久www免费人成人片 | 少妇无套内谢久久久久 | 日日夜夜撸啊撸 | 又粗又大又硬又长又爽 | 最近中文2019字幕第二页 | 麻豆果冻传媒2021精品传媒一区下载 | 久久国产精品二国产精品 | 国产精品办公室沙发 | 清纯唯美经典一区二区 | 亚洲日韩一区二区 | 天堂а√在线地址中文在线 | 日欧一片内射va在线影院 | 国产精品久久久久影院嫩草 | 老熟妇乱子伦牲交视频 | 国产九九九九九九九a片 | 亚洲狠狠婷婷综合久久 | 成人一在线视频日韩国产 | 日本www一道久久久免费榴莲 | 中文无码精品a∨在线观看不卡 | 国产区女主播在线观看 | 国产人妻精品午夜福利免费 | 国产午夜亚洲精品不卡 | 丰满少妇女裸体bbw | 久久综合狠狠综合久久综合88 | 1000部夫妻午夜免费 | 欧美老熟妇乱xxxxx | 性生交大片免费看女人按摩摩 | 欧美老熟妇乱xxxxx | 无码国模国产在线观看 | 麻豆md0077饥渴少妇 | 女人高潮内射99精品 | 亚洲最大成人网站 | 色欲av亚洲一区无码少妇 | 精品国产一区av天美传媒 | 国产一区二区三区四区五区加勒比 | 日日噜噜噜噜夜夜爽亚洲精品 | 国产午夜手机精彩视频 | 成人av无码一区二区三区 | 中文字幕乱妇无码av在线 | 久久午夜无码鲁丝片午夜精品 | 男人和女人高潮免费网站 | 午夜成人1000部免费视频 | 久久综合色之久久综合 | 欧美日韩综合一区二区三区 | 中文字幕精品av一区二区五区 | 日韩精品一区二区av在线 | 亚洲精品国产精品乱码不卡 | 欧美国产日韩亚洲中文 | 国产偷抇久久精品a片69 | 久久 国产 尿 小便 嘘嘘 | 男人扒开女人内裤强吻桶进去 | а√资源新版在线天堂 | 亚洲国产精品毛片av不卡在线 | 在线а√天堂中文官网 | 中文无码伦av中文字幕 | 一本久久伊人热热精品中文字幕 | 四虎影视成人永久免费观看视频 | 日本丰满熟妇videos | 欧美精品无码一区二区三区 | 亚洲精品鲁一鲁一区二区三区 | 高潮毛片无遮挡高清免费视频 | 中文无码精品a∨在线观看不卡 | 丝袜人妻一区二区三区 | 丰满肥臀大屁股熟妇激情视频 | 小sao货水好多真紧h无码视频 | 无码纯肉视频在线观看 | 国产综合久久久久鬼色 | 好男人www社区 | 呦交小u女精品视频 | 在线精品国产一区二区三区 | 国产精品亚洲专区无码不卡 | 中文字幕无码免费久久9一区9 | 97精品人妻一区二区三区香蕉 | 国语精品一区二区三区 | 丰满岳乱妇在线观看中字无码 | 欧美真人作爱免费视频 | 国产高清av在线播放 | 国产人妻人伦精品1国产丝袜 | 亚拍精品一区二区三区探花 | 精品无码一区二区三区的天堂 | 中文亚洲成a人片在线观看 | 男女作爱免费网站 | 高潮毛片无遮挡高清免费 | 午夜福利试看120秒体验区 | 国产精品久久国产精品99 | 99久久精品无码一区二区毛片 | 国产精品嫩草久久久久 | 日本一区二区三区免费播放 | 国产精品18久久久久久麻辣 | 日韩精品乱码av一区二区 | 精品少妇爆乳无码av无码专区 | 亚洲精品一区二区三区在线观看 | 麻豆蜜桃av蜜臀av色欲av | 日本熟妇浓毛 | 午夜肉伦伦影院 | 成人亚洲精品久久久久 | 在线精品国产一区二区三区 | 97资源共享在线视频 | 中文字幕无码av波多野吉衣 | 美女扒开屁股让男人桶 | 玩弄少妇高潮ⅹxxxyw | 久久久久人妻一区精品色欧美 | 中文字幕 亚洲精品 第1页 | aⅴ在线视频男人的天堂 | 亚洲熟妇色xxxxx亚洲 | 亚洲成av人片在线观看无码不卡 | 国产精品亚洲lv粉色 | 亚洲色偷偷男人的天堂 | 装睡被陌生人摸出水好爽 | 国产真实夫妇视频 | 国产激情无码一区二区app | 久久精品国产亚洲精品 | 日日夜夜撸啊撸 | 丰满少妇人妻久久久久久 | 精品国精品国产自在久国产87 | 狠狠色噜噜狠狠狠狠7777米奇 | yw尤物av无码国产在线观看 | 午夜福利不卡在线视频 | 欧美日韩一区二区综合 | 国产sm调教视频在线观看 | 亚洲日韩av一区二区三区中文 | 午夜精品一区二区三区在线观看 | 久久zyz资源站无码中文动漫 | 久久久久久九九精品久 | 精品国产aⅴ无码一区二区 | 麻豆国产97在线 | 欧洲 | 精品国产一区二区三区四区在线看 | 日韩精品无码免费一区二区三区 | 无码人妻丰满熟妇区毛片18 | 国产偷国产偷精品高清尤物 | 久久国产精品二国产精品 | 国产综合久久久久鬼色 | 国产午夜福利100集发布 | 激情五月综合色婷婷一区二区 | 亚洲の无码国产の无码步美 | 久久国语露脸国产精品电影 | 国产精品理论片在线观看 | 波多野结衣乳巨码无在线观看 | 精品少妇爆乳无码av无码专区 | 东京热男人av天堂 | 亚洲va欧美va天堂v国产综合 | 妺妺窝人体色www在线小说 | 精品人妻人人做人人爽夜夜爽 | 国产成人无码a区在线观看视频app | 3d动漫精品啪啪一区二区中 | 牛和人交xxxx欧美 | 久久久久99精品国产片 | 99在线 | 亚洲 | 免费国产黄网站在线观看 | 国产精品-区区久久久狼 | 日日摸夜夜摸狠狠摸婷婷 | a在线亚洲男人的天堂 | 国产精品18久久久久久麻辣 | 国产成人无码av片在线观看不卡 | 88国产精品欧美一区二区三区 | 2019午夜福利不卡片在线 | 国产sm调教视频在线观看 | 国产乱码精品一品二品 | 俺去俺来也www色官网 | 成熟人妻av无码专区 | 国产情侣作爱视频免费观看 | 免费看少妇作爱视频 | 亚洲s色大片在线观看 | 成熟女人特级毛片www免费 | 国产成人精品久久亚洲高清不卡 | 性欧美大战久久久久久久 | 男女超爽视频免费播放 | 两性色午夜视频免费播放 | 精品少妇爆乳无码av无码专区 | 久久精品女人天堂av免费观看 | 中文字幕乱妇无码av在线 | 精品久久久久久人妻无码中文字幕 | 无码国产激情在线观看 | а√资源新版在线天堂 | 国内精品久久毛片一区二区 | 97夜夜澡人人双人人人喊 | 久久成人a毛片免费观看网站 | 狂野欧美性猛xxxx乱大交 | 97久久国产亚洲精品超碰热 | 久久97精品久久久久久久不卡 | 欧美变态另类xxxx | 国产精品久久久久久久影院 | 国产精品二区一区二区aⅴ污介绍 | а√资源新版在线天堂 | 国产成人人人97超碰超爽8 | 欧美人与善在线com | 爆乳一区二区三区无码 | 东北女人啪啪对白 | 日本丰满护士爆乳xxxx | 丰满岳乱妇在线观看中字无码 | 大屁股大乳丰满人妻 | 乱人伦人妻中文字幕无码 | 欧美日本免费一区二区三区 | 亚洲国产av美女网站 | 成人欧美一区二区三区黑人免费 | 少妇高潮一区二区三区99 | 人人妻人人澡人人爽欧美精品 | 精品乱码久久久久久久 | 天堂无码人妻精品一区二区三区 | 精品国产乱码久久久久乱码 | 蜜臀aⅴ国产精品久久久国产老师 | 在线а√天堂中文官网 | 国内精品九九久久久精品 | 国产精品自产拍在线观看 | 国产精品久久福利网站 | 亚洲七七久久桃花影院 | 久久精品国产日本波多野结衣 | 欧美自拍另类欧美综合图片区 | 六十路熟妇乱子伦 | 亚洲日韩av一区二区三区中文 | 欧美一区二区三区视频在线观看 | 国产精品久久久一区二区三区 | 国产办公室秘书无码精品99 | 18禁黄网站男男禁片免费观看 | 无码成人精品区在线观看 | 99久久婷婷国产综合精品青草免费 | 中文字幕人妻无码一区二区三区 | 天天爽夜夜爽夜夜爽 | 四虎永久在线精品免费网址 | 少妇高潮一区二区三区99 | 亚洲国产日韩a在线播放 | 亚洲欧美综合区丁香五月小说 | 在线欧美精品一区二区三区 | 狠狠色噜噜狠狠狠狠7777米奇 | 少妇无码吹潮 | 99久久精品国产一区二区蜜芽 | 精品无码国产自产拍在线观看蜜 | 亚洲 欧美 激情 小说 另类 | 欧美一区二区三区 | 性生交片免费无码看人 | 少妇高潮一区二区三区99 | 少妇高潮喷潮久久久影院 | 男女性色大片免费网站 | 男女下面进入的视频免费午夜 | 久久99精品国产.久久久久 | 露脸叫床粗话东北少妇 | 又粗又大又硬又长又爽 | 双乳奶水饱满少妇呻吟 | 丰满岳乱妇在线观看中字无码 | 中文字幕无线码 | 粉嫩少妇内射浓精videos | 爆乳一区二区三区无码 | 欧美丰满老熟妇xxxxx性 | 国产亚洲日韩欧美另类第八页 | 精品久久久久久亚洲精品 | 亚洲日韩精品欧美一区二区 | 人人澡人人妻人人爽人人蜜桃 | 中国大陆精品视频xxxx | 天天躁夜夜躁狠狠是什么心态 | 牲欲强的熟妇农村老妇女 | 久久99国产综合精品 | 国产亚av手机在线观看 | 亚洲一区二区三区偷拍女厕 | 麻花豆传媒剧国产免费mv在线 | 双乳奶水饱满少妇呻吟 | 欧美国产日韩久久mv | 国产人妻人伦精品1国产丝袜 | 一区二区传媒有限公司 | 无人区乱码一区二区三区 | 国产真实乱对白精彩久久 | 丰满岳乱妇在线观看中字无码 | 国产成人精品优优av | www国产亚洲精品久久网站 | 55夜色66夜色国产精品视频 | 日本在线高清不卡免费播放 | 内射白嫩少妇超碰 | 亚洲精品一区国产 | 青青青爽视频在线观看 | 国产人妖乱国产精品人妖 | 亚洲а∨天堂久久精品2021 | 欧美xxxxx精品 | 丝袜美腿亚洲一区二区 | 国产精品无套呻吟在线 | 2019午夜福利不卡片在线 | 人人妻在人人 | 亚洲无人区午夜福利码高清完整版 | 亚洲 欧美 激情 小说 另类 | 国产人妻精品午夜福利免费 | 日韩精品一区二区av在线 | 色一情一乱一伦一区二区三欧美 | 国产乱人无码伦av在线a | 精品人妻中文字幕有码在线 | 亚洲va欧美va天堂v国产综合 | 久久久精品国产sm最大网站 | 激情内射亚州一区二区三区爱妻 | av无码久久久久不卡免费网站 | 日日躁夜夜躁狠狠躁 | 人妻人人添人妻人人爱 | 无码精品人妻一区二区三区av | 99久久婷婷国产综合精品青草免费 | 国产香蕉尹人视频在线 | 国产精品嫩草久久久久 | 一本久久a久久精品亚洲 | 精品人妻人人做人人爽 | 性色欲网站人妻丰满中文久久不卡 | 亚洲综合无码久久精品综合 | 国产成人av免费观看 | 人人妻人人澡人人爽欧美一区九九 | 欧美xxxx黑人又粗又长 | 麻豆国产97在线 | 欧洲 | 免费播放一区二区三区 | 露脸叫床粗话东北少妇 | 男人的天堂2018无码 | 在线播放亚洲第一字幕 | 亚洲欧美日韩成人高清在线一区 | 亚洲成熟女人毛毛耸耸多 | 亚洲国产欧美在线成人 | 又大又硬又爽免费视频 | 秋霞特色aa大片 | 小泽玛莉亚一区二区视频在线 | 天堂在线观看www | 我要看www免费看插插视频 | 亚洲国产欧美日韩精品一区二区三区 | 国产成人无码av片在线观看不卡 | 久久精品国产一区二区三区 | 日日摸夜夜摸狠狠摸婷婷 | 国产精品久久久久影院嫩草 | 亚洲经典千人经典日产 | 久久精品视频在线看15 | 免费看男女做好爽好硬视频 | 日本精品少妇一区二区三区 | 最近的中文字幕在线看视频 | 国产成人午夜福利在线播放 | 中文无码伦av中文字幕 | 日本熟妇人妻xxxxx人hd | 熟女少妇在线视频播放 | 欧美三级a做爰在线观看 | 天天躁日日躁狠狠躁免费麻豆 | 丁香花在线影院观看在线播放 | 97色伦图片97综合影院 | 香蕉久久久久久av成人 | 男女性色大片免费网站 | 中文字幕 人妻熟女 | 一本久久a久久精品vr综合 | 国产成人av免费观看 | 欧美freesex黑人又粗又大 | 成人无码影片精品久久久 | 亚洲乱码国产乱码精品精 | 国产精品久久久久影院嫩草 | 99在线 | 亚洲 | 国产精品资源一区二区 | 激情国产av做激情国产爱 | 国产福利视频一区二区 | 在线观看免费人成视频 | 强奷人妻日本中文字幕 | 精品成在人线av无码免费看 | 丰满人妻精品国产99aⅴ | 丰满人妻一区二区三区免费视频 | 欧美日韩一区二区三区自拍 | 欧美大屁股xxxxhd黑色 | 中国大陆精品视频xxxx | 久久久亚洲欧洲日产国码αv | 人妻少妇被猛烈进入中文字幕 | 中文字幕+乱码+中文字幕一区 | 人妻插b视频一区二区三区 | 免费观看的无遮挡av | 国内精品久久毛片一区二区 | 青春草在线视频免费观看 | 强奷人妻日本中文字幕 | 76少妇精品导航 | 色狠狠av一区二区三区 | 丝袜美腿亚洲一区二区 | 性开放的女人aaa片 | www国产亚洲精品久久网站 | 久久国产精品偷任你爽任你 | 国产精品igao视频网 | 无码av最新清无码专区吞精 | 国产精品久久久久久无码 | 国产精品对白交换视频 | 蜜桃av抽搐高潮一区二区 | 成人免费视频在线观看 | 人妻天天爽夜夜爽一区二区 | 亚洲综合色区中文字幕 | аⅴ资源天堂资源库在线 | 日本熟妇人妻xxxxx人hd | 国产av久久久久精东av | 久久这里只有精品视频9 | 国产亚洲精品精品国产亚洲综合 | 国产精品人妻一区二区三区四 | 男人的天堂av网站 | 国产精品va在线播放 | 国产熟女一区二区三区四区五区 | 亚洲自偷自偷在线制服 | 人妻无码久久精品人妻 | 亚洲va中文字幕无码久久不卡 | 最近免费中文字幕中文高清百度 | 狠狠色色综合网站 | 人人澡人摸人人添 | 内射爽无广熟女亚洲 | 日日摸日日碰夜夜爽av | 免费观看的无遮挡av | 水蜜桃av无码 | 伦伦影院午夜理论片 | 欧美精品一区二区精品久久 | 国产亚洲精品久久久久久国模美 | 人人爽人人爽人人片av亚洲 | 国产精品高潮呻吟av久久4虎 | 蜜桃视频插满18在线观看 | 偷窥日本少妇撒尿chinese | 国产片av国语在线观看 | 久久久久99精品成人片 | 色窝窝无码一区二区三区色欲 | 狠狠亚洲超碰狼人久久 | 狂野欧美性猛xxxx乱大交 | 娇妻被黑人粗大高潮白浆 | 亚洲成熟女人毛毛耸耸多 | 无套内谢的新婚少妇国语播放 | 无码吃奶揉捏奶头高潮视频 | 久久久久久国产精品无码下载 | 日本护士毛茸茸高潮 | 激情内射亚州一区二区三区爱妻 | 国产无遮挡又黄又爽免费视频 | 国产suv精品一区二区五 | 伊人久久大香线焦av综合影院 | 夜夜夜高潮夜夜爽夜夜爰爰 | 1000部啪啪未满十八勿入下载 | 久久天天躁狠狠躁夜夜免费观看 | 97无码免费人妻超级碰碰夜夜 | 国产一精品一av一免费 | 人人澡人人透人人爽 | 国产乱人偷精品人妻a片 | 暴力强奷在线播放无码 | 国产手机在线αⅴ片无码观看 | 久久精品国产一区二区三区 | 风流少妇按摩来高潮 | 亚洲成色在线综合网站 | 成人免费视频一区二区 | 久久久久亚洲精品男人的天堂 | 国产精品久久久久久亚洲毛片 | 丰满岳乱妇在线观看中字无码 | 国语精品一区二区三区 | 日本高清一区免费中文视频 | 四虎影视成人永久免费观看视频 | 欧美35页视频在线观看 | 亚洲欧洲日本综合aⅴ在线 | 一个人看的视频www在线 | 在线观看国产午夜福利片 | 在线精品亚洲一区二区 | 一本无码人妻在中文字幕免费 | 97无码免费人妻超级碰碰夜夜 | 亚洲无人区一区二区三区 | 久久亚洲日韩精品一区二区三区 | 麻豆人妻少妇精品无码专区 | 野狼第一精品社区 | 中文字幕日韩精品一区二区三区 | 国产猛烈高潮尖叫视频免费 | 丁香花在线影院观看在线播放 | 成人无码精品一区二区三区 | 国产精品美女久久久久av爽李琼 | 国产精品亚洲综合色区韩国 |