diff options
Diffstat (limited to 'NW4RTools/Models')
-rw-r--r-- | NW4RTools/Models/Material.cs | 2 | ||||
-rw-r--r-- | NW4RTools/Models/OpenGL/GLModel.cs | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/NW4RTools/Models/Material.cs b/NW4RTools/Models/Material.cs index 519790c..a28240c 100644 --- a/NW4RTools/Models/Material.cs +++ b/NW4RTools/Models/Material.cs @@ -24,7 +24,7 @@ namespace NW4RTools.Models { ScaleY = 1.0f; CameraID = 0xFF; - LightID = 0xFf; + LightID = 0xFF; Flags = 1; TexMatrix.Identity(); diff --git a/NW4RTools/Models/OpenGL/GLModel.cs b/NW4RTools/Models/OpenGL/GLModel.cs index 072ea00..18e5f6f 100644 --- a/NW4RTools/Models/OpenGL/GLModel.cs +++ b/NW4RTools/Models/OpenGL/GLModel.cs @@ -199,14 +199,14 @@ namespace NW4RTools.Models.OpenGL { displayList.Begin(); if (m.TextureInfos.Count > 0) { - GL.Enable(EnableCap.Texture2D); - TextureInfo[] texInfoArray = new TextureInfo[8]; foreach (var texInfo in m.TextureInfos) { texInfoArray[texInfo.TexMapID] = texInfo; } + GL.Enable(EnableCap.Texture2D); + for (int i = 0; i < 8; i++) { GL.ActiveTexture(TextureUnits[i]); GL.TexEnv(TextureEnvTarget.TextureEnv, TextureEnvParameter.TextureEnvMode, (int)TextureEnvMode.Modulate); @@ -215,6 +215,7 @@ namespace NW4RTools.Models.OpenGL { GL.BindTexture(TextureTarget.Texture2D, 0); } else { BindTextureInfo(texInfoArray[i]); + GL.Enable(EnableCap.Texture2D); } } @@ -302,8 +303,9 @@ namespace NW4RTools.Models.OpenGL { GL.MultiTexCoord2(TextureUnits[j], shape.TexCoordData[j].Data[vtxs[i].TexCoords[j]]); } } - - // TODO: normals + + if (vs.NormalDesc != VertexSettings.DescType.None) + GL.Normal3(shape.NrmData.Data[vtxs[i].Normal]); GL.Vertex3(shape.PosData.Data[vtxs[i].Position]); } |