Jump to content

Recommended Posts

Hello F/A-18 pilots and LUA programmers,

 

Using the provided display preset to export the left and right DDI's on the same monitor.

I can use those because of my ultrawide.

The DDI's are not readable without a background.

 

i managed to add a mesh to the DDI's but i cant get them to be fully opaque.

 

This is the code used in MPD_BASE.lua. the colour of the material is for debug purposes.

 

Spoiler

    ----------------------------------
    --SetCustomScale(Diameter)    --     <-- keeps scale for noisebar and symbols as in referenced definition lua
    local MPDBasefp_BG                = CreateElement "ceMeshPoly"
    MPDBasefp_BG.name            = "MPDBasefp_BG"
    MPDBasefp_BG.primitivetype    = "triangles"
    MPDBasefp_BG.vertices        =  {{0,0},     --  <-- coordinates for 4 vertices with origin in center of indicator
                         {100,0},
                        {100,100},
                        {0,100}}
    MPDBasefp_BG.indices         = default_box_indices
    MPDBasefp_BG.init_pos        = {0.0,0.0,10}    --[[ moves polygon into frontpanel. Less disturbing if you keep indicator renderable in the 3D cockpit! ]]
    MPDBasefp_BG.material       = MakeMaterial("",{50,50,0,2000})
    Add(MPDBasefp_BG)
    ----------------------------------

 

The goal is to get the yellow square to be fully opaque so i can make it black and use it as the background.

 

Thanks for the help in advanced,

NCC1701JR

DDI-screenshot-full.png

DDI-screenshot.png

MPD_base.lua

Link to post
Share on other sites

 MPDBasefp_BG.material       = MakeMaterial("",{50,50,0,2000})

this is the thing. you must put your material properl. the material is RGBO [Red-Green-Blue-Opacity] in a base from 0 to 255. try changing the 2000 to 255. either way, the things that ain't black or white tend to be less opaque.

Link to post
Share on other sites

LUA defaults the higher value to 255. changing the opacity to 255 has no visable effect.

 

it also seems that the closer the colour gets to black the less visable it becomes. its like black can never be drawn as there is no colour.

That would also mean that the format is not strictly RGBO.

 

changing the material to: MPDBasefp_BG.material       = MakeMaterial("",{0,0,0,255}) makes is completly opaque again.

Link to post
Share on other sites
3 hours ago, NCC1701JR said:

LUA defaults the higher value to 255. changing the opacity to 255 has no visable effect.

 

it also seems that the closer the colour gets to black the less visable it becomes. its like black can never be drawn as there is no colour.

That would also mean that the format is not strictly RGBO.

 

changing the material to: MPDBasefp_BG.material       = MakeMaterial("",{0,0,0,255}) makes is completly opaque again.

I've also noticed that you have MakeMaterial("",{0,0,0,255}) instead of MakeMaterial(nil,{0,0,0,255}) that nil might be helpful, basically on the first one you are saying that there is a texture without name while on the seccond one you are saying that you don't have a texture.

Link to post
Share on other sites
18 hours ago, gonano4 said:

I've also noticed that you have MakeMaterial("",{0,0,0,255}) instead of MakeMaterial(nil,{0,0,0,255}) that nil might be helpful, basically on the first one you are saying that there is a texture without name while on the seccond one you are saying that you don't have a texture.

 

Good suggestion. no joy however.

 

There must be some opacity setting somewhere that ensures that only colours get shown but black is left unrendered due to RGB of {0,0,0}.

Link to post
Share on other sites
17 hours ago, NCC1701JR said:

 

Good suggestion. no joy however.

 

There must be some opacity setting somewhere that ensures that only colours get shown but black is left unrendered due to RGB of {0,0,0}.

try white wich is 255 255 255 and mess up with the 4th number

Link to post
Share on other sites

Thank you everyone for the suggestions

 

I got it fixed via an entire different method:

 

uncommenting line 52 in MPD_common_bake_page.lua

this make sure that the background is fully rendered.

  • Like 1
Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...