martyj Posted October 14, 2015 Share Posted October 14, 2015 So I am working on having the ability to adjust performance options in my game. There are a few undocumented functions and I was wondering what all can we adjust to improve rendering performance or create better detailed renderings? I have found a list of functions. Context::SetAntialias // True/False, but what about AA values such as 4x, 8x ect? World::SetLightQuality World::SetTessellationQuality World::SetTerrainQuality World::SetPhysicsDetail Terrain::SetTextureStageDistance // What does this even do? What are the values that we can pass in, and what is the default? Right now my game runs terrible on my laptop, but it runs decent on my desktop. So having this ability to adjust settings is very important. Quote Link to comment Share on other sites More sharing options...
reepblue Posted October 14, 2015 Share Posted October 14, 2015 I was looking into these options while developing LEX, and I just used the first 3 options, really. I never saw a difference in setting the anti-alias in the context, so I adjust the msaa setting to the camera. You'll have to have the camera get the msaa value from where ever you're controlling the settings. You can also try custom settings like changing all the lights shadows to static, or making the View Modes of entities based off of their aabb. Although this will result in slower load times, it will be better then a slow game. I recently revisited the settings and I find it best to make a singleton class just for the options, and expose it to lua like: std::string Settings::GetScreenWidthValue() { xmlSettings.load_file(FILE_SETTINGS); xml_node displaynode = xmlSettings.child(NODE_SETTINGS_ROOT).child(NODE_SETTINGS_DISPLAY); std::string value = displaynode.attribute(PROPERTY_SCREENWIDTH).value(); return System::GetProperty(PROPERTY_SCREENWIDTH, value); } std::string Settings::GetScreenHeightValue() { xmlSettings.load_file(FILE_SETTINGS); xml_node displaynode = xmlSettings.child(NODE_SETTINGS_ROOT).child(NODE_SETTINGS_DISPLAY); std::string value = displaynode.attribute(PROPERTY_SCREENHEIGHT).value(); return System::GetProperty(PROPERTY_SCREENHEIGHT, value); } --Create a window local windowstyle = window.Titlebar local resx = Settings:GetScreenWidthValue() local resy = Settings:GetScreenHeightValue() window=Window:Create(title,0,0,resx,resy,windowstyle) Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted October 14, 2015 Share Posted October 14, 2015 It's not a good idea to use undocumented functions. For example, context anti-aliasing is an outdated method that doesn't apply to our deferred renderer. The function is only left in place for backwards compatibility. Light quality, terrain quality, and camera MSAA are the major settings you should adjust. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
martyj Posted October 14, 2015 Author Share Posted October 14, 2015 What are the options to terrain quality and what is the default? Light quality if I remembered was a 0, 1, 2 for low, med, high with a default of 1? What is the default of SetMultisampleMode? Or should I not rely on LE defaults and hardcode my own defaults as my game loads with the ability to change them? Quote Link to comment Share on other sites More sharing options...
Josh Posted October 14, 2015 Share Posted October 14, 2015 The terrain quality options are 0, 1, 2 and 3, from lowest to highest quality. The default varies based on the user's hardware, and is 0 (low) or 1 (medium). 3 generally should not be used. It may crash some cards. I'd actually recommend just leaving it alone, in most cases. http://www.leadwerks.com/werkspace/page/api-reference/_/world/worldsetlightquality-r825 http://www.leadwerks.com/werkspace/page/api-reference/_/camera/camerasetmultisamplemode-r802 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted October 14, 2015 Share Posted October 14, 2015 If you need to code in a default value like in my application, I recommend having everything at 0 or 1 when no user settings have been defined yet Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.