Render To Texture
Posted: Tue Sep 22, 2009 07:23
Hi,
I've finished render the 3d scene to GUI(StaticImage here),the problem I encountered is that I just want to render my player to the StaticImage, but what I get is that my player and black background altogher are rendered to the StaticImage, which lead to a black square(the dimension of StaticImage) who takes the player.What I want is just a player rendered at the StaticImage area, the remain pixel of the StaticImage is transparent, from this we can see the background image.
My Layout likes follow:
////////////////////////////////////////////////////////////////
//....................................................................................//
//....................................................................................//
//....................................................................................//
//....................................................................................//
//..........Background Image occupy the full game area......................//
//....................................................................................//
//....................................................................................//
//...///StaticImage/////........................................................//
//...//...................//........................................................//
//...//..Player..........//........................................................//
//...//...................//........................................................//
//...//...................//........................................................//
//...//////////////////........................................................//
////////////////////////////////////////////////////////////////
Player shouldn't occupy all of the StaticImage area, the other pixels of StaitcImage should be Background Image
I've finished render the 3d scene to GUI(StaticImage here),the problem I encountered is that I just want to render my player to the StaticImage, but what I get is that my player and black background altogher are rendered to the StaticImage, which lead to a black square(the dimension of StaticImage) who takes the player.What I want is just a player rendered at the StaticImage area, the remain pixel of the StaticImage is transparent, from this we can see the background image.
My Layout likes follow:
////////////////////////////////////////////////////////////////
//....................................................................................//
//....................................................................................//
//....................................................................................//
//....................................................................................//
//..........Background Image occupy the full game area......................//
//....................................................................................//
//....................................................................................//
//...///StaticImage/////........................................................//
//...//...................//........................................................//
//...//..Player..........//........................................................//
//...//...................//........................................................//
//...//...................//........................................................//
//...//////////////////........................................................//
////////////////////////////////////////////////////////////////
Player shouldn't occupy all of the StaticImage area, the other pixels of StaitcImage should be Background Image