c++ - DirectX9 Lighting weird stripes (Point-Light) -


I have a problem when enabling point-light in my application (DirectX 9). I get some very weird straps on the net, the stripes will look like this:

screenshot

pointlight Initialise:

  dxObject.g_pd3dDevice-> Centrarrettate (D3DRS_NORMALIZENORMALS, true); D3DXVECTOR3 vecDir; D3DLIGHT9 light; Zoramory (& amp; light, size (D3DLIGHT9)); Light.Type = D3DLIGHT_POINT; Light.Position = D3DXVECTOR3 (0.0f, 5.0f, 0.0f); Light.Diffuse.r = 5.0f; Light.Diffuse.g = 5.0f; Light.Diffuse.b = 5.0f; Light. Attenuation 0 = 0.0F; Light. Attention 1 = 0.125f; Light. Attenution 2 = 0.0f; Light.Range = 100.0f; DxObject.g_pd3dDevice-> Setlight (0, and light); DxObject.g_pd3dDevice-> Lightly capable (0, true); DxObject.g_pd3dDevice-> SetterState (D3DRS_AMBIENT, 0x00202020); .  

renderstate light is active

Loading mesh here:

  HRESULT hours = D3DXLoadMeshFromX (path.c_str), D3DXMESH_MANAGED, G_pd3dDevice, Null, and MaterialBuffer, Faucet, amp; num_Materials, and Mesh); If (FAILED (HR)) {message box (NULL, "Error: Loading Aries", "Error!", MB_OK); return false; } // Textur and content-save Daten D3DXMATERIAL * pMaterials = (D3DXMATERIAL *) MaterialBuffer-> GetBufferPointer (); P_MeshMaterials = New D3DMATERIAL9 [num_Materials]; P_MeshTtexture = New LPDIRECT3DTEXTURE9 [num_Materials]; // Kopiert dies in Materialien und Texturen Haupt-Array for Wom Buffer (I DWORD = 0; I & lt; num_Materials; i ++) {p_MeshMaterials [i] = pMaterials [i] .MatD3D; P_MeshMaterials [i] .Ambient.a = p_Mesh content [i] .Diffuse.a = 1.0f; P_MeshMaterials [i] .Ambient.r = p_Mesh content [i] .Diffuse.r = 1.0f; P_MeshMaterials [i] .Ambient.g = p_Mesh content [I]. Diffuse.g = 1.0f; P_MeshMaterials [i] .Ambient.b = p_MeshMaterials [i] Diffuse.b = 1.0f; P_MeshTextxture [i] = null; // If Erstellt Textur (pMaterials [i] .pTextureFilename) {D3DXCreateTextureFromFile (g_pd3dDevice, pMaterials [i] .pTextureFilename, & p_MeshTexture [i]); }}  

I hope someone knows the answer to my problem.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -