NCC1701JR Posted April 27, 2021 Share Posted April 27, 2021 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 MPD_base.lua 1 Link to comment Share on other sites More sharing options...
gonano4 Posted April 28, 2021 Share Posted April 28, 2021 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 comment Share on other sites More sharing options...
NCC1701JR Posted April 28, 2021 Author Share Posted April 28, 2021 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 comment Share on other sites More sharing options...
gonano4 Posted April 28, 2021 Share Posted April 28, 2021 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 comment Share on other sites More sharing options...
NCC1701JR Posted April 29, 2021 Author Share Posted April 29, 2021 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 comment Share on other sites More sharing options...
gonano4 Posted April 30, 2021 Share Posted April 30, 2021 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 comment Share on other sites More sharing options...
NCC1701JR Posted April 30, 2021 Author Share Posted April 30, 2021 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. 2 Link to comment Share on other sites More sharing options...
redberet Posted June 6, 2021 Share Posted June 6, 2021 @NCC1701JRcan you post a picture of your results and a picture of the .lua code to make it happen please. I'm close but i cannot figure it out yet. 2 Link to comment Share on other sites More sharing options...
Recommended Posts