Jump to content
Sign in to follow this  
Team_P3DSpacePort

XML HUD Gauge in VC - all VECTORS

Recommended Posts

I have educated myself reasonably well in XML gauge programming, thanks to this amazing community with seemingly inexhaustible pool of talent, patience and good will. I tend to check every post I can find and make sure I know as much as I can about the problem before I seek help. But now I'm at the dead end - there seems to be no solution for my problem:I programmed a nice, simple XML Hud VECTOR gauge. There are no bitmaps - all I use are strings, polylines, rects and circles. The gauge behaves well, albeit a bit slow (cuts down on fps). It behaves like any HUD gauge - uniformly lit (although I wish I could get the vectors to exhibit transparency).Then, I implement this in VC (my own design)... and I get unexpected results. Namely, I cannot get this gauge to be constantly luminous. It gets darker when against the sun and lighter when sun shines on it. Now, before everyone jumps on me and says "read the VC lighting tutorial" - hold on! I did, I understand it, everything works as advertised - but not on XML vectors. BMP gauges are fine - turn on the light and they glow. During the day - no glow. When landing lights are on, the Vector HUD is luminous at night (just as it should be) except the background polygon (the $VCPanel.bmp dummy that is used to render the VC gauges on) becomes visible! Turn the lights off - the big black poly vanishes and the gauge becomes dim (unlit).During the day, the HUD is not luminous - its intensity depends on the orientation to the sun.I tried a lot of avenues to solve this, and it would be a refreshing surprise to find out if it is possible to:Have a XML VECTOR HUD in VC render properly - LUMINOUS at all times!Set transparency to XML vector commands ( and that it works in VC)Thanks for any and all hints and tips anyone can provide...


P3D SpacePort Team

Share this post


Link to post
Share on other sites

First, the "black background" at night is an unfortunate side effect of using "emissive backlighting" for VC polygons. The "normal" solution of using a bitmap entry in the panel.cfg to mask this won't work for you, because your entire gauge needs a transparent background...Secondly, to eliminate the light and shadow effect during the daytime, there is a very simple hack that you can perform on the .asm files and then recompile the edited files with BGLC to produce a new .mdl file.Unfortunately, this "hack" will have the unfortunate side-effect of making the entire gauge poly non-transparent... I'm afraid that I've no fresh ideas, but I'll keep thinking about it!


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Thanks Bill!I was afraid that I would be out of luck on this one. Is C/GDI+ approach any better on this? Or is it possible that, with all the bells and whistles of FS2004, it is still not possible to get a proper VC HUD?And, can you point me in direction of this "hack" you mentioned?


P3D SpacePort Team

Share this post


Link to post
Share on other sites

>Thanks Bill!>>I was afraid that I would be out of luck on this one. Is>C/GDI+ approach any better on this? Or is it possible that,>with all the bells and whistles of FS2004, it is still not>possible to get a proper VC HUD?>>And, can you point me in direction of this "hack" you>mentioned? For the 2d panel it's a no-brainer, but for VC I don't see a way around the problem without the $vc polygon turning non-transparent at night when the lights are turned on.The 'hack' is expounded on by one of misho2's posts, #21977, with the Subject: "CRACKED!!! Self-Illuminated material for VC (NOT gauges!!!)"http://forums.avsim.net/dcboard.php?az=sho...4&mesg_id=21977


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

>For the 2d panel it's a no-brainer, but for VC I don't see a>way around the problem without the $vc polygon turning>non-transparent at night when the lights are turned on.>The 'hack' is expounded on by one of misho2's posts, #21977,>with the Subject: "CRACKED!!! Self-Illuminated material for VC>(NOT gauges!!!)"That's funny - that post was by me!!! Unfortunately, the hack, as you said, does not work with gauges! I brightened up the hud HUD it works fairly well during the day, so I suppose I can live with it for now. Hopefully in hte future there will be a solution for that as well.Thanks for your help,


P3D SpacePort Team

Share this post


Link to post
Share on other sites

