Subversion Repositories ps3ware

Compare Revisions

Ignore whitespace Rev 209 → Rev 210

/trunk/libps3rsx/examples/simple_fx/ps3gpu.cpp
58,7 → 58,7
float h = 0.3f;
frustrum( -w, +w, -h, +h, 1.0f, 100.0f, matrix );
translatef( 0.0f, 0.0f, -5.0f, matrix );
translatef( 0.0f, 0.0f, -4.0f, matrix );
rotatef( angle, 0.0f, 1.0f, 0.0f, matrix );
rotatef( 90.0f, 1.0f, 0.0f, 0.0f, matrix );
489,7 → 489,7
 
};
 
#define INUMBER 20
#define INUMBER 32
instance_data_t insts[INUMBER] __attribute__((aligned( 128 ) ));
uint32_t dt[INUMBER];
float rnds[INUMBER][4];
515,7 → 515,7
rnds[i][0] = 360.0f * i / (float)( INUMBER );//rnd( 0.0f, 360.0f );
rnds[i][1] = rnd( -0.2f, +0.2f );
rnds[i][2] = rnd( -0.8f, +0.3f );
rnds[i][3] = rnd( 0.7f, 1.7f );
rnds[i][3] = rnd( 0.3f, 1.0f );
insts[i].time = rand();
534,11 → 534,13
rotatef( 80.0f, 1.0f, 0.0f, 0.0f, insts[i].mat );
rotatef( off * 0.5f + rnds[i][0], 0.0f, 0.0f, 1.0f, insts[i].mat );
translatef( rnds[i][3], rnds[i][1], rnds[i][2], insts[i].mat );
translatef( 1.6f, rnds[i][1], rnds[i][2], insts[i].mat );
scalef( rnds[i][3], insts[i].mat );
float d = insts[i].mat[11];
d = ( 1.0f - d );
insts[i].scale = rnds[i][3];
insts[i].col[0] = d;
insts[i].col[1] = 0.5f + d;
insts[i].col[2] = d;
/trunk/libps3rsx/examples/simple_fx/structs.h
5,7 → 5,8
float col[4];
float mat[16];
uint32_t time;
float padd[3];
float scale;
float padd[2];
};
 
struct program_data_t
/trunk/libps3rsx/examples/simple_fx/spu-srv.cpp
323,8 → 323,11
u = *(float *)&vu;
v = *(float *)&vv;
 
u *= insts[inst].scale;
v *= insts[inst].scale;
 
Vertex &a00 = outBuffer[(outPtr + 0 ) & 511];
Vertex &a01 = outBuffer[(outPtr + 1 ) & 511];