Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualgreenpig83

Posted 16 May 2013 - 10:13 PM

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 !

 

g_pd3dDevice->SetRenderState(D3DRS_AMBIENT,RGB(200,100,100));

ZeroMemory(&Light,sizeof(Light));
Light.Type = D3DLIGHT_DIRECTIONAL;
 
//Light.Position=D3DXVECTOR3(-1232.0f,960.0f,2.0f);
 
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_LIGHTING, TRUE);
 
g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
 
g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, FALSE );
 
 
ZeroMemory(&PyramideMaterial,sizeof(PyramideMaterial));
//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

 

sc3_zps386ada13.png

 

sc4_zps228f11e0.png


#4greenpig83

Posted 16 May 2013 - 10:01 PM

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!

 

g_pd3dDevice->SetRenderState(D3DRS_AMBIENT,RGB(200,100,100));

ZeroMemory(&Light,sizeof(Light));
Light.Type = D3DLIGHT_DIRECTIONAL;
 
//Light.Position=D3DXVECTOR3(-1232.0f,960.0f,2.0f);
 
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_LIGHTING, TRUE);
 
g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
 
g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, FALSE );
 
 
ZeroMemory(&PyramideMaterial,sizeof(PyramideMaterial));
//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

 

sc3_zps386ada13.png

 

sc4_zps228f11e0.png


#3greenpig83

Posted 16 May 2013 - 10:00 PM

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!

 

g_pd3dDevice->SetRenderState(D3DRS_AMBIENT,RGB(200,100,100));

ZeroMemory(&Light,sizeof(Light));
Light.Type = D3DLIGHT_DIRECTIONAL;
 
//Light.Position=D3DXVECTOR3(-1232.0f,960.0f,2.0f);
 
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_LIGHTING, FALSE);
 
g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
 
g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, FALSE );
 
 
ZeroMemory(&PyramideMaterial,sizeof(PyramideMaterial));
//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

 

sc3_zps386ada13.png

 

sc4_zps228f11e0.png


#2greenpig83

Posted 16 May 2013 - 09:58 PM

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!

 

g_pd3dDevice->SetRenderState(D3DRS_AMBIENT,RGB(200,100,100));

ZeroMemory(&Light,sizeof(Light));
Light.Type = D3DLIGHT_DIRECTIONAL;
 
//Light.Position=D3DXVECTOR3(-1232.0f,960.0f,2.0f);
 
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_LIGHTING, FALSE);
 
g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
 
g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, FALSE );
 
 
ZeroMemory(&PyramideMaterial,sizeof(PyramideMaterial));
//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

 

sc3_zps386ada13.png

 

sc4_zps228f11e0.png


#1greenpig83

Posted 16 May 2013 - 09:57 PM

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

 

g_pd3dDevice->SetRenderState(D3DRS_AMBIENT,RGB(200,100,100));

ZeroMemory(&Light,sizeof(Light));
Light.Type = D3DLIGHT_DIRECTIONAL;
 
//Light.Position=D3DXVECTOR3(-1232.0f,960.0f,2.0f);
 
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_LIGHTING, FALSE);
 
g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
 
g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, FALSE );
 
 
ZeroMemory(&PyramideMaterial,sizeof(PyramideMaterial));
//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

 

sc3_zps386ada13.png

 

sc4_zps228f11e0.png


PARTNERS