clray

diff src/rt.h @ 54:6a30f27fa1e6

separated the OpenGL visualization and added a CPU raytracing mode
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 10 Sep 2010 16:47:00 +0100
parents 30bf84881553
children df239a52a091
line diff
     1.1 --- a/src/rt.h	Sun Sep 05 16:43:55 2010 +0100
     1.2 +++ b/src/rt.h	Fri Sep 10 16:47:00 2010 +0100
     1.3 @@ -11,11 +11,26 @@
     1.4  	NUM_RENDER_OPTIONS
     1.5  };
     1.6  
     1.7 +struct RendInfo {
     1.8 +	float ambient[4];
     1.9 +	int xsz, ysz;
    1.10 +	int num_faces, num_lights;
    1.11 +	int max_iter;
    1.12 +	int cast_shadows;
    1.13 +};
    1.14 +
    1.15 +struct Ray {
    1.16 +	float origin[4], dir[4];
    1.17 +};
    1.18 +
    1.19 +
    1.20  bool init_renderer(int xsz, int ysz, Scene *scn, unsigned int tex);
    1.21  void destroy_renderer();
    1.22  bool render();
    1.23  void set_xform(float *matrix, float *invtrans);
    1.24  
    1.25 +const RendInfo *get_render_info();
    1.26 +
    1.27  void set_render_option(int opt, bool val);
    1.28  void set_render_option(int opt, int val);
    1.29  void set_render_option(int opt, float val);
    1.30 @@ -24,6 +39,13 @@
    1.31  int get_render_option_int(int opt);
    1.32  float get_render_option_float(int opt);
    1.33  
    1.34 +// raytrace in the CPU
    1.35 +bool init_dbg_renderer(int xsz, int ysz, Scene *scn, unsigned int texid);
    1.36 +void destroy_dbg_renderer();
    1.37 +void dbg_set_primary_rays(const Ray *rays);
    1.38 +void dbg_render(const float *xform, const float *invtrans_xform, int num_threads = -1);
    1.39 +
    1.40 +// visualize the scene using OpenGL
    1.41  void dbg_render_gl(Scene *scn, bool show_tree = false, bool show_obj = true);
    1.42  
    1.43  #endif	/* RT_H_ */