clray

diff src/rt.cc @ 7:575383f3a239

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 23 Jul 2010 01:22:03 +0100
parents 9f0ddb701882
children deaf85acf6af
line diff
     1.1 --- a/src/rt.cc	Tue Jul 20 20:02:41 2010 +0100
     1.2 +++ b/src/rt.cc	Fri Jul 23 01:22:03 2010 +0100
     1.3 @@ -25,6 +25,9 @@
     1.4  	cl_float4 pos, color;
     1.5  } __attribute__((packed));
     1.6  
     1.7 +struct Matrix4x4 {
     1.8 +	cl_float m[16];
     1.9 +};
    1.10  
    1.11  static Ray get_primary_ray(int x, int y, int w, int h, float vfov_deg);
    1.12  
    1.13 @@ -41,6 +44,10 @@
    1.14  	{{-10, 10, -20, 1}, {1, 1, 1, 1}}
    1.15  };
    1.16  
    1.17 +static Matrix4x4 xform = {
    1.18 +	{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}
    1.19 +};
    1.20 +
    1.21  static RendInfo rinf;
    1.22  
    1.23  
    1.24 @@ -74,6 +81,7 @@
    1.25  	prog->set_arg_buffer(2, ARG_RD, sizeof sphlist, sphlist);
    1.26  	prog->set_arg_buffer(3, ARG_RD, sizeof lightlist, lightlist);
    1.27  	prog->set_arg_buffer(4, ARG_RD, xsz * ysz * sizeof *prim_rays, prim_rays);
    1.28 +	prog->set_arg_buffer(5, ARG_RD, sizeof xform, &xform);
    1.29  
    1.30  	global_size = xsz * ysz;
    1.31  	return true;