engine/EngineVideoSky.c
/*	Hacky way of rendering a 3D skybox.
		- Consider rendering 3D skybox once into envmap?
		- Consider using FBO instead and somehow spanning it?
*/
Hacky way of rendering a 3D skybox.
Consider rendering 3D skybox once into envmap.
Hacky way of rendering a 3D skybox . Consider rendering 3D skybox once into envmap .
void Sky_Draw3DWorld(void)
{
	MathVector3f_t oldorg;
	if (!sky_camera || r_refdef.sky)
		return;
	Math_VectorCopy(r_refdef.vieworg, oldorg);
	Math_VectorCopy(sky_camerapos, r_refdef.vieworg);
	R_SetupView();
	VideoLayer_DepthMask(false);
	glPushMatrix();
	glScalef(2.0f, 2.0f, 2.0f);
	r_refdef.sky = true;
	R_RenderScene();
	r_refdef.sky = false;
	glPopMatrix();
	VideoLayer_DepthMask(true);
	Math_VectorCopy(oldorg, r_refdef.vieworg);
	R_SetupView();
}
void Sky_Draw3DWorld ( void ) { MathVector3f_t oldorg ; if ( ! sky_camera || r_refdef . sky ) return ; Math_VectorCopy ( r_refdef . vieworg , oldorg ) ; Math_VectorCopy ( sky_camerapos , r_refdef . vieworg ) ; R_SetupView ( ) ; VideoLayer_DepthMask ( false ) ; glPushMatrix ( ) ; glScalef ( 2.0f , 2.0f , 2.0f ) ; r_refdef . sky = true ; R_RenderScene ( ) ; r_refdef . sky = false ; glPopMatrix ( ) ; VideoLayer_DepthMask ( true ) ; Math_VectorCopy ( oldorg , r_refdef . vieworg ) ; R_SetupView ( ) ; }
Hacky way of rendering a 3D skybox.
Hacky way of rendering a 3D skybox .
// Don't let us render twice. // Update view position. // Restore view position. // Setup the view again, urgh.