Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

немного исправлены коэффиценты отражения+добавлен тест, на котором ви…

…дно баг на прозрачных объектах
  • Loading branch information...
commit d4f348d4cc651936751a8c3e44b897f6856c501d 1 parent f9250ad
@azhi azhi authored committed
Showing with 8 additions and 7 deletions.
  1. +7 −6 src/main.cpp
  2. +1 −1  src/raytracer.cpp
View
13 src/main.cpp
@@ -38,23 +38,24 @@ int main()
scene->AddLight(light);
scene->AddCamera(camera);
*/
- Material mat1(0.4f, 0.4f, 0.0f, 0.2f, 1.0f);
+ //Material mat1(0.2f, 0.2f, 0.0f, 2.0f, 1.0f); раскомментить для получения бага ;)
+ Material mat1(0.2f, 0.2f, 0.0f, 0.6f, 1.0f);
Material mat2(0.0f, 0.1f, 0.0f, 0.6f, 0.3f);
Material mat3(0.5f, 0.1f, 1.0f, 0.0f, 0.0f);
Material mat4(0.2f,0.6f,0.0f,0.0f,1.0f);
Scene* scene = new Scene(ColorRGB::Null());
- scene->AddPrimitive(new Sphere(Vector3(0.0f,1.0f,0.0f),1.0f,ColorRGB(100,100, 0),mat1));
- scene->AddPrimitive(new Sphere(Vector3(0.0f,-1.0f,0.0f),1.0f,ColorRGB( 0,100,100),mat1));
+ scene->AddPrimitive(new Sphere(Vector3(0.0f,1.0f,0.0f),1.0f,ColorRGB(50,50, 80),mat1));
+ scene->AddPrimitive(new Sphere(Vector3(0.0f,-1.0f,0.0f),1.0f,ColorRGB( 70,40,40),mat1));
scene->AddPrimitive(new Sphere(Vector3(3.0f,0.0f,0.0f),0.5f,ColorRGB( 50,230, 50),mat1));
scene->AddLight(new Light(Vector3(0.0f,3.0f,0.0f),2.0f));
- scene->AddLight(new Light(Vector3(0.0f,0.0f,8.0f),3.0f));
+ scene->AddLight(new Light(Vector3(0.0f,3.0f,8.0f),3.0f));
scene->AddLight(new Light(Vector3(4.0f,0.0f,0.0f),2.0f));
- Camera* camera = new Camera(Vector3(10.0f,1.0f,5.0f),Vector3::Null(),1.0f,1.0f);
+ Camera* camera = new Camera(Vector3(7.0f,1.0f,4.0f),Vector3::Null(),1.0f,1.0f);
scene->AddCamera(camera);
scene->AddPrimitive(new Plane(Vector3(0.0f, 0.0, -1.0), Vector3(0.0f, 0.0f, 1.0f), ColorRGB( 60,60, 50), mat3));
- scene->AddPrimitive(new Prism(Vector3(0.0f,0.0f,1.5f),Vector3(0.0f,-1.0f,1.5f),Vector3(1.0f,-1.0f,1.5f),Vector3(1.0f,0.0f,1.5f),
+ scene->AddPrimitive(new Prism(Vector3(-2.0f,0.5f,0.0f),Vector3(-2.0f,-0.5f,0.0f),Vector3(-1.0f,-0.5f,0.0f),Vector3(-1.0f,0.5f,0.0f),
Vector3(0.0f,0.0f,1.0f),1.0f,ColorRGB(20,200,50),mat4));
Screen* screen = new Screen(camera, scene, HEIGHT, WIDTH);
View
2  src/raytracer.cpp
@@ -6,7 +6,7 @@ RayTracer::RayTracer(Scene* scene) : scene(scene)
{
LambertC = 0.8f;
PhongC = 0.5f;
- RefractC = 0.3f;
+ RefractC = 1.5f;
ReflectC = 0.5f;
ReduceLightPowerC = 0.13f;
}
Please sign in to comment.
Something went wrong with that request. Please try again.