Beispiel #1
0
/*
================
RB_StageIteratorSky

All of the visible sky triangles are in tess

Other things could be stuck in here, like birds in the sky, etc
================
*/
void RB_StageIteratorSky( void )
{
	if ( g_bRenderGlowingObjects )
		return;

	if ( r_fastsky->integer ) {
		return;
	}

	if (skyboxportal && !(backEnd.refdef.rdflags & RDF_SKYBOXPORTAL))
	{
		return;
	}

	// go through all the polygons and project them onto
	// the sky box to see which blocks on each side need
	// to be drawn
	RB_ClipSkyPolygons( &tess );

	// r_showsky will let all the sky blocks be drawn in
	// front of everything to allow developers to see how
	// much sky is getting sucked in
	if ( r_showsky->integer ) {
		qglDepthRange( 0.0, 0.0 );
	} else {
		qglDepthRange( 1.0, 1.0 );
	}

	// draw the outer skybox
	if ( tess.shader->sky->outerbox[0] && tess.shader->sky->outerbox[0] != tr.defaultImage ) {
		qglColor3f( tr.identityLight, tr.identityLight, tr.identityLight );

		qglPushMatrix ();
		GL_State( 0 );
		qglTranslatef (backEnd.viewParms.ori.origin[0], backEnd.viewParms.ori.origin[1], backEnd.viewParms.ori.origin[2]);

		DrawSkyBox( tess.shader );

		qglPopMatrix();
	}

	// generate the vertexes for all the clouds, which will be drawn
	// by the generic shader routine
	R_BuildCloudData( &tess );

	if (tess.numIndexes && tess.numVertexes)
	{
		RB_StageIteratorGeneric();
	}

	// draw the inner skybox


	// back to normal depth range
	qglDepthRange( 0.0, 1.0 );

	// note that sky was drawn so we will draw a sun later
	backEnd.skyRenderedThisView = qtrue;
}
Beispiel #2
0
/*
================
RB_StageIteratorSky

All of the visible sky triangles are in tess

Other things could be stuck in here, like birds in the sky, etc
================
*/
void RB_StageIteratorSky( void ) {
	if ( r_fastsky->integer ) {
		return;
	}

	// go through all the polygons and project them onto
	// the sky box to see which blocks on each side need
	// to be drawn
	RB_ClipSkyPolygons( &tess );

	// r_showsky will let all the sky blocks be drawn in
	// front of everything to allow developers to see how
	// much sky is getting sucked in
	if ( r_showsky->integer ) {
		qglDepthRange( 0.0, 0.0 );
	} else {
		qglDepthRange( 1.0, 1.0 );
	}

	// draw the outer skybox
	if ( tess.shader->sky.outerbox[0] && tess.shader->sky.outerbox[0] != tr.defaultImage ) {
		mat4_t oldmodelview;
		
		GL_State( 0 );
		//qglTranslatef (backEnd.viewParms.or.origin[0], backEnd.viewParms.or.origin[1], backEnd.viewParms.or.origin[2]);

		{
			// FIXME: this could be a lot cleaner
			mat4_t trans, product;

			Mat4Copy( glState.modelview, oldmodelview );
			Mat4Translation( backEnd.viewParms.or.origin, trans );
			Mat4Multiply( glState.modelview, trans, product );
			GL_SetModelviewMatrix( product );

		}

		DrawSkyBox( tess.shader );

		GL_SetModelviewMatrix( oldmodelview );
	}

	// generate the vertexes for all the clouds, which will be drawn
	// by the generic shader routine
	R_BuildCloudData( &tess );

	RB_StageIteratorGeneric();

	// draw the inner skybox


	// back to normal depth range
	qglDepthRange( 0.0, 1.0 );

	// note that sky was drawn so we will draw a sun later
	backEnd.skyRenderedThisView = qtrue;
}
Beispiel #3
0
/*
 * RB_StageIteratorSky
 *
 * All of the visible sky triangles are in tess
 *
 * Other things could be stuck in here, like birds in the sky, etc
 */
