Advertisement

lighting problem

Started by July 10, 2023 12:59 PM
12 comments, last by ali2 1 year, 4 months ago

lighting problem

did i enter the game and did ctrl alt del the models go black

void CPythonGraphic::SetOmniLight()

{

// Set up a material

D3DMATERIAL9 Material;

Material.Ambient = D3DXCOLOR(0.3f, 0.3f, 0.3f, 1.0f);

Material.Diffuse = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);

Material.Emissive = D3DXCOLOR(0.1f, 0.1f, 0.1f, 1.0f);

STATEMANAGER.SetMaterial(&Material);

D3DLIGHT9 Light;

Light.Type = D3DLIGHT_DIRECTIONAL;

Light.Position = D3DXVECTOR3(50.0f, 150.0f, 350.0f);

Light.Direction = D3DXVECTOR3(-0.5f, -0.0f, -0.5f);

Light.Theta = D3DXToRadian(30.0f);

Light.Phi = D3DXToRadian(45.0f);

Light.Falloff = 1.0f;

Light.Attenuation0 = 0.0f;

Light.Attenuation1 = 0.006f;

Light.Attenuation2 = 0.0f;

Light.Diffuse.r = 1.0f;

Light.Diffuse.g = 1.0f;

Light.Diffuse.b = 1.0f;

Light.Diffuse.a = 1.0f;

Light.Ambient.r = 1.0f;

Light.Ambient.g = 1.0f;

Light.Ambient.b = 1.0f;

Light.Ambient.a = 1.0f;

Light.Range = 500.0f;

ms_lpd3dDevice->SetLight(0, &Light);

ms_lpd3dDevice->LightEnable(0, TRUE);

Light.Type = D3DLIGHT_DIRECTIONAL;

Light.Position = D3DXVECTOR3(0.0f, 200.0f, 200.0f);

Light.Attenuation0 = 0.0f;

Light.Attenuation1 = 0.01f;

Light.Attenuation2 = 0.0f;

ms_lpd3dDevice->SetLight(1, &Light);

ms_lpd3dDevice->LightEnable(1, TRUE);

}

This is not a Writing question. Moving to a more appropriate forum.

-- Tom Sloper -- sloperama.com

Advertisement

Why in the world are you using python for game dev?

Why are you pressing ctrl atl del?

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

@undefined

fleabay said:

Why in the world are you using python for game dev?

Why are you pressing ctrl atl del?

For example. to open task manager

ali2 said:
For example. to open task manager

Right click on taskbar and choose task manager.

Anyway, it sounds like a bug with python or the library/framework you're using.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

@fleabay but this is what happened after upgrading from dx8 to 9.

Topluluk Tarafından Doğrulandı simgesi


Advertisement

Why are you using DX9? Are you writing games for Windows ME??

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

because it's a mmorpc game

I can't write a full game, it's from a friend, I'm developing the file

my english is bad sorry

Topluluk Tarafından Doğrulandı simgesi



  • Which one of the screenshots represents the initial state? Do you want proper shading like in the “dark" screenshot or high visibility textures like in the flat-shaded “bright” screenshot?
  • How and why are you “upgrading from dx8 to 9”? Both are obsolete. Can you clarify what libraries you are using and how?
  • Could you press CTRL-ALT-DEL without ill effects in the old DX8 based implementation?
  • Pressing CTRL-ALT-DEL is very likely to destroy the window and recreate it when you return to the desktop.
    Are you missing some parts of the initialization, that are only performed at program startup?

Omae Wa Mou Shindeiru

@LorenzoGatti I checked, downloaded the game and waited. did the same

This topic is closed to new replies.

Advertisement