(05-20-2016 01:13 PM)Esenthel Wrote: You might want to check this tutorial:
UID(240031802, 1298250585, 1065203598, 2912159632) /* Apps\12 - Rendering\13 - Combining Render with Background */
Although it does not give you a texture.
Hi Esenthel ,
i wasn't able to do so , my goal is to render a 2D image with "movement/effect" on some object lets call it
XX (facing the camera in the game) , i thought about two ways to so :
1- apply the 2D image as a material to some mesh and render it before
XX , but then how can i apply the "movement/effect" to the image - movement can be like RippleFX .
2- render to a texture as RippleFX , this i couldn't do , i tried the render to texture tutorial and i added the code :
Code:
void RenderToTexture()
{
Int tex_size=256;
// create the Render Target Texture if it hasn't been created yet
if(!rtt.is())rtt.create(tex_size, tex_size, 1, IMAGE_B8G8R8A8, IMAGE_RT, 1);
// render to texture
Renderer.target=&rtt; // specify custom render target
Renderer(Render); // perform rendering
D.clear(TURQ);
D.fxBegin(); // start drawing to helper screen
D.clearCol();
logo->drawFs(); // image draw
ImageRTPtr fx=D.fxEnd(); // restore default screen drawing, and access the helper screen
// set ripple effect values
RippleFx ripple;
ripple.alpha_add = fx_time;
ripple.alpha_scale=-1;
// draw helper screen with ripple effect
ripple.draw(*fx);
Renderer.target=null; // disable custom render target
}
but the texture drawn black with nothing .
i tried moving the code indside the draw and render functions same result .
can you help please , thanks .