void
RB_StageIteratorSky(void)
{
	if(r_fastsky->integer){
		return;
	}

	/* go through all the polygons and project them onto
	 * the sky box to see which blocks on each side need
	 * to be drawn */
	RB_ClipSkyPolygons(&tess);

	/* r_showsky will let all the sky blocks be drawn in
	 * front of everything to allow developers to see how
	 * much sky is getting sucked in */
	if(r_showsky->integer){
		qglDepthRange(0.0, 0.0);
	}else{
		qglDepthRange(1.0, 1.0);
	}

	/* draw the outer skybox */
	if(tess.shader->sky.outerbox[0] && tess.shader->sky.outerbox[0] != tr.defaultImage){
		qglColor3f(tr.identityLight, tr.identityLight, tr.identityLight);

		qglPushMatrix ();
		GL_State(0);
		qglTranslatef (backEnd.viewParms.or.origin[0], backEnd.viewParms.or.origin[1],
			backEnd.viewParms.or.origin[2]);

		DrawSkyBox(tess.shader);

		qglPopMatrix();
	}

	/* generate the vertexes for all the clouds, which will be drawn
	 * by the generic shader routine */
	R_BuildCloudData(&tess);

	RB_StageIteratorGeneric();

	/* draw the inner skybox */


	/* back to normal depth range */
	qglDepthRange(0.0, 1.0);

	/* note that sky was drawn so we will draw a sun later */
	backEnd.skyRenderedThisView = qtrue;
}
Beispiel #4
0
/*
================
RB_StageIteratorSky

All of the visible sky triangles are in tess

Other things could be stuck in here, like birds in the sky, etc
================
*/
void RB_StageIteratorSky( void ) {
	if ( r_fastsky->integer ) {
		return;
	}

	// go through all the polygons and project them onto
	// the sky box to see which blocks on each side need
	// to be drawn
	RB_ClipSkyPolygons( &tess );

	// r_showsky will let all the sky blocks be drawn in
	// front of everything to allow developers to see how
	// much sky is getting sucked in
	if ( r_showsky->integer ) {
		glDepthRangeX( GFIXED_0, GFIXED_0 );
	} else {
		glDepthRangeX( GFIXED_1, GFIXED_1 );
	}

	// draw the outer skybox
	if ( tess.shader->sky.outerbox[0] && tess.shader->sky.outerbox[0] != tr.defaultImage ) {
		glColor4X( tr.identityLight, tr.identityLight, tr.identityLight,GFIXED_1 );
		
		glPushMatrix ();
		GL_State( 0 );
		glTranslateX (REINTERPRET_GFIXED(backEnd.viewParms._or.origin[0]), 
              		  REINTERPRET_GFIXED(backEnd.viewParms._or.origin[1]), 
			          REINTERPRET_GFIXED(backEnd.viewParms._or.origin[2]));

		DrawSkyBox( tess.shader );

		glPopMatrix();
	}

	// generate the vertexes for all the clouds, which will be drawn
	// by the generic shader routine
	R_BuildCloudData( &tess );

	RB_StageIteratorGeneric();

	// draw the inner skybox


	// back to normal depth range
	glDepthRangeX( GFIXED_0, GFIXED_1);

	// note that sky was drawn so we will draw a sun later
	backEnd.skyRenderedThisView = qtrue;
}
Beispiel #5
0
// All of the visible sky triangles are in tess
//	Other things could be stuck in here, like birds in the sky, etc
void RB_StageIteratorSky( void ) {
    if ( r_fastsky->integer ) {
        return;
    }

    // go through all the polygons and project them onto
    // the sky box to see which blocks on each side need
    // to be drawn
    RB_ClipSkyPolygons( &tess );

    // r_showsky will let all the sky blocks be drawn in
    // front of everything to allow developers to see how
    // much sky is getting sucked in
    if ( r_showsky->integer ) {
        qglDepthRange( 0.0, 0.0 );
    } else {
        qglDepthRange( 1.0, 1.0 );
    }

    // draw the outer skybox
    if ( tess.shader->sky.outerbox[0] && tess.shader->sky.outerbox[0] != tr.defaultImage ) {
        qglColor3f( tr.identityLight, tr.identityLight, tr.identityLight );

        qglPushMatrix();
        GL_State( 0 );
        qglTranslatef ( backEnd.viewParms.or.origin.x, backEnd.viewParms.or.origin.y, backEnd.viewParms.or.origin.z );

        DrawSkyBox( tess.shader );

        qglPopMatrix();
    }

    // generate the vertexes for all the clouds, which will be drawn
    // by the generic shader routine
    R_BuildCloudData( &tess );

    //QTZFIXME: This causes a load of GL errors when postprocessing is active :S
//	RB_StageIteratorGeneric();

    // draw the inner skybox


    // back to normal depth range
    qglDepthRange( 0.0, 1.0 );

    // note that sky was drawn so we will draw a sun later
    backEnd.skyRenderedThisView = qtrue;
}
/*
================
RB_StageIteratorSky

All of the visible sky triangles are in tess

Other things could be stuck in here, like birds in the sky, etc
================
*/
void RB_StageIteratorSky( void ) {
	if ( r_fastsky->integer ) {
		return;
	}

	// go through all the polygons and project them onto
	// the sky box to see which blocks on each side need
	// to be drawn
	RB_ClipSkyPolygons( &tess );

	// r_showsky will let all the sky blocks be drawn in
	// front of everything to allow developers to see how
	// much sky is getting sucked in
	if ( r_showsky->integer ) {
		GFX_SetDepthRange( 0.0, 0.0 );
	} else {
		GFX_SetDepthRange( 1.0, 1.0 );
	}

	// draw the outer skybox
	if ( tess.shader->sky.outerbox[0] && tess.shader->sky.outerbox[0] != tr.defaultImage ) {
        float colorTint[] = {
            tr.identityLight,
            tr.identityLight,
            tr.identityLight
        };

		DrawSkyBox( tess.shader, backEnd.viewParms.or.origin, colorTint );
	}

	// generate the vertexes for all the clouds, which will be drawn
	// by the generic shader routine
	R_BuildCloudData( &tess );

	RB_StageIteratorGeneric();

	// draw the inner skybox


	// back to normal depth range
	GFX_SetDepthRange( 0.0, 1.0 );

	// note that sky was drawn so we will draw a sun later
	backEnd.skyRenderedThisView = qtrue;
}
Beispiel #7
0
void RB_StageIteratorSky()
{
	if ( r_fastsky->integer ) {
		return;
	}

	GL_Program();

	// project all the polygons onto the sky box
	// to see which blocks on each side need to be drawn
	RB_ClipSkyPolygons( &tess );

	CalcSkyBounds();

	// r_showsky will let all the sky blocks be drawn in
	// front of everything to allow developers to see how
	// much sky is getting sucked in
	if ( r_showsky->integer ) {
		qglDepthRange( 0.0, 0.0 );
	} else {
		qglDepthRange( 1.0, 1.0 );
	}

	// draw the outer skybox
	if ( tess.shader->sky.outerbox[0] && tess.shader->sky.outerbox[0] != tr.defaultImage ) {
		qglColor3f( tr.identityLight, tr.identityLight, tr.identityLight );
		qglPushMatrix();
		GL_State( 0 );
		qglTranslatef (backEnd.viewParms.or.origin[0], backEnd.viewParms.or.origin[1], backEnd.viewParms.or.origin[2]);
		DrawSkyBox( tess.shader );
		qglPopMatrix();
	}

	// generate the vertexes for all the clouds (if any)
	// which will be drawn by the generic shader routine
	R_BuildCloudData( &tess );
	if (tess.numVertexes)
		ARB_StageIterator();

	// back to normal depth range
	qglDepthRange( 0.0, 1.0 );
}
Beispiel #8
0
/*
================
RB_StageIteratorSky

All of the visible sky triangles are in tess

Other things could be stuck in here, like birds in the sky, etc
================
*/
void RB_StageIteratorSky( void ) {
	int clearBits = 0;

	if ( r_fastsky->integer ) {
		if (r_fastsky->integer == 2  &&  !(backEnd.refdef.rdflags & RDF_NOWORLDMODEL)) {
			clearBits |= GL_COLOR_BUFFER_BIT;	// FIXME: only if sky shaders have been used
			if (*r_fastSkyColor->string) {
				int v, tr, tg, tb;

				v = r_fastSkyColor->integer;
				tr = (v & 0xff0000) / 0x010000;
				tg = (v & 0x00ff00) / 0x000100;
				tb = (v & 0x0000ff) / 0x000001;

				qglClearColor((float)tr / 255.0, (float)tg / 255.0, (float)tb / 255.0, 1.0);
			} else {
				qglClearColor(0.0f, 0.0f, 0.0f, 1.0f);	// FIXME: get color of sky
			}

			qglClear(clearBits);
		}

		return;
	}

	// go through all the polygons and project them onto
	// the sky box to see which blocks on each side need
	// to be drawn
	RB_ClipSkyPolygons( &tess );

	// r_showsky will let all the sky blocks be drawn in
	// front of everything to allow developers to see how
	// much sky is getting sucked in
	if ( r_showsky->integer ) {
		qglDepthRange( 0.0, 0.0 );
	} else {
		qglDepthRange( 1.0, 1.0 );
	}

	// draw the outer skybox
	if ( tess.shader->sky.outerbox[0] && tess.shader->sky.outerbox[0] != tr.defaultImage ) {
		qglColor3f( tr.identityLight, tr.identityLight, tr.identityLight );

		qglPushMatrix ();
		GL_State( 0 );
		GL_Cull( CT_FRONT_SIDED );
		qglTranslatef (backEnd.viewParms.or.origin[0], backEnd.viewParms.or.origin[1], backEnd.viewParms.or.origin[2]);

		DrawSkyBox( tess.shader );

		qglPopMatrix();
	}

	// generate the vertexes for all the clouds, which will be drawn
	// by the generic shader routine
	R_BuildCloudData( &tess );

	if (tess.numVertexes) {
		// yes, sky has cloud stages
		RB_StageIteratorGeneric();
	}

	// draw the inner skybox

	//FIXME not even done

	// back to normal depth range
	qglDepthRange( 0.0, 1.0 );

	// note that sky was drawn so we will draw a sun later
	backEnd.skyRenderedThisView = qtrue;
}
Beispiel #9
0
/*
================
RB_StageIteratorSky

All of the visible sky triangles are in tess

Other things could be stuck in here, like birds in the sky, etc
================
*/
void RB_StageIteratorSky( void ) {
	if ( r_fastsky->integer ) {
		return;
	}

	// when portal sky exists, only render skybox for the portal sky scene
	if ( skyboxportal && !( backEnd.refdef.rdflags & RDF_SKYBOXPORTAL ) ) {
		return;
	}

	// does the current fog require fastsky?
	if ( backEnd.viewParms.glFog.registered ) {
		if ( !backEnd.viewParms.glFog.drawsky ) {
			return;
		}
	} else if ( glfogNum > FOG_NONE )      {
		if ( !glfogsettings[FOG_CURRENT].drawsky ) {
			return;
		}
	}


	backEnd.refdef.rdflags |= RDF_DRAWINGSKY;


	// go through all the polygons and project them onto
	// the sky box to see which blocks on each side need
	// to be drawn
	RB_ClipSkyPolygons( &tess );

	// r_showsky will let all the sky blocks be drawn in
	// front of everything to allow developers to see how
	// much sky is getting sucked in
	if ( r_showsky->integer ) {
		qglDepthRange( 0.0, 0.0 );
	} else {
		qglDepthRange( 1.0, 1.0 );
	}

	// draw the outer skybox
	if ( tess.shader->sky.outerbox[0] && tess.shader->sky.outerbox[0] != tr.defaultImage ) {
		qglColor3f( tr.identityLight, tr.identityLight, tr.identityLight );

		qglPushMatrix();
		GL_State( 0 );
		qglTranslatef( backEnd.viewParms.or.origin[0], backEnd.viewParms.or.origin[1], backEnd.viewParms.or.origin[2] );

		DrawSkyBox( tess.shader );

		qglPopMatrix();
	}

	// generate the vertexes for all the clouds, which will be drawn
	// by the generic shader routine
	R_BuildCloudData( &tess );

	RB_StageIteratorGeneric();

	// draw the inner skybox
	// Rafael - drawing inner skybox
	if ( tess.shader->sky.innerbox[0] && tess.shader->sky.innerbox[0] != tr.defaultImage ) {
		qglColor3f( tr.identityLight, tr.identityLight, tr.identityLight );

		qglPushMatrix();
		GL_State( 0 );
		qglTranslatef( backEnd.viewParms.or.origin[0], backEnd.viewParms.or.origin[1], backEnd.viewParms.or.origin[2] );

		DrawSkyBoxInner( tess.shader );

		qglPopMatrix();
	}
	// Rafael - end

	// back to normal depth range
	qglDepthRange( 0.0, 1.0 );

	backEnd.refdef.rdflags &= ~RDF_DRAWINGSKY;

	// note that sky was drawn so we will draw a sun later
	backEnd.skyRenderedThisView = qtrue;
}