Added: lighting
This commit is contained in:
@@ -58,6 +58,19 @@ int WINAPI WinMain(
|
||||
// 7. create light source
|
||||
Light light = {};
|
||||
Light::LightBuffer lightData = {};
|
||||
|
||||
// directional light
|
||||
lightData.LightVector = { -1.0f, -1.0f, 1.0f };
|
||||
|
||||
// point light
|
||||
lightData.LightPosition = { -50.0f, 400.0f, 0.0f };
|
||||
lightData.LightAttenuation = { 1.0f, 0.3f, 0.1f };
|
||||
|
||||
lightData.LightIntensity = 1000.0f;
|
||||
lightData.DiffuseColor = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
lightData.SpecularColor = { 0.2f, 0.2f, 0.2f, 1.0f };
|
||||
lightData.Phong = 8.0f;
|
||||
lightData.CameraPosition = camera.getCameraPosition();
|
||||
error = light.init(d3d.getDevice(), lightData);
|
||||
CheckError(error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user