>That's funny - that post was by me!!! Unfortunately, the hack,>as you said, does not work with gauges! >>I brightened up the hud HUD it works fairly well during the>day, so I suppose I can live with it for now. Hopefully in hte>future there will be a solution for that as well.>>Thanks for your help,It is a bit funny! Somehow, I completely missed the connection between "misho2" and "misho2..." *:-* FWIW, I've had a printed copy of your post hanging on the cork board above my desk since it was posted. Although I have to wait until final compile time, I've worked out a method of "switching out" daytime and nighttime gauge polys with XML code in the .mdl itself, so that the daytime gauge polys with the "hacked Materials" will be swapped out for the nighttime gauge polys, which use my emmissive night lighting effect.Used together, the two techniques have made my VC's much more user friendly by eliminating the 'overshadowing' of the VC during the day, and providing elegant backlighting at night. ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

>FWIW, I've had a printed copy of your post hanging on the cork>board above my desk since it was posted. Although I have to>wait until final compile time, I've worked out a method of>"switching out" daytime and nighttime gauge polys with XML>code in the .mdl itself, so that the daytime gauge polys with>the "hacked Materials" will be swapped out for the nighttime>gauge polys, which use my emmissive night lighting effect.>>Used together, the two techniques have made my VC's much more>user friendly by eliminating the 'overshadowing' of the VC>during the day, and providing elegant backlighting at night.>;)I'm glad you found a use for it. I use that hack to a great extent... However, your switching technique - will that still work for HUDs? Or will it render the dummy poly black, instead of transparent?


P3D SpacePort Team

Share this post


Link to post
Share on other sites

>I'm glad you found a use for it. I use that hack to a great>extent... However, your switching technique - will that still>work for HUDs? Or will it render the dummy poly black, instead>of transparent?Unfortunately, no. What I've found is that, when I provide a high enough amount of "daytime lighting" to minimize the "overshadowing" of the VC, the VC parts will "glow in the dark" at night! That's not very pretty...So, I simply "swap" the gauge polys at night so that the 'hack' isn't applied, and I can use normal emmissive backlighting instead...


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Well, if I understand correctly, that is exactly what I want. HUD doesn't have any VC parts - the poly it is written on is completely transparent. So everything I render on it needs to glow, day or night. Right?


P3D SpacePort Team

Share this post


Link to post
Share on other sites

>Well, if I understand correctly, that is exactly what I want.>HUD doesn't have any VC parts - the poly it is written on is>completely transparent. So everything I render on it needs to>glow, day or night. Right?When I used the term "VC Parts," that includes everthing in the VC, including the gauge polygons...So no, the "swap" won't help you except insofar as daytime is concerned. At night, your HUD would be dark, since the polygon will turn "black" if you use emmissive backlighting.You can use your '.asm hack' in combination with my "swapping code," but that will only brighten up your daytime VC HUD.But then, you could use the Bright="Yes" tag for all XML gauge elements, or the C equivalent in the case of a .gau type HUD to accomplish the same thing.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

>So no, the "swap" won't help you except insofar as daytime is>concerned. At night, your HUD would be dark, since the>polygon will turn "black" if you use emmissive backlighting.OK Got it. I thought I would get away with $panel.bmp staying transparent. Always something, eh?>>You can use your '.asm hack' in combination with my "swapping>code," but that will only brighten up your daytime VC HUD.>>But then, you could use the Bright="Yes" tag for all XML gauge>elements, or the C equivalent in the case of a .gau type HUD>to accomplish the same thing.Ah - there is the catch - Bright="Yes" never worked for me in the XML gauge (unless I misspelled it somehow :) )...I tested in on the vector commands (Circle, Rectangle) AND bitmap gauge, and it still gets dark in daytime depending on the orientation of the sun.Would you mind posting a short XML snippet with one of the simicon default buttons using Bright="Yes" that works for you ? (that is, fully bright no matter where the sun is, during daylight)Thanks,


P3D SpacePort Team

Share this post


Link to post
Share on other sites

Here is a snippet of vector XML code:


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

>Here is a snippet of vector XML code:>> > Bright="Yes">> > > > > >Sorry Bill, but that code just doesn't work in VC. The tiny triangle dims and brightens in VC depending on sun's orientation...


P3D SpacePort Team

Share this post


Link to post
Share on other sites

...and now, we have come full circle. The problem is - as it has always been - that the sim's engine is overly aggressive with it's "dynamic shadowing," especially in the VC area.Hence, we're back to the need to add a modest bit of RGB to the Material(s) used to texture the polygons in the VC we DON'T want to suffer from this effect.Unfortunately, the problem with any poly we WANT to remain transparent (such as your HUD gauge's polygon, will become non-transparent at night if there is ANY texture & RGB "self-illumination" applied whatsoever...I don't SEE any viable solution to the problem...


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...