Render-to-Texture at an ObjectWorldTransform

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Post Reply
BenBaron
Posts: 80
Joined: Fri Jan 16, 2015 7:51 am

Render-to-Texture at an ObjectWorldTransform

Post by BenBaron »

Hi guys,

I would like to render something into view using the Rendering Services. I've experimented with the IObjectRendererV440 but especially the facility to render text seems to be limited, at least up to now (esp. size and font). The SDK details something on how to render directly into a texture in the Money Bravo's VC, which is created by

Code: Select all

spPluginSystem->CreateTexture(TEXT("CursorTexture"), RTT_WIDTH, RTT_HEIGHT, spTexturePlugin);
and referenced in the panel.cfg

Code: Select all

texture00=CursorTexture, 0,0,765,500
I'd need this facility, but outside of the user aircraft, to render at an ObjectWorldTransform. Ideally, I'd like to render into a texture which is referenced not by the panel.cfg but by a .mdl which is place at a position in the world.

Is it possible to do this with currently available methods and if yes, how can this be done?

Thanks in advance.

All the best,

Benny
BenBaron
Posts: 80
Joined: Fri Jan 16, 2015 7:51 am

Re: Render-to-Texture at an ObjectWorldTransform

Post by BenBaron »

I came to the conclusion that what I am trying to achieve doesn't seem to be possible, at the moment, as the rendered texture is limited to be referencable externally only via the the panel.cfg like in the Mooney's example.

Thinking further, maybe the ObjectRenderer could be expanded in the future to allow for a functionality where one could render custom content or textures directly onto one of the primitives.

Greets,

Benny
BenBaron
Posts: 80
Joined: Fri Jan 16, 2015 7:51 am

Re: Render-to-Texture at an ObjectWorldTransform

Post by BenBaron »

Hi guys,

I got further with this...regarding the render-to-texture functionality:

As I said, I am fairly new to using DirectX, the render pipeline and everything related. However, I can now render into a texture which is referenced in a .mdl. So far, so good, but now, I ran into the following issue with my test setup:

At first, I am calculating the distance from the user aircraft to a spawned object which is referencing above mentioned texture. Then, I am rendering the calculated distance for display into the texture. However, I am noticing some kind of "lag" in the displayed number, when I am moving my aircraft. And I don't know yet, where this might be coming from. As far as I understood, the Render(IRenderDataV400* pRenderData) method is supposed to be called on every visible frame, right?

Might also be, that I am doing something wrong with the underlying buffers, but before I delve into that I wanted to ask, if there was something with the way the Render() method works which could prevent "real time rendering" and explain the lag, anyways.

Any hint is highly appreciated.

All the best,

Benny
Post Reply