Skip to main content
gamedev.net
🔒 Locked

RenderTarget

Started by edwinnie 3 replies 2.8k views
Original Post
edwinnie
edwinnie
hihi! i was wondering what this error is trying to convey: Direct3D9: (WARN): Can not render to a render target that is also used as a texture. A render target was detected as bound, but couldn't detect if texture was actually used in rendering. i did activate my render target, render something to it, then deactivate it. I suppose when we called RenderToSurface->BeginScene( surface ), the rendered image will be bound to the texture that describes the surface. I also used another separate pass to try to output the details in the render texture through a fragment program. I did call a SetTexture() using the rendered texture. anyone knows? thx! Edwinz
RenderTarget
RenderTarget
Are you making sure the rendertarget isn't set as a texture when you begin? SetTexture( i, NULL ) will make sure to turn off any textures you have set in stage i. Make sure the rendertarget isn't actually set.
[sub]My spoon is too big.[/sub]
edwinnie
edwinnie
hihi RenderTarget!

hmm...i think i am kinda confusing abt using a render target and a render to surface. Ok, basically i jus wanted to do a render to texture without encountering that warning.

simply jus doing this will get the warning:
//offscreen passSurface* rtt_surface = texture->GetSurfaceLevel(0);m_RenderToSurface->BeginScene(rtt_surface);//draw somethingm_RenderToSurface->EndScene(Filter::None);//framebuffer passSetTexture( texture );//draw to framebuffer


somehow adding the SetTexture() call will generate the error, but off course, it is needed for the pixel shader...

Quote:

Are you making sure the rendertarget isn't set as a texture when you begin?


i am not sure what you meant. I did not have SetRenderTarget or GetRenderTarget calls.

thx!
Edwinz
RenderTarget
RenderTarget
Put rtt_surface->Release() before the SetTexture() call. See if that helps. (Maybe?)

[sub]My spoon is too big.[/sub]
edwinnie
edwinnie
hihi!
EDIT: hey! that SetTexture(0, NULL); just did the trick.
so now i understand: i am actually rendering to the offscreen surface with the texture bound. And i need to release it first!

thx!
Edwinz

[Edited by - edwinnie on July 12, 2004 1:12:07 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.