Jump to content
Sign in to follow this  
Ex3B

Help with PIP setup

Recommended Posts

I wanted to add a PIP window to the cockpit of my F-35 port from Arma 2,  so that one can see what the "EOTS" camera sees.

I looked here to start:

https://community.bistudio.com/wiki/Arma_3_Cars_Config_Guidelines

Relevant portions:

Spoiler

Mirrors and screens should have RTT texture: #(argb,256,512,1)r2t(rendertargetX,1.0) - where X in rendertarget should be a number corresponding to the renderTarget memory point.

....

Picture in Picture for screens and mirrors

All sources for textures to be rendered on are defined in class RenderTargets which is a subclass of vehicle class

Each source is a separate subclass with unique name

parameter renderTarget defines which texture shall the source be mapped at (only the rendertargetX part is used)

class CameraView1 is a subclass of this source and contains all the parameters for rendered scene

pointPosition and pointDirection should be respective memory points in model

renderQuality is in range from 0 to 2 and defines quality of rendering for said source

renderVisionMode defines the vision mode - 0 = HDR, 1 = NightVision, 2 = ThermalVision, 3 = Color, 4 = Mirror

fov defines field of view of this source

BBoxes defines bounding boxes for selected r2t texture. When selected bounding box is beyond player view, r2t source will be no longer rendered saving performance for other Picture in Picture windows. Bounding boxes doesn't need to be very precise - method to calculate their is not 100% accurate to maximize performance.

{config.cpp}

class RenderTargets

{

     class LeftMirror

          {

          renderTarget = "rendertarget0";

          class CameraView1

               {

               pointPosition = "PIP0_pos";

               pointDirection = "PIP0_dir";

               renderQuality = 2;

               renderVisionMode = 0;

               fov = 0.7;

               };

          BBoxes[] = {PIP0_TopLeft,PIP0_TopRight,PIP0_BottomLeft,PIP0_BottomRight};

          };

};

I also looked in the .cfg of the Blackfoot.

 

In the .cfg file of my port, I added:

Spoiler

        class RenderTargets
        {
            class mfd
            {
                renderTarget="rendertarget0";
                class CameraView1
                {
                    pointPosition="PilotCamera_pos";
                    pointDirection="PilotCamera_dir";
                    renderVisionMode=2;
                    renderQuality=2;
                    fov=0.1;
                    turret[]={0};
                };
                BBoxes[]=
                {
                    "PIP_0_TL",
                    "PIP_0_TR",
                    "PIP_0_BL",
                    "PIP_0_BR"
                };
            };
        };

PilotCamera_Pos and PilotCamera_dir refer to memory points defined in the memory layer (right term?) of the .p3d model, but are also defined in the level 1 and 2 LODs... for "good measure" I put them in the pilot view layer as well (not sure which ones to get rid of)

I added a facet/square polygon to the cockpit of my F-35, It has 4 vertices, each of which is also its own selection named:

                {
                    "PIP_0_TL",
                    "PIP_0_TR",
                    "PIP_0_BL",
                    "PIP_0_BR"
                };

The facet I assigned a texture of:

#(argb,256,512,1)r2t(rendertarget0,1.0)

 

It shows up as black in game.

 

I can't find any sample model with working PIP to use as a guide, so I was hoping that someone here could  tell me what I'm doing wrong, or what I am missing to make the PIP work, so that I can have a window in the cockpit view showing the targeting camera's view.

 

Cheers

 

 

 

 

Share this post


Link to post
Share on other sites

Might be silly question but is PiP working for you on other vehicles?

Share this post


Link to post
Share on other sites

Yes, PIP works on other vehicles, such as the ah-99, and the various mirrors on various cars

Share this post


Link to post
Share on other sites

Try maybe if it's working without BBoxes & turret param. This way we can rule out that it's not issue with incorrect setup of those params

Share this post


Link to post
Share on other sites

Just tried, commented those things out, and it doesn't work.

I think I may be lacking a memory point.

The wiki says:

Quote

Mirrors and screens should have RTT texture: #(argb,256,512,1)r2t(rendertargetX,1.0) - where X in rendertarget should be a number corresponding to the renderTarget memory point.

I don't have a "renderTarget" memory point... but I have no idea what that should be, as there are no sample models... does that memory point correspond to the camera viewpoint?

Can I just make a new selection where the point for "PilotCamera_pos" is also a selection named "renderTarget", "renderTarget0"

 

As I said, there's no example to look at, so I have no idea what this memory point should be

Share this post


Link to post
Share on other sites

PilotCamera_pos & dir should be only in memory LOD

 

11 minutes ago, Ex3B said:

Mirrors and screens should have RTT texture: #(argb,256,512,1)r2t(rendertargetX,1.0) - where X in rendertarget should be a number corresponding to the renderTarget memory point.

Translation:

#(argb,256,512,1)r2t(rendertargetX,1.0) 

need to match renderTarget defined in class RenderTargets
 

renderTarget="rendertargetX";

You can name it whatever you like btw, they only need to match though. Could you perhaps attach model with just Memory LOD & mirrors in pilot LOD? I would suspect that either UV maping of mirrors is wrong or perhaps those mirrors are part of some camo selection and they are overridden by hiddenSelections

Share this post


Link to post
Share on other sites
4 minutes ago, reyhard said:

PilotCamera_pos & dir should be only in memory LOD

 

Translation:


#(argb,256,512,1)r2t(rendertargetX,1.0) 

need to match renderTarget defined in class RenderTargets
 


renderTarget="rendertargetX";

 

I've done that

 

Quote

You can name it whatever you like btw, they only need to match though. Could you perhaps attach model with just Memory LOD & mirrors in pilot LOD? I would suspect that either UV maping of mirrors is wrong or perhaps those mirrors are part of some camo selection and they are overridden by hiddenSelections

You want me to share the model?

Also, I don't recall doing anythingto set up the UV mapping, maybe that is the problem

Share this post


Link to post
Share on other sites
2 minutes ago, Ex3B said:

I've done that

 

You want me to share the model?

Also, I don't recall doing anythingto set up the UV mapping, maybe that is the problem

P3D with View Pilot containing screen + memory LOD should be enough to debug. If you haven't done anything to UVs then I guess it might be your issue though 😉

Share this post


Link to post
Share on other sites

Was busy and didn't have time to follow up until now... what do I do to set up the UV mapping?

In object builder, I added 4 vertices, made them into a face, and from face properties gave it the texture: #(argb,256,512,1)r2t(rendertarget0,1.0)

I see there is a place to assign an rvmat... I tried a3\air_f_jets\plane_fighter_01\data\mfd\fighter_01_mfd_01.rvmat

but it still doesn't work.

I'll send the config and the model (the surface for the PIP is just a placeholder for now.. my plan was to get it working, then move it in position)

Share this post


Link to post
Share on other sites

Ok, so I got a UV mapped polygon working, and I see a PiP effect...

The problem is that it is fixed forward instead of showing where the pilto camera is looking, has a lower render distance, and doesn't change vision modes according to the pilot camera.

 

What I want is the same display that you can get in a mini-display (like the radar and GPS/map mini-window displays) to be shown by default in the cockpit, rather than  just in a floating box on the screen.

 

Is this possible?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×