|
|
@ -13,7 +13,7 @@ static Camera* sCamera = nullptr; |
|
|
|
Sphere sphere(Vector3(0.0f, 0.5f, 0.0f), 0.5f); |
|
|
|
static Object* sRootObject = nullptr; |
|
|
|
static Material* lambert = nullptr; |
|
|
|
static int sSampleCount = 64; |
|
|
|
static int sSampleCount = 128; |
|
|
|
static int sMaxBounceTime = 30; |
|
|
|
void AddObject(Object* object) { |
|
|
|
if (sRootObject == nullptr) { |
|
|
@ -31,7 +31,9 @@ void Init(int width, int height) |
|
|
|
sCamera = new Camera(45.0f, float(width) / float(height)); |
|
|
|
sCamera->LookAt(Vector3(3.0f, 1.0f, 3.0f), Vector3(0.0f, 0.0f, 0.0f), Vector3(0.0f, 1.0f, 0.0f)); |
|
|
|
Material* earth_material = new LamberMaterial(Vector3(0.5f, 0.3f, 0.1f)); |
|
|
|
Material* metal_material = new MetalMaterial(Vector3(0.9f,0.9f,0.9f)); |
|
|
|
AddObject(new Object(new Sphere(Vector3(0.0f, -1000.0f, 0.0), 1000.0f), earth_material)); |
|
|
|
AddObject(new Object(new Sphere(Vector3(-1.0f, 0.5f, 0.3), 0.5f), metal_material)); |
|
|
|
lambert = new LamberMaterial(Vector3(0.1f, 0.4f, 0.7f)); |
|
|
|
AddObject(new Object(&sphere, lambert)); |
|
|
|
} |
|
|
|