| author | Radek Brich <radek.brich@devl.cz> | 
| Sun, 25 Nov 2007 17:58:29 +0100 | |
| branch | pyrit | 
| changeset 15 | a0a3e334744f | 
| parent 14 | fc18ac4833f2 | 
| child 16 | 20bceb605f48 | 
| permissions | -rw-r--r-- | 
| 
15
 
a0a3e334744f
C++ demos: prepare infrastructure, add spheres_shadow.cc
 
Radek Brich <radek.brich@devl.cz> 
parents: 
14 
diff
changeset
 | 
1  | 
CCFLAGS=-I./src -Wall -Wno-write-strings -g -O3 -fno-strict-aliasing -DPTHREADS  | 
| 
0
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
2  | 
LDFLAGS=  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
3  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
4  | 
ifeq ($(OS), Windows_NT)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
5  | 
CCFLAGS+=-I"C:/Program Files/Python25/include"  | 
| 
6
 
d8d596d26f25
pthreads and other fixes for Windows
 
Radek Brich <radek.brich@devl.cz> 
parents: 
5 
diff
changeset
 | 
6  | 
LDFLAGS+=-L"C:\Program Files\Python25\libs" -lpython25 -lpthreadGC2  | 
| 
0
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
7  | 
MODULENAME=raytracer.pyd  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
8  | 
else  | 
| 
6
 
d8d596d26f25
pthreads and other fixes for Windows
 
Radek Brich <radek.brich@devl.cz> 
parents: 
5 
diff
changeset
 | 
9  | 
CCFLAGS+=-pthread -fPIC `python-config --includes`  | 
| 
0
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
10  | 
MODULENAME=raytracermodule.so  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
11  | 
endif  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
12  | 
|
| 
4
 
c73bc405ee7a
multi-threaded rendering via pthreads
 
Radek Brich <radek.brich@devl.cz> 
parents: 
1 
diff
changeset
 | 
13  | 
# optimizations  | 
| 
0
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
14  | 
#CCFLAGS+=-pipe -fomit-frame-pointer -ffast-math -msse3  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
15  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
16  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
17  | 
# TARGETS  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
18  | 
#########  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
19  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
20  | 
all: python-module  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
21  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
22  | 
python-module: $(MODULENAME)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
23  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
24  | 
tests: testvector testmatrix  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
25  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
26  | 
clean:  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
27  | 
rm -f *.o $(MODULENAME) testvector testmatrix  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
28  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
29  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
30  | 
# RULES  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
31  | 
#######  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
32  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
33  | 
%.o: src/%.cc  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
34  | 
$(CXX) -c -o $@ src/$*.cc $(CCFLAGS)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
35  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
36  | 
test%: tests/%.cc  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
37  | 
$(CXX) -o $@ tests/$*.cc $(CCFLAGS)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
38  | 
./$@  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
39  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
40  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
41  | 
# DEPENDENCIES  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
42  | 
##############  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
43  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
44  | 
# C++ raytracer  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
45  | 
vector.o: src/vector.cc src/vector.h  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
46  | 
matrix.o: src/matrix.cc src/matrix.h src/vector.h  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
47  | 
noise.o: src/noise.cc src/noise.h  | 
| 
14
 
fc18ac4833f2
replace Plane with axis-aligned Box (because infinite Plane is not usable with kd-tree)
 
Radek Brich <radek.brich@devl.cz> 
parents: 
7 
diff
changeset
 | 
48  | 
scene.o: src/scene.cc src/scene.h src/vector.h src/noise.h src/common.h  | 
| 
15
 
a0a3e334744f
C++ demos: prepare infrastructure, add spheres_shadow.cc
 
Radek Brich <radek.brich@devl.cz> 
parents: 
14 
diff
changeset
 | 
49  | 
kdtree.o: src/kdtree.cc src/kdtree.h src/scene.h  | 
| 
0
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
50  | 
raytracer.o: src/raytracer.cc src/raytracer.h src/scene.h src/vector.h src/noise.h  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
51  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
52  | 
# python module  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
53  | 
raytracermodule.o: src/raytracermodule.cc src/raytracer.h src/scene.h src/vector.h  | 
| 
7
 
bf17f9f84c91
kd-tree: build algorithm - searching for all posible splits
 
Radek Brich <radek.brich@devl.cz> 
parents: 
6 
diff
changeset
 | 
54  | 
$(MODULENAME): raytracermodule.o raytracer.o scene.o noise.o kdtree.o  | 
| 
0
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
55  | 
$(CXX) $^ -shared -o $@ $(LDFLAGS)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
56  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
57  | 
# library tests  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
58  | 
testvector: tests/vector.cc src/vector.h  |