+ // eye position information
+ matrix4x4_t matrix, inverse_matrix;
+ vec3_t origin;
+ vec3_t forward;
+ vec3_t left;
+ vec3_t right;
+ vec3_t up;
+ int numfrustumplanes;
+ mplane_t frustum[6];
+ qboolean useclipplane;
+ qboolean usecustompvs; // uses r_refdef.viewcache.pvsbits as-is rather than computing it
+ mplane_t clipplane;
+ float frustum_x, frustum_y;
+ vec3_t frustumcorner[4];
+ // if turned off it renders an ortho view
+ int useperspective;
+ float ortho_x, ortho_y;
+
+ // screen area to render in
+ int x;
+ int y;
+ int z;
+ int width;
+ int height;
+ int depth;
+ r_viewport_t viewport;
+
+ // which color components to allow (for anaglyph glasses)
+ int colormask[4];
+
+ // global RGB color multiplier for rendering, this is required by HDR
+ float colorscale;
+
+ // whether to call R_ClearScreen before rendering stuff
+ qboolean clear;
+ // if true, don't clear or do any post process effects (bloom, etc)
+ qboolean isoverlay;
+
+ // whether to draw r_showtris and such, this is only true for the main
+ // view render, all secondary renders (HDR, mirrors, portals, cameras,
+ // distortion effects, etc) omit such debugging information
+ qboolean showdebug;
+
+ // these define which values to use in GL_CullFace calls to request frontface or backface culling
+ int cullface_front;
+ int cullface_back;
+
+ // render quality (0 to 1) - affects r_drawparticles_drawdistance and others
+ float quality;
+}
+r_refdef_view_t;
+
+typedef struct r_refdef_viewcache_s
+{
+ // updated by gl_main_newmap()
+ int maxentities;
+ int world_numclusters;
+ int world_numleafs;
+ int world_numsurfaces;
+
+ // these properties are generated by R_View_Update()
+
+ // which entities are currently visible for this viewpoint
+ // (the used range is 0...r_refdef.scene.numentities)
+ unsigned char *entityvisible;
+
+ // flag arrays used for visibility checking on world model
+ // (all other entities have no per-surface/per-leaf visibility checks)
+ unsigned char *world_pvsbits;
+ unsigned char *world_leafvisible;
+ unsigned char *world_surfacevisible;
+ // if true, the view is currently in a leaf without pvs data
+ qboolean world_novis;
+}
+r_refdef_viewcache_t;
+
+// TODO: really think about which fields should go into scene and which one should stay in refdef [1/7/2008 Black]
+// maybe also refactor some of the functions to support different setting sources (ie. fogenabled, etc.) for different scenes
+typedef struct r_refdef_scene_s {