Draw dynamic shapes on a rendered texture

Started by
15 comments, last by dave09cbank 8 years, 4 months ago

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.

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.

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.

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

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.

By dynamic do you mean generated on the CPU every frame?

-potential energy is easily made kinetic-

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.

Hi InfiSearch,

Yes by dynamic i mean on every frame render.

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.

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.

-potential energy is easily made kinetic-

This topic is closed to new replies.

Advertisement