Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMedo3337

Posted 18 July 2013 - 11:12 PM

@menohack: I'm using Visual Studio 2010

 

Yes I'm updating cameraPos value each render.

 

Here is a part of the C++ code:

// Light
float lightDiffuse[4] = {1.0f, 1.0f, 1.0f, 0.01f};
float lightSpecular[4] = {0.5f, 0.5f, 0.5f, 0.5f};
pEffect->SetValue("lightDiffuse", &lightDiffuse, sizeof(lightDiffuse));
pEffect->SetValue("lightSpecular", &lightSpecular, sizeof(lightSpecular));

// Material
float materialDiffuse[4] = {1.0f, 1.0f, 1.0f, 1.0f};
float materialAmbient[4] = {0.15f, 0.15f, 0.15f, 1.0f};
float materialSpecular[4] = {1.0f, 1.0f, 1.0f, 1.0f};
float materialPower = 10.0f;

float gAmbient[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
pEffect->SetValue("globalAmbient", &gAmbient, sizeof(gAmbient));

D3DXVECTOR3 lightDirection(0.0f, 10.0f, 1.0f);
pEffect->SetValue("lightDirection", &lightDirection, sizeof(D3DXVECTOR3));
pEffect->SetValue("cameraPos", &getCameraPosition(), sizeof(D3DXVECTOR3));

pEffect->SetTexture("colorMapTexture", texture);

#1Medo3337

Posted 18 July 2013 - 04:10 PM

@menohack: I'm using Visual Studio 2010

 

Yes I'm updating cameraPos value each render.

 

Here is a part of the C++ code:

// Light
float lightDiffuse[4] = {1.0f, 1.0f, 1.0f, 0.01f};
float lightSpecular[4] = {0.5f, 0.5f, 0.5f, 0.5f};
float lightRange = 100.0f;
pEffect->SetValue("lightDiffuse", &lightDiffuse, sizeof(lightDiffuse));
pEffect->SetValue("lightSpecular", &lightSpecular, sizeof(lightSpecular));
pEffect->SetValue("lightRange", &lightRange, sizeof(lightRange));

// Material
float materialDiffuse[4] = {1.0f, 1.0f, 1.0f, 1.0f};
float materialAmbient[4] = {0.15f, 0.15f, 0.15f, 1.0f};
float materialSpecular[4] = {1.0f, 1.0f, 1.0f, 1.0f};
float materialPower = 10.0f;

float gAmbient[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
pEffect->SetValue("globalAmbient", &gAmbient, sizeof(gAmbient));

D3DXVECTOR3 lightDirection(0.0f, 10.0f, 1.0f);
pEffect->SetValue("lightDirection", &lightDirection, sizeof(D3DXVECTOR3));
pEffect->SetValue("cameraPos", &getCameraPosition(), sizeof(D3DXVECTOR3));

pEffect->SetTexture("colorMapTexture", texture);

PARTNERS