Search the Community
Showing results for tags 'tips and tricks'.
Found 2 results
Wondering how to get better frame rates with shadows in X-Plane? Jagged and blocky shadows doing your square head in? Wondering if tweaking X-Plane's shadows are even possible? If the answer is a resounding YES to any of those questions, you're come to the right place! This guide details everything you need to know about modifying aircraft and scenery shadows in X-Plane 11. WARNING: X-PLANE 11.30 IS SET TO MODIFY X-PLANE'S CORE SHADERS. THIS MAY BLOW UP THE DATAREFS USED IN THIS GUIDE AND CRASH X-PLANE. IF THIS IS THE CASE, PLEASE PM ME AND I WILL INVESTIGATE NEW VALUES/DATAREFS! WARNING: MAKE ABSOLUTELY SURE THERE ARE NO OTHER .LUA FILES USING THE SAME DATAREFS CONTAINED HERE WITHIN. PERFORMANCE ISSUES CAN BE EXPECTED OTHERWISE! First of all, we need to understand what actually draws these shadows. And the simple answer is: it's your GPU. For reference, my GPU is an MSI GTX 970, which can draw shadows on a medium-high setting. Faster GPUs will be able to draw better shadows in terms of distance and quality. Back in X-Plane 10, we had quite a bit of control with shadows in the settings menu, but with X-Plane 11's new UI, all we can do is choose whether we want shadows on scenery or not. This guide will detail several datarefs, all of which can be modified through FlyWithLua, and tweaked to your preferences. Like any good recipe for delicious results, the ingredients required are: At least 60 minutes of time (recommended) FlyWithLua COMPLETE edition* A text editor. I'd recommend Notepad++, as it can read and format .lua files, but a default text editor also works just fine * Complete edition is a requirement as the datarefs listed below are private, which cannot be modified using the core edition So, let's get started! Firstly, some useful information to keep in mind: you don't have to stick to values I recommend. Feel free to experiment and find what's right for you. Most guides and information just tell you settings you should use, but that's not the case here, albeit there are limits. Also, you can change any value at any time, remembering of course to save the file each time you make an edit, and to reload the script through the FlyWithLua menu. The first dataref to consider is: sim/private/controls/fbo/shadow_cam_size Shadows aren't some sort of computing wizardry. They are in fact a texture, and the primary resolution of that texture is defined using this value. The value of this dataref plays a key part in the overall quality of your shadows, but keep in mind it also affects your frame rate if turned up too high. Some common values you might want to consider toying with are: set( "sim/private/controls/fbo/shadow_cam_size", 1024) -- Recommended for low-tier GPUs/integrated graphics set( "sim/private/controls/fbo/shadow_cam_size", 2048) -- Recommended for mid-tier GPUs set( "sim/private/controls/fbo/shadow_cam_size", 4096) -- Recommended for mid-high-tier GPUs set( "sim/private/controls/fbo/shadow_cam_size", 6144) -- Recommended for high-tier GPUs set( "sim/private/controls/fbo/shadow_cam_size", 8192) -- Recommended for very high-tier GPUs I personally set this value to 6144 for nice, crisp shadows, but it is borderline in terms of a high performance impact. 4096 will give you reasonable results without too much of a performance hit, whilst anything below will start to give less-desirable results. You can use any other value too, such as 3000, 5281 or 16,384, which is the largest texture size most GPUs can support. Here are some comparison screenshots inside the flight deck (click to enlarge): (Note: The colour of the shadow in the first screenshot is not impacted by texture size, and I forgot that the sun moves!) As you can see, the higher the number, the better the quality. Default seems to be somewhere between 6144-8192. Pay close attention to where the METAR display would be, the lower EICAM display knob, the 'MAX. TAKEOFF WEIGHT 78T' panel, the throttle quadrant and the shadows cast around the top-left corner of the screen. You'll notice higher quality shadows pay more respect to objects at closer distances, which can sometimes look quite unrealistic on lower resolutions. Now take note of the same dataref and the same numbers, this time using shadows on scenery: (I learnt my lesson! Sim time is paused now, and I turned off depth of field) In these screenshots, it may not be obvious at first judging by the shadow cast by the wing of the MD-80, but the exterior shadow quality in the default screenshot is worse than the 1024. MUCH WORSE, in-fact. Recall what I mentioned above, about how shadows with a higher resolution pay more attention to close objects. Now observe shadows under vehicles and under EGKK's Skybridge (floating because the airport is not flat). Makes sense now, right? I'd like to introduce to you interior and exterior shadow quality. You'll note the shadow cast by the wing in the 1024 screenshot looks abysmal. Like... REALLY REALLY BAD!!! That's why in the interior cockpit views, two shadow qualities exist: interior shadows and exterior shadows. The interior shadows have, be default, a higher resolution than exterior shadows, because we want interior shadows to be more crisp and exterior less crisp. That way, we get satisfying results without too much of a performance hit. But to complicate things even more, there's a third shadow parameter in the middle. This is the aircraft's volume-rendered shadow, calculated based on the .obj files initially loaded. It helps to explain the situation with the shadow of the wing. You can see approximately where this is with this screenshot, using the 737-900ER: Below the red lines, we have crispier shadows, compared to above where the shadow gets a bit pixelated. Brain a bit frazzled? Maybe this diagram will help clear things up. I know this is an external view, but let's pretend that we are looking out of the passenger window for the purposes of this handy diagram: This summarises the boundaries of shadows in X-Plane. The interior/exterior boundary is pretty self-explanatory, and moves with the interior camera location. The volume-rendered shadow is fixed with the aircraft. All of these play a part in the quality of your shadows in X-Plane, and the remainder of this guide explains further datarefs and their usefulness in customising X-Plane's shadows. Coming back to the interior and exterior shadows now, these are their respective datarefs: sim/private/controls/shadow/csm_split_interior sim/private/controls/shadow/csm_split_exterior Like shadow_cam_size, these adjust the overall quality of interior and exterior shadows, respectively. These datarefs can take integers between 1 and 4, with higher values giving more desirable results, but poorer frame rate. Prior to X-Plane 11.10, these values could be set as high as 8, but unfortunately they now only go up to 4 (before you hit fatal OpenGL errors), which is high enough in my opinion. Unfortunately, the exterior dataref has a slight problem: it only looks good on its highest value (4); else it is slightly or moderately pixelated. This is of course only really beneficial if you use shadows on scenery, and can seriously degrade fps. Another dataref you may consider using is: sim/private/controls/shadow/cockpit_near_adjust Take a look at the handy diagram I added above. This dataref is very simply the size of the green sphere on the diagram. Inside this sphere is of course the interior shadow quality. I'd recommend setting this value between 1.5-4, which is ideal for all cockpits. 2 is good enough in general. This dataref adjusts the distance the interior shadows become exterior: sim/private/controls/shadow/cockpit_near_proxy Be wary that the higher this dataref goes, the worse closer shadows become. You can see this dataref's effect by turning interior quality up, exterior quality down, and messing about with this number. It's all about fiddling around with these datarefs. And finally: sim/private/controls/shadow/csm/far_limit This dataref is the distance at which shadows will stop drawing. As simple as that. Same units as cockpit_near_adjust. Well, there you have it. All the datarefs you need to get sublime shadows in X-Plane. Use the format below to easily copy and paste the datarefs into a new or existing .lua file (sorry if you've already done it!), taking care to ensure it really is a .lua file: set( "sim/private/controls/shadow/csm_split_exterior", X) --(Integers between 0-4) set( "sim/private/controls/shadow/csm_split_interior", X) --(Integers between 0-4) set( "sim/private/controls/fbo/shadow_cam_size", XXXX) --(Integers between 0-16,384) set( "sim/private/controls/shadow/cockpit_near_adjust", X) --(Values 0 or greater) set( "sim/private/controls/shadow/cockpit_near_proxy", X) --(Values 0 or greater) set( "sim/private/controls/shadow/csm/far_limit", XXXXX) --(Values 0 or greater) Also, take note values can be decimal numbers. But not integers. Here's what I'm using right now: set( "sim/private/controls/shadow/csm_split_exterior", 4) set( "sim/private/controls/shadow/csm_split_interior", 4) set( "sim/private/controls/fbo/shadow_cam_size", 6144) set( "sim/private/controls/shadow/cockpit_near_adjust", 2) set( "sim/private/controls/shadow/cockpit_near_proxy", 1.5) set( "sim/private/controls/shadow/csm/far_limit", 1000) Remember, I'm using an MSI GTX 970, so what I have may give you a small or humongous performance impact. PLAY AROUND WITH THE VALUES!!! You can get shots like these then: I hope that you found this guide useful and appreciate the effort I put into making it. Please post any corrections/queries you may have, and I'll do my best to address them. I will be certainly be making more of these in the future!
Windows users: We've all done it at some point. X-Plane is loading or frozen. We click the mouse or press a key on our keyboards once and boom: And does it ever respond, mid-flight? No. Of course not. You can check X-Plane's usage in Task Manager for the proof. Heck, just panning the camera around holding a key continuously will also blow up X-Plane if it hangs for just FIVE SECONDS! It's time we do something about this. It's time to take control. IT'S TIME TO STOP! ... I mean, not X-Plane of course. This issue, actually: CAUTION: The solution to this uses Windows' Registry Editor (regedit.exe). If you are unfamiliar with regedit or are not confident in using it, then DO NOT TRY IT! This solution also has some side effects. There is a process within Windows that manages the windows within the operating system. This process is ironically named Desktop Window Manager (dwm), and is responsible for deciding after how long it should deem apps unresponsive (amongst a lot of other things, of course). By default, if an application has not sent any signal to dwm after five seconds, the mouse cursor turns to that wonderful swirl, the window goes almost white and that all-too familiar 'yada yada yada.exe is not responding' message pops up. To fix it, all we need to do is change that five seconds into something a little longer. The ingredients here are: Between 5 minutes to a few decades, depending on how fast your PC is at restarting (mine falls into the latter because I'm poor ? ) Administrator access to regedit.exe Hit the Windows key + R to pop open the Run window, and type regedit: Hit OK. When the User Account Control thingy-majig pops up, either hit Yes or type the admin password to proceed, followed by the enter key. You are now in the Registry Editor! For those that do not know, regedit contains all the values, strings etc. the settings and internals of your PC rely on. Whatever you do: DO NOT GO ABOUT CHANGING RANDOM ENTRIES. It's far too easy to change a single number, and have a PC that will never boot again. In this case, the value we are changing (or creating) is safe to... well, change. On the left, navigate to the following location: Computer -> HKEY_CURRENT_USER -> Control Panel -> Desktop. Don't go further than that. Now on the right, you may or may not see the following entry: HungAppTimeout. If you see it, great. If not, right-click anywhere, then in the drop down menu, navigate to New -> String Value, and click on that. By default, the string will be named New Value #1. Change this to "HungAppTimeout" (without quotes). CAPITALISATION IS CRITICAL. Now double-click HungAppTimeout, and change the value. By default, it is 5000. This means of course, that app timeout is measured in milliseconds. Here, you can see I have inputted 60000 to represent a full minute, but I advise setting it to something like 30 seconds: MAKE ABSOLUTELY SURE THIS VALUE IS IN MILLISECONDS. I ADVISE TO CHECK IT IS AT LEAST 5000 PRIOR TO APPLYING IT. SETTING IT TOO LOW CAN CAUSE SEVERE SYSTEM INSTABILITY, WHICH I WILL NOT BE HELD ACCOUNTABLE FOR. HungAppTimeout should now look like this, depending on the value you set. It must be a REG_SZ: Press OK, and reboot your computer to have HungAppTimeout change its value. You're now done! Now Windows will be more lenient when it comes to X-Plane becoming unresponsive. Side-Effects Some side-effects I have observed which you may want to consider. I do not use SSDs; only HDDs (recall that I am broke) so my PC can become quite unresponsive when Windows believes its processes are more important than the ones you are actually using: ANY application that hangs will be treated like a hung application after the time you specify. This means for me, it will take a minute before I can force-close an unresponsive window by clicking it repeatedly Putting the computer to bed to go to sleep occasionally takes the time you define above to do so If X-Plane is full-screen, you cannot get access to any window below it whilst it is loading (which happens to everyone already). If X-Plane is unresponsive, it can take ages before you can force-close X-Plane. This can be resolved with a second monitor, however, with Task Manager I HOLD NO RESPONSIBILITY SHOULD YOU ACCIDENTALLY BLOW UP YOUR PC. THIS MAY INCLUDE, BUT NOT LIMITED TO: LONGER WAITING TIMES, THE ENTIRE OPERATING SYSTEM BECOMING UNRESPONSIVE, THE OPERATING SYSTEM FAILING TO BOOT COMPLETELY, OR LEADING TO X-PLANE CRASH MORE FREQUENTLY. You have been warned.