RenderToTexture


(KillerWhale) #1

I was looking into some of the new 2.60 engine functions and came across the render to “RenderToTexture” function. There’s a example in the 2.60 source in cg_limbopanel.c at the bottom of CG_DrawPlayerHead():


//bani - render to texture api example
//draws the player head on one of the fueldump textures.
#ifdef TEST_API_RENDERTOTEXTURE
	{
		static int texid = 0;

		if( !texid ) {
			texid = trap_R_GetTextureId( "textures/stone/mxsnow3.tga" );
		}
		trap_R_RenderToTexture( texid, 0, 0, 256, 256 );
	}
#endif

It seems to give some strange results for me if I enable this piece of code:

Notice the bands across the level (which is textures/stone/mxsnow3.tga) and the helmet screws up. I also noticed it doesn’t happen to all helmets and sometimes it happens to the players face in the hud too.
Is this normal, if not what is it supposed to do? Is there some setting you have to enable to fix this?


(Shanks) #2

When I tried it the snow would chage colour every time I moved…


(KillerWhale) #3

Those bands change color when you move, but I can’t say that it “draws the player head on one of the fueldump textures” like it says in the comment.


(Shanks) #4

Well this is what I get when I use the code…


(Jaquboss) #5

Get better hardware :stuck_out_tongue: , for me it renders head on those without problem , but it changes it colors too , ( to blue , but not so aggresive as for bacon )
however it works when it is used somewhat else , http://img.photobucket.com/albums/v690/jaquboss/2005-04-14-232404-tobruk.jpg


(KillerWhale) #6

hmm, strange, my graphics card is not that old and it runs newer games like Halflife 2 and Doom 3 fine. It must be using some weird videocard render methode, I’ll try upgrading my vid drivers.