OK here the new test with Vector. It seem you 2 are right. Using Vertext Normal does help smooth the surface a lot!
I havent use any Shader (Cause havent work with it before). I just recalculate the Vextex vector in my Vertext. By Plus all the 4 Normal ( of the 4 surface neighhbour this Vertext). You say multy ??float3 normal[p.x][p.y]=normalize((n1 x n2 x n3 x n4),1.0f) It seems Plus work right for me.
Now I still have a Problem, the lighting seem ugly for me, its not bright enough and make good shadow (I means the other side should darker than the side with Light). Even I change the LIght.Direction alot, it's still look very bad. Maybe because of the setting ? I'm using
Do you know any setting that look good in this Case, Isometric Ortho projection! Thanks a lot!
Do you think I need to multy the Vertex Normal with World or Project Matrix ? Right now I just calculate the Normal from original Vertex Position!
When I zoom( use world Transform Scale). When I zoom away , it's get lighter a lot. But the portion of Light in each side still the same !
Light.Type = D3DLIGHT_DIRECTIONAL;
Light.Diffuse.r = 1.0f;
Light.Diffuse.g = 1.0f;
Light.Diffuse.b = 1.0f;
//set light dir
//0.2f, -0.9f, -0.2f
Light.Direction.x = 1.0f;
Light.Direction.y = 0.8f;
Light.Direction.z = 0.0f;
//Light.Direction = D3DXVECTOR3(1.0,0.5,0.4);
Light.Range = 1000.0f;
g_pd3dDevice->SetLight(0,&Light); //set the light (NEW)
g_pd3dDevice->LightEnable(0,true); //enables the light (NEW)
g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, FALSE );
//diffuse color (NEW)
PyramideMaterial.Diffuse.r = 1.0f;
PyramideMaterial.Diffuse.g = 1.0f;
PyramideMaterial.Diffuse.b = 1.0f;
g_pd3dDevice->SetMaterial(&PyramideMaterial); //set light (NEW
Edited by greenpig83, 16 May 2013 - 10:13 PM.