Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
2 changes: 1 addition & 1 deletion examples/exampleB/exampleB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

int main()
{
Rectangle *r[12];
Rectangle *r[25];
PointLight *Light1;

initDefaultMaterial();
Expand Down
1 change: 1 addition & 0 deletions include/Tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// @brief Some common raytracing globals/protos/inlines
//
#pragma once
#define _USE_MATH_DEFINES

#include <math.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion include/geom/Triangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class Triangle : public Rectangle
{
public:
Triangle( Vector& l, Vector& s1, Vector& s2 ) : Rectangle(l,s1,s2) {}
Triangle( const Vector& l, const Vector& s1, const Vector& s2 ) : Rectangle(l,s1,s2) {}

bool intersect(Ray&, double&) override;
};
2 changes: 1 addition & 1 deletion src/image/Targa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void targa_header::save(DataSink& ds)

TargaImage::TargaImage( char const*name, int width, int height, char *comment )
{
FILE *fp = fopen(name, "w");
FILE *fp = fopen(name, "wb");
file = new FileDataSink(fp);
buf_size = 1000;
buffer = new rgb [buf_size];
Expand Down
4 changes: 4 additions & 0 deletions src/render/ADRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ void adaptive_distributed_render_scene(
{
double x,y; // sample point
Ray ray; // pixel ray

nx *= 4;
ny *= 4;

double hx = 2.0 * HalfWidth / nx; // pixel width
double hy = 2.0 * HalfHeight / ny; // pixel height
double hxSub = hx / nxSub;
Expand Down
5 changes: 5 additions & 0 deletions src/render/DRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ void distributed_render_scene(
{
double x,y; // sample point
Ray ray; // pixel ray

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line


nx *= 4;
ny *= 4;

double hx = 2.0 * half_width / nx; // pixel width
double hy = 2.0 * half_height / ny; // pixel height
double hx_sub = hx / nx_sub; // hz subdivision
Expand Down
4 changes: 4 additions & 0 deletions src/render/Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ void render_scene(Scene* scene, double half_width, double half_height,
char const* fname)
{
double x, y;

nx *= 4;
ny *= 4;

double hx = 2.0 * half_width / nx;
double hy = 2.0 * half_height / ny;
Ray ray;
Expand Down