ccdemos/textures.cc
author Radek Brich <radek.brich@devl.cz>
Sun, 31 May 2009 23:06:03 +0200
branchpyrit
changeset 100 c005054bf4c1
parent 93 96d65f841791
permissions -rw-r--r--
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
100
c005054bf4c1 new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
Radek Brich <radek.brich@devl.cz>
parents: 93
diff changeset
     1
#include "common_sdl.h"
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 88
diff changeset
     2
#include "kdtree.h"
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     3
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
     4
Camera cam(Vector(0.0f,6.0f,6.0f), Vector(0.0f,2.0f,-7.0f), Vector(0.0f,0.0f,-1.0f));
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
     5
Light light(Vector(-2.0f, 10.0f, -2.0f), Colour(0.9f, 0.9f, 0.9f));
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     6
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     7
Float lx, ly, lz, cf;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     8
81
9dbb9c8c115b add 2D pixmap texture class
Radek Brich <radek.brich@devl.cz>
parents: 79
diff changeset
     9
void update_callback(Float*)
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    10
{
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    11
	if (lx != 0.0)
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    12
		light.pos.x += lx;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    13
	if (ly != 0.0)
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    14
		light.pos.y += ly;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    15
	if (lz != 0.0)
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    16
		light.pos.z += lz;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    17
	if (cf != 0.0)
92
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    18
		cam.setF(cam.getF() + cf);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    19
}
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    20
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    21
void key_callback(int key, int down)
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    22
{
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    23
	switch (key)
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    24
	{
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    25
		case SDLK_r:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    26
			lx = -0.1f * down;
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    27
			break;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    28
		case SDLK_t:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    29
			lx = +0.1f * down;
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    30
			break;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    31
		case SDLK_f:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    32
			ly = -0.1f * down;
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    33
			break;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    34
		case SDLK_g:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    35
			ly = +0.1f * down;
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    36
			break;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    37
		case SDLK_v:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    38
			lz = -0.1f * down;
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    39
			break;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    40
		case SDLK_b:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    41
			lz = +0.1f * down;
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    42
			break;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    43
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    44
		case SDLK_z:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    45
			cf = -0.02f * down;
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    46
			break;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    47
		case SDLK_x:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    48
			cf = +0.02f * down;
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    49
			break;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    50
	}
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    51
}
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    52
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    53
int main(int argc, char **argv)
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    54
{
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    55
	Raytracer rt;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    56
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 88
diff changeset
    57
	KdTree top;
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    58
	rt.setCamera(&cam);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    59
	rt.setTop(&top);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    60
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    61
	rt.addLight(&light);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    62
	light.castShadows(false);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    63
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    64
	const Colour c_white(1, 1, 1);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    65
	const Colour c_black(0, 0, 0);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    66
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    67
	Material mat0a(Colour(0.7f, 0.7f, 0.7f));
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    68
	mat0a.setReflectivity(0.0f);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    69
	Box box(Vector(-12.0f, -1.2f, -20.0f), Vector(12.0f, -1.0f, 0.0f), &mat0a);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    70
	rt.addShape(&box);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    71
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    72
	Material mat0b(Colour(0.1f, 0.7f, 0.8f));
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    73
	mat0b.setReflectivity(0.7f);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    74
	Box box2(Vector(-12.0f, -1.2f, -10.0f), Vector(12.0f, 10.0f, -10.2f), &mat0b);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    75
	rt.addShape(&box2);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    76
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    77
	Float bounds[] = {0.3f, 0.6f, 1.1f};
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    78
	Colour colours[] = {c_black, c_white, c_black};
79
062b1c4143f7 material and texture classes moved to material.(cc,h)
Radek Brich <radek.brich@devl.cz>
parents: 75
diff changeset
    79
	BoundColourMap cmap(bounds, colours);
062b1c4143f7 material and texture classes moved to material.(cc,h)
Radek Brich <radek.brich@devl.cz>
parents: 75
diff changeset
    80
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    81
	// spheres
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    82
	Material mat1(c_white);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    83
	mat1.texture = new CheckersTexture(new PlanarMap(Vector(-4.5f, 2.0f, -7.0f), 0.48f), &cmap);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    84
	Sphere sphere1(Vector(-4.5f, 2.0f, -7.0f), 1, &mat1);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    85
	rt.addShape(&sphere1);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    86
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    87
	Material mat2(c_white);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    88
	mat2.texture = new CheckersTexture(new CubicMap(Vector(-1.5f, 2.0f, -7.0f), 0.48f), &cmap);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    89
	Sphere sphere2(Vector(-1.5f, 2.0f, -7.0f), 1, &mat2);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    90
	rt.addShape(&sphere2);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    91
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    92
	Material mat3(c_white);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    93
	mat3.texture = new CheckersTexture(new CylinderMap(Vector(1.5f, 2.0f, -7.0f), 0.48f), &cmap);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    94
	Sphere sphere3(Vector(1.5f, 2.0f, -7.0f), 1, &mat3);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    95
	rt.addShape(&sphere3);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    96
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    97
	Material mat4(c_white);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    98
	mat4.texture = new CheckersTexture(new SphereMap(Vector(4.5f, 2.0f, -7.0f), 0.48f), &cmap);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    99
	Sphere sphere4(Vector(4.5f, 2.0f, -7.0f), 1, &mat4);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
   100
	rt.addShape(&sphere4);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   101
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   102
	// cubes
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   103
	Material mat5(c_white);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   104
	const Vector cube1_base(-4.5f, 0.0f, -7.0f);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   105
	mat5.texture = new CheckersTexture(new PlanarMap(cube1_base, 0.48f), &cmap);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   106
	Box cube1(cube1_base - 1.0f, cube1_base + 1.0f, &mat5);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
   107
	rt.addShape(&cube1);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   108
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   109
	Material mat6(c_white);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   110
	const Vector cube2_base(-1.5f, 0.0f, -7.0f);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   111
	mat6.texture = new CheckersTexture(new CubicMap(cube2_base, 0.48f), &cmap);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   112
	Box cube2(cube2_base - 1.0f, cube2_base + 1.0f, &mat6);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
   113
	rt.addShape(&cube2);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   114
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   115
	Material mat7(c_white);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   116
	const Vector cube3_base(1.5f, 0.0f, -7.0f);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   117
	mat7.texture = new CheckersTexture(new CylinderMap(cube3_base, 0.48f), &cmap);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   118
	Box cube3(cube3_base - 1.0f, cube3_base + 1.0f, &mat7);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
   119
	rt.addShape(&cube3);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   120
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   121
	Material mat8(c_white);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   122
	const Vector cube4_base(4.5f, 0.0f, -7.0f);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   123
	mat8.texture = new CheckersTexture(new SphereMap(cube4_base, 0.48f), &cmap);
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   124
	Box cube4(cube4_base - 1.0f, cube4_base + 1.0f, &mat8);
72
7c3f38dff082 kd-tree building - check all axes for best split, add additional shape-bbox check
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
   125
	rt.addShape(&cube4);
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   126
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   127
	mat1.setReflectivity(0);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   128
	mat2.setReflectivity(0);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   129
	mat3.setReflectivity(0);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   130
	mat4.setReflectivity(0);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   131
	mat5.setReflectivity(0);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   132
	mat6.setReflectivity(0);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   133
	mat7.setReflectivity(0);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   134
	mat8.setReflectivity(0);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   135
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   136
	top.optimize();
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   137
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   138
	w = 1024;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   139
	h = 600;
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   140
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   141
	/* run interactive mode */
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   142
	loop_sdl(rt, cam, update_callback, key_callback);
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   143
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   144
	/* render image */
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   145
	if (argc == 2 && !strcmp(argv[1], "-r"))
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   146
	{
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   147
		pyrit_verbosity = 2;
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
   148
		rt.ambientOcclusion(300, 5.0f, 0.5f);
88
f7edb3b90816 merge pixmap handling from sampler, material.h and ccdemos's image module to new Pixmap class
Radek Brich <radek.brich@devl.cz>
parents: 81
diff changeset
   149
		DefaultSampler sampler(w, h);
48
a4913301c626 begin moving subsampling and oversampling to Sampler
Radek Brich <radek.brich@devl.cz>
parents: 47
diff changeset
   150
		sampler.setOversample(2);
a4913301c626 begin moving subsampling and oversampling to Sampler
Radek Brich <radek.brich@devl.cz>
parents: 47
diff changeset
   151
		sampler.setSubsample(1);
47
320d5d466864 move Sampler classes to sampler.cc
Radek Brich <radek.brich@devl.cz>
parents: 43
diff changeset
   152
		rt.setSampler(&sampler);
320d5d466864 move Sampler classes to sampler.cc
Radek Brich <radek.brich@devl.cz>
parents: 43
diff changeset
   153
		rt.render();
88
f7edb3b90816 merge pixmap handling from sampler, material.h and ccdemos's image module to new Pixmap class
Radek Brich <radek.brich@devl.cz>
parents: 81
diff changeset
   154
		sampler.getPixmap().writePNG("textures.png");
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   155
	}
92
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
   156
	
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
   157
	return 0;
42
fbdeb3e04543 cleaned Texture interface
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
   158
}