Sign in to follow this  

Render To texture question

This topic is 4078 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, i'm not sure how to render to texture. i wan't to render my scene to a texture and then display the texture on a quad. I have seen examples of this with effects that are doing it in two passes...but how should i handle the rendertarget switch? should i use multiple rendertargets to create this effect? or should i create a additional rendertarget and switch between the main rendertarget and my new rendertarget? You can't change rendertarget between two passes...right? or? something like this:

// Sceen render to texture

Clear(D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER)

	BeginScene()

		GetRenderTarget(main rendertarget)
		SetRenderTarget(new rendertarget)
		RenderSceen();
		SetRenderTarget(main rendertarget);
	EndScene()

// quad render



Clear(D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER)

	BeginScene()
		Render Quad with texture;
	EndScene()

Present();



above is not possible to do in a effect with two passes... maybe there is a better solution than this, my question is: how to performe render to texture in the "correct way"

Share this post


Link to post
Share on other sites

This topic is 4078 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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