Sign in to follow this  
Alex Red

SetRenderTarget & Scene...

Recommended Posts

Alex Red    136
Hi guys... a Curiosity... I wanna to render on a texture to be used on another render surface ( the main one e.g. the Display )... I wonder, if the SetRenderTarget(s)can be used the following BeginScene() SetRenderTarget(MainSurface) Draw() SetRenderTarget(Texture) Draw() SetRenderTarget(MainSurface) Draw(texture) EndScene() Basically, I'd like to know if it is possible to change a render target in the middle of a scene, or have I to close the previous scene, and open another one...? tnx [R]ed

Share this post


Link to post
Share on other sites
Demirug    884
You need to call BeginScene and EndScene only once per frame. You can change the render target anytime. Inside or Outside the BeginScene/EndScene pair makes no difference.

Most cards ignore these two calls anyway I have seen commercial games that don’t even use them. But you should NOT do this as is against the rules and the debug runtime would not render anything if you use draw methods outside the BeginScene/EndScene pair.

Share this post


Link to post
Share on other sites
Alex Red    136
Tnx Demirug...
I forgot one particular, I am updating from a DX7 engine, but for now have to fix this still in DX7...
I suppoose this is still valid for old DX7 times...

tnx

[R]ed

Share this post


Link to post
Share on other sites
Demirug    884
Yes, this had never changed as today’s D3D9 driver are only extended D3D7 driver.

I hope your D3D7 engine already use VertexBuffer. During a project I have learned that rendering without vertex buffers is much faster in D3D7 as in D3D9.

Share this post


Link to post
Share on other sites
Alex Red    136
he..he.. it is tnx...
I have created a Vertex Buffer manager, working like an HD FAT, being this game something with a Objects DB of about 7000 items, and loaded on the fly while playing in different areas...

It was not present before, and this is already DX9 compliant...he..he..


tnx

[R]ed

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this