Jump to content
  • Advertisement
Sign in to follow this  
dave09cbank

Draw dynamic shapes on a rendered texture

This topic is 1094 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

Hi 

I am trying to render dynamic shapes (using triangles) on a rendered texture but not quite sure how to approach this.

Dynamic shapes can be of any number or sizes which i need to render on top of my rendered texture. 

At a later point, these shapes can then further be used to render another image as a texture.

 

Any suggestion or help would be great.

 
 
PS: I am still learning DirectX 11.

 

 

Thanks.

Edited by dave09cbank

Share this post


Link to post
Share on other sites
Advertisement

You could render your scene in which ever manner you need to "simulate" your desired texture and then copy the results from the backbuffer into a texture buffer.

Share this post


Link to post
Share on other sites

Thanks for the reply ExErvus. 

I'm still a bit confused as to how "copying of the results from the backbuffer into a texture buffer" would enable me to draw dynamic shapes onto my rendered texture . 

 
Also my shapes are not drawn initially when the rendering start but rather during the rendering  cycle.

It would be great if you could explain this alongside any example or pseudo code if possible.

Thanks.

Edited by dave09cbank

Share this post


Link to post
Share on other sites

What part are you having trouble with? Actually drawing the shapes? Or rendering to a render target that is then used as a texture?

Share this post


Link to post
Share on other sites

I'm actually having confusion as to really how  to draw onto the rendered texture. 

But having trouble as to figuring this out or understanding as to how this would be approached 

So say eg:

 

1 I render an image as a texture
2. Next ,after the image has been rendered onto the screen i wish to draw onto it say a triangle and fill it with color red. [ Hence i am being confused & having trouble with as to how to draw shapes onto this rendered texture]

 

I could be complicating things things in my head or maybe just not understanding.

 

Thanks.

Share this post


Link to post
Share on other sites

Your concept/idea of the steps involved may be the source of your confusion. If you create an object in space and put a background image to it, you don't have to do anything fancy. Create your object using the necessary buffers, draw it in 3d space in front of a full screen quad, and than copy the results to a desired resource.

 


1 I render an image as a texture
2. Next ,after the image has been rendered onto the screen i wish to draw onto it say a triangle and fill it with color red. [ Hence i am being confused & having trouble with as to how to draw shapes onto this rendered texture]

 

This is not a 2 step process. You draw your desired shape via resources and your "texture to draw to" in one step.

Edited by ExErvus

Share this post


Link to post
Share on other sites

thanks for the reply ExErvus.

Correct me if I am wrong.. the concept your referring to is "render to texture" ?

 

Now would this be the right approach if i am performing it on every frame render call ?

 

thanks.

Share this post


Link to post
Share on other sites

I'm sorry I wasn't clear you said "dynamic shapes", what exactly do you mean by this?  Do you mean animated? Do you mean dynamically animated? (like a cloth interacting with another object)

 


Dynamic shapes can be of any number or sizes which i need to render on top of my rendered texture. 

Also when you say this you most likely mean 'render to' but I'm not sure.  Mainly because your use of the term "on top of my rendered texture".

 

The term 'render target' is I think what you're looking for.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!