기초적인 셰이딩 구현
This commit is contained in:
@@ -96,6 +96,17 @@ bool MainScene::init()
|
||||
}
|
||||
}
|
||||
|
||||
// Add Lights
|
||||
// Directional Light: Like sunlight, creating shadows/depth
|
||||
auto dirLight = DirectionLight::create(Vec3(-1.0f, -1.0f, -0.5f), Color3B::WHITE);
|
||||
dirLight->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
this->addChild(dirLight);
|
||||
|
||||
// Ambient Light: To ensure dark sides are still somewhat visible
|
||||
auto ambLight = AmbientLight::create(Color3B(80, 80, 80));
|
||||
ambLight->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||
this->addChild(ambLight);
|
||||
|
||||
// Setup Camera for Quarter View (Isometric-like)
|
||||
_camera3D = Camera::createPerspective(60.0f, visibleSize.width / visibleSize.height, 0.1f, 1000.0f);
|
||||
_camera3D->setCameraFlag(CameraFlag::USER1);
|
||||
|
||||
Reference in New Issue
Block a user