Render objects inside the cockpit, possible?

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.
Locked
User avatar
amengol
Posts: 77
Joined: Thu Nov 03, 2011 5:21 am
Location: Richmond, BC
Contact:

Render objects inside the cockpit, possible?

Post by amengol »

Hi LM team and community,

I'm trying to render external SimObjects inside the virtual cockpit of any aircraft. The problem is that the interior of the aircraft (the "virtual cockpit") is being rendered after the other objects, and overwriting the pixels of the "external" object.

Is there a way (a flag somewhere) to defer the render of a specific object to the same pass of the Virtual Cockpit?

Thanks,

Jorge.
Cheers,

Jorge Amengol
obinder
Posts: 145
Joined: Sun Jun 08, 2014 9:43 am

Re: Render objects inside the cockpit, possible?

Post by obinder »

Hi,

I think what you are looking for is the Clipmode parameter in the camera definitions. The Clipmode decides that objects that are closer than a certain distance to the viewpoint are not rendered at all.

As a test, create your object in the cockpit, for example a pilot, then go to an outside view and look back at the aircraft - you should be able to see the pilot with the outside camera, while with the VC camera the object is simply too close.
Even Clipmode = Minimum does not give you enough range.

I have already been there, I have implemented something similar a while ago (= place a copilot in any aircraft). But for elements inside of the VC the only option seems to be to integrate them into the internal 3D model.

Best regards
Oliver Binder
Lorby-SI
User avatar
amengol
Posts: 77
Joined: Thu Nov 03, 2011 5:21 am
Location: Richmond, BC
Contact:

Re: Render objects inside the cockpit, possible?

Post by amengol »

Hi Oliver,

Thanks for answering, but that is not it. I had already overwritten the near clip to be able to see the attached SimObject "inside" the cockpit. From the outside view, everything is fine, but I think the Engine renders the inside view last and everything that is part of the cockpit, with the exception of the windows (that has alpha to blend with the environment) gets overwritten in the view port and I can only see parts of the object that blends with the windows, although they are "physically" inside the cockpit.

Basically: The engine renders "the world" and than it renders the "virtual cockpit" on top of it, you know what I mean?

My question is if there is any way to render that object in the same pass as the "interior" cockpit.

Jorge.
Cheers,

Jorge Amengol
obinder
Posts: 145
Joined: Sun Jun 08, 2014 9:43 am

Re: Render objects inside the cockpit, possible?

Post by obinder »

Hello Jorge,

I don't think that your assumption is correct. If you stay in the VC view and move the eyepoint away from your object, it will appear - because it has been clipped.

Try it, you will see what I mean. If your eyepoint is far enough away from the object, it will appear in VC view too.

See these shots: the Sidewinder is visible both from the outside and the inside = VC view.

Image

Image

Best regards
Oliver Binder
Lorby-SI
obinder
Posts: 145
Joined: Sun Jun 08, 2014 9:43 am

Re: Render objects inside the cockpit, possible?

Post by obinder »

To prove my point, I am taking a couple of guys on a ride. Just don't try to fly with Avatars as passengers, the animations logic will make them do odd things...see last pic...

Image

Image

Image

Image

Best regards
Oliver Binder
Lorby-SI
User avatar
amengol
Posts: 77
Joined: Thu Nov 03, 2011 5:21 am
Location: Richmond, BC
Contact:

Re: Render objects inside the cockpit, possible?

Post by amengol »

Hi Oliver,

Thanks so much for taking the time for this.

I guess we were both right. I was using v4.0 and I'm pretty sure something was off back then with the render.

I just updated to v4.2 and I got it rendering right, inside the cockpit as you picture showed. Too bad I did not take a SS to put it here for what was happening before.
I made a clean install, and the funny thing is that I did not change the near clip for this one and it is rendering just as it should. Technically speaking, I think they are now using the same render pass for the Attached SimObject and the "interior" model. That makes sense. Or, they are now being rendering all together, which would be tough to do because the clipping area for this would be gigantic. I'm tending for the multi pass for these two types because I'm not getting any flickering of objects in the horizon as the reduction of the near clip would result (the Z fighting). I should have been working with the latest P3D version, my bad. :)

Just as a side note, I know LM is using Multipass (deferred render) because of the post-processing effects. What I was not sure was about the "normal" and "interior" mode being rendered in different passes.

Ah, I have been there testing attaching Avatars and saw that LoL. This is because it has its own simulation, and its animations are probably triggered based on situations like axis velocity etc.

Thanks again for sharing your findings and thoughts.

Jorge.
Cheers,

Jorge Amengol
obinder
Posts: 145
Joined: Sun Jun 08, 2014 9:43 am

Re: Render objects inside the cockpit, possible?

Post by obinder »

Hello Jorge,

I appreciate your knowledge about rendering, but I still think that you are wrong in this particular instance. I wrote PayloadManager X for P3D V2/3, almost 2 years ago, and that is where I noticed the clip behavior. When I moved my eyepoint away from my copilot, it reappeard, in VC view too.

Never mind, I just remembered that I have P3D V3 still installed, and checked it out too - I can't reproduce my original observation either. So I am leaning more towards your explanation than my own, sorry for the confusion.

But that is water under the bridge now, because things have obviously changed for the better in 4.2

Best regards
Oliver Binder
Lorby-SI
User avatar
amengol
Posts: 77
Joined: Thu Nov 03, 2011 5:21 am
Location: Richmond, BC
Contact:

Re: Render objects inside the cockpit, possible?

Post by amengol »

Hi Oliver,

No worries. Yes, v4.2 improved a lot.
Perhaps some inside information from the LM team will elucidate this matter in the future.

Cheers,

Jorge.
Cheers,

Jorge Amengol
User avatar
DaveWG
Posts: 66
Joined: Mon Apr 09, 2012 12:15 pm

Re: Render objects inside the cockpit, possible?

Post by DaveWG »

Apologies for going slightly off topic, Oliver what is that program you are using there? I assume it's one of yours?
obinder
Posts: 145
Joined: Sun Jun 08, 2014 9:43 am

Re: Render objects inside the cockpit, possible?

Post by obinder »

DaveWG wrote: Mon Jun 25, 2018 9:08 am Apologies for going slightly off topic, Oliver what is that program you are using there? I assume it's one of yours?
Hello Dave,

The PayloadManagerX? Yes, that is one of mine. I wrote it a while back to be able to attach auxiliary tanks to fighters with short legs (it handles the fuel transfer too) and aerial refueling. But you can basically attach anything to everything, even AI.

If you want to try it, please send me a PM (if you have one of my apps, the email address is on the last page of the manual - or use the contact form on the Lorby website). I have to warn you though, I wrote that one for my own use, so there is no documentation. But I will write at least a readme if there is genuine interest in the app.

Best regards
Oliver Binder
Lorby-SI
obinder
Posts: 145
Joined: Sun Jun 08, 2014 9:43 am

Re: Render objects inside the cockpit, possible?

Post by obinder »

Hello Dave and @ll interested,

the PayloadManager X is available as a free download on the Lorby-SI website now.

Please be mindful that I wrote this app for my own use, so it is not a polished product. I wrote a small users manual for it, and the release status is strictly as "prototype". Still, you can expect that all features that are mentioned in the doc are actually working.

Best regards
Oliver Binder
Lorby-SI
User avatar
DaveWG
Posts: 66
Joined: Mon Apr 09, 2012 12:15 pm

Re: Render objects inside the cockpit, possible?

Post by DaveWG »

Thanks Oliver, I was just about to drop you an email! :)
Locked