Skip to content

Commit de7d0ac

Browse files
author
Jacco Bikker
committed
Added examples and scenegraph.
1 parent b1714c3 commit de7d0ac

File tree

379 files changed

+444410
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

379 files changed

+444410
-41
lines changed

assets/legocar.mtl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
newmtl RED_PLSTC
2+
Kd 0.894118 0.0823529 0.0823529
3+
4+
newmtl WHITE_PLSTC
5+
Kd 0.941177 0.941177 0.941177
6+
7+
newmtl BLACK_PLSTC
8+
Kd 0.0666667 0.0666667 0.0666667
9+
10+
newmtl WHITE_SHIELD
11+
Kd 0.941177 0.941177 0.941177
12+
map_Kd legoshld.gif
13+
14+
newmtl YELLOW_GLASS
15+
Kd 0.92549 0.745098 0.196078
16+
17+
newmtl GREY_PLSTC
18+
Kd 0.662745 0.662745 0.662745
19+
20+
newmtl BLUE_PLASTIC
21+
Kd 0.0431373 0.152941 0.65098
22+
23+
newmtl YELLOW_PLSTC
24+
Kd 0.917647 0.768628 0
25+

assets/legoshld.gif

8.45 KB
Loading

cl/kernels.cl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include "template/common.h"
22
#include "cl/tools.cl"
33

4-
__kernel void render( __global uint* pixels, const int offset )
4+
kernel void render( global uint* pixels, const int offset )
55
{
6-
// plot a pixel to a buffer
6+
// plot a simple pixel to a buffer
77
const int p = get_global_id( 0 );
88
pixels[p] = (p + offset) << 8;
99
}

cl/tools.cl

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
// random numbers: seed using WangHash((threadidx+1)*17), then use RandomInt / RandomFloat
2-
uint WangHash( uint s ) { s = (s ^ 61) ^ (s >> 16), s *= 9, s = s ^ (s >> 4), s *= 0x27d4eb2d, s = s ^ (s >> 15); return s; }
3-
uint RandomInt( uint* s ) { *s ^= *s << 13, * s ^= *s >> 17, * s ^= *s << 5; return *s; }
4-
float RandomFloat( uint* s ) { return RandomInt( s ) * 2.3283064365387e-10f; /* = 1 / (2^32-1) */ }
2+
uint WangHash( uint s )
3+
{
4+
s = (s ^ 61) ^ (s >> 16);
5+
s *= 9, s = s ^ (s >> 4);
6+
s *= 0x27d4eb2d, s = s ^ (s >> 15);
7+
return s;
8+
}
9+
10+
uint RandomInt( uint* s )
11+
{
12+
*s ^= *s << 13;
13+
*s ^= *s >> 17;
14+
* s ^= *s << 5;
15+
return *s;
16+
}
17+
18+
float RandomFloat( uint* s )
19+
{
20+
return RandomInt( s ) * 2.3283064365387e-10f; /* = 1 / (2^32-1) */
21+
}
522

623
// EOF

clean.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ del x64\*.exe
2424
del x64\*.ilk
2525
del x64\*.pdb
2626
del buildlog.txt
27+
del errorlog.txt

examples/features/assets/aagun.tga

141 KB
Binary file not shown.

examples/features/assets/ball.png

4.31 KB
Loading

examples/features/assets/biggun.tga

134 KB
Binary file not shown.
55 KB
Binary file not shown.

examples/features/assets/ctankgun.tga

15.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)