Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Best approach for a light (with C gauges)

Featured Replies

Just curious what others thoughts are.Say you want to turn on a warning light, or for that matter another light given conditions. What are others doing to simulate radiosity (the effect of the light hitting other stuff).I guess what I'm saying is that just a bitmap doesn't seem to cut it.Stick

The best I've been able to do, and I'm not sure if you can use this, has been with my atn.gau pushback/util gauge: I use GDI+ to overlay transparent images with the right highlights (that's how the shadow on the knobs are rendered for example). You have to use a format other than BMP for this, or you can just draw on the canvas directly. Neither is a problem with GDI+. However, the one issue you have is how to store the images because the default resource compiler will not let you store images other than BMP (solution, don't tell it it's a bmp :)). So long as FS is fed a 24 bit BMP in the end, all is well.Think of the entire window area as your image, render the image to memory in GDI+ in layers using alpha channel images or vector rendering in the right order and voila. There is some judicious use of the repaint rate you need to handle, because it will kill your FPS if you do such a complex render op for every frame. Cache the rendered image, and only update when you need to. I borrow a technique from Windows itself when it clips windows area and only repaints the dirty area. There are many routines in GDI+ to help with this.If only FSX would give us a DirectX canvas that doesn't interfere with the rendering engine internals (I'm thinking post render here), we'd have it made using light sources and the like. But, this is for another day I suppose.Hope this helps,EM

Thanks for your thoughts on this. Yes, it pains me to have to program using the FSAPI when I know how to do what I want in DirectX, haha.I have yet to experiment trying to use GDI+ in FS, but I get what you are saying.Ever try doing DirectX in: PANEL_SERVICE_POST_DRAW ?Patrick

Yes, although the post render event didn't change the behavior compared to say a pre render or just the regular paint. As a matter of fact, the same thing happened when I used a timer, or subclassed the window to trap the actual OS system messages outside the FS framework.What happened in DX is that while I was able to create a DX context through the FS window handle, or even created my own in memory then rendering to a bitmap, which still requires a context, an amazing amount of flickering resulted if rendered to the same window. No issue rendering to a different window, but that doesn't work in full screen mode because DX only has one render window in this case. The other issue was that I couldn't locate a particular area on the screen to render on while in DX mode. The geometry of the windows that FS uses isn't known, neither is the scaling, so where to render wasn't evident.The flickering as far as I can tell is caused by the rendering multiple DX contexts on the same window, which triggers a global render, and FS redraws over your redraw. I was not able to get far enough into this to find another workaround.GDI+ seemed to be the route to go, although it is quite slow, if but powerful, and I still believe that only works by accident because FS allows you to render bitmaps, and GDI basically creates a dynamic bitmap. I'm not convinced this was ever intended to work that way.What I really would like to see in FSX is an improved SDK that provides more hooks inside FS for add-ons, without having to play "find the needle in the haystack". I'm thinking at least a COM object or other standard interface. At least as far as gauges go, it's not nearly as bad as figuring out dynamic scenery or flexing wings. I've always wanted to add a tug to my gauge, but the way this is usually done is using the model itself, and as a gauge dev I really do not have a way to modify the model. This leaves dynamic scenery. Try to control dynamic scenery from within a gauge, or locate the relative position of the front gear (if you have one) in the scenery... :)EM

  • Moderator

>What I really would like to see in FSX is an improved SDK that>provides more hooks inside FS for add-ons, without having to>play "find the needle in the haystack". I'm thinking at least>a COM object or other standard interface. At least as far as>gauges go, it's not nearly as bad as figuring out dynamic>scenery or flexing wings. Unfortunately, it's an uphill battle convincing the nice folks at ACES to even leave the ability to create .gau files in the sim at all, much less fix the broken stuff, add missing stuff, and improve gauges.h overall. In any case, don't expect much - if any - changes in FSX... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.