From 7b64b35eb3eea82911763a7eff67761fcd37c377 Mon Sep 17 00:00:00 2001 From: cfcohen Date: Sun, 22 Nov 2015 19:28:09 -0500 Subject: [PATCH 1/9] Added comments (and commentary) to the settings-default.cfg file. --- files/settings-default.cfg | 779 +++++++++++++++++++++++++++++-------- 1 file changed, 622 insertions(+), 157 deletions(-) diff --git a/files/settings-default.cfg b/files/settings-default.cfg index d68bc2fef..2c71f483a 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -1,244 +1,709 @@ -# WARNING: Editing this file might have no effect, as these -# settings are overwritten by your user settings file. +# WARNING: Editing this file might have no effect, as these settings +# are overwritten by your user settings file. Your user settings file +# varies with your operating system: +# +# Linux: $HOME/.config/openmw +# Mac: $HOME/Library/Preferences/openmw +# Windows: C:\Users\Username\Documents\my games\openmw +# This path may vary depending on your installation hard drive, your +# Windows username, and your default language. +# +# Additionally, the user settings file is often written to disk when +# exiting OpenMW, so comments and changes to that file may also be +# discarded after running OpenMW. While most changes to the file will +# reflect setting changes made in game, some settings can have a wider +# range of values in the settings file than the GUI settings widgets +# allow. You may want to exercise some caution and backup this file +# when editing it by hand. -[Video] -resolution x = 800 -resolution y = 600 - -fullscreen = false -window border = true -screen = 0 - -# Minimize the window if it loses key focus? -minimize on focus loss = true +[Camera] -# Valid values: 0 for no antialiasing, or any power of two -antialiasing = 0 +# This floating point setting controls the distance to the near +# clipping plane. The value must be greater than zero. Values +# greater than approximately 18.0 will occasionally clip objects in +# the world in front of the character. Values greater than +# approximately 8.0 will clip the character's hands in first person +# view and/or the back of their head in third person view. +near clip = 5.0 + +# This boolean setting determines whether objects that render to one +# pixel or smaller will be culled. It generally improves performance +# to enable this feature. +small feature culling = true -vsync = false +# Set the maximum visible distance. Larger values significantly +# improve rendering in exterior spaces, but also increase the amount +# rendered geometry and significantly reduce the frame rate. This +# value is a floating point value that defaults to 6666.0. This value +# interacts with the "exterior cell load distance" setting in that +# it's probably undesired for this value to provide visibility into +# cells that have not yet been loaded. When cells are visible before +# loading, the geometry will "pop-in" suddenly, creating a jarring +# visual effect. To prevent this effect, this value must be less +# than: +# +# 8192 * exterior cell load distance - 1024 +# +# The constant 8192 is the size of a cell, and 1024 is the threshold +# distance for loading a new cell. Additionally, the "field of view" +# setting also interacts with this setting because the view frustrum +# end is a plane, so you can see further at the edges of the screen +# than you should be able to. This can be observed in game by looking +# at distant objects and rotating the camera so the object are near +# the edge of the screen. As a result, the "viewing distance" setting +# should further be reduced by a factor that depends on the "field of +# view" setting. In the default configuration this reduction is 7%. +# Using this factor, approximate values recommended for other +# "exterior cell load distance" settings are: 14285 for 2 cells, 21903 +# for 3 cells, 29522 for 4 cells, and 35924 for 5 cells. +# +# Reductions of up 25% or more can be required to completely eliminate +# pop-in for wide fields of view and long viewing distances near the +# edges of the screen, but such situations are unusual and probably +# not worth the performance penalty introduced by loading geometry +# obscured by fog in the center of the screen. +# +# This setting can be adjusted in game from the ridiculously low value +# of 2000 to a maximum of 6666, using the "View Distance" slider in +# the Detail tab of the Video panel of the Options menu. See +# RenderingManager::configureFog for the relevant source code. +viewing distance = 6666.0 -gamma = 1.00 -contrast = 1.00 +[Cells] -# Maximum framerate in frames per second, 0 = unlimited -framerate limit = 0 +# This integer setting determines the number of exterior cells +# adjacent to the character that will be loaded for rendering. It +# interacts with "viewing distance" and "field of view" as described +# previously, and it is generally very wasteful for this value to load +# geometry than will almost never be visible due to viewing distance +# and fog. For low frame rate screenshots of scenic vistas, this +# setting should be set high, and viewing distances adjusted +# accordingly. This value must be greater than or equal to 1. +exterior cell load distance = 1 [GUI] -scaling factor = 1.0 -# 1 is fully opaque +# These two settings determine the background color of the tool tip +# and the crosshair when hovering over an item owned by an NPC. The +# color definitions are composed of four floating point values between +# 0.0 and 1.0 inclusive, representing the red, green, blue and alpha +# channels. The alpha value is currently ignored. The crosshair +# color will have no effect if the "crosshair" setting in the HUD +# section is disabled. These colors are used only if the "show owned" +# setting is enabled in the Game section. +color background owned = 0.15 0.0 0.0 1.0 +color crosshair owned = 1.0 0.15 0.15 1.0 + +# This boolean setting enables or disables the "red flash" overlay +# that provides a visual clue when the character has taken damage. +hit fader = true + +# This floating point setting controls the transparency of the GUI +# windows. The value should be between 0.0 (transparent) and 1.0 +# (opaque). The setting can be adjusted in game with the "Menu +# Transparency" slider in the Prefs panel of the Options menu. menu transparency = 0.84 -# 0 - instantly, 1 - max. delay -tooltip delay = 0 +# This floating point setting scales the GUI interface windows. The +# value must be greater than 0.0. A value of 1.0 results in the +# default scale. Values much larger than 2.0 may result in user +# interface components being inaccessible. +scaling factor = 1.0 + +# Stretch or shrink the introductory movie, new game screen, and +# loading screens to fill the specified video resolution. The default +# assets have a 4:3 aspect ratio, but other assets may have other +# resolutions. If this setting is false, the assets will be centered +# in their correct aspect ratio. +stretch menu background = false +# Enable or disable subtitles for NPC spoken dialog (and some sound +# effects). Subtitles will appear in a tool tip box in the lower +# center of the screen. The setting can be toggled in game with the +# "Subtitles" button in the Prefs panel of Options menu. subtitles = false -hit fader = true +# Set the delay between when you begin hovering over an item and when +# it's tooltip appears. This setting is a floating point value +# between 0.0, which displays the tool tip instantly and 1.0 which +# results in the maximum delay (approximately 1.5 seconds). This +# setting does not affect the tooltip delay for object under the +# crosshair in the "look mode", only widgets in the GUI windows. This +# setting can be adjusted in game with the "Menu Help Delay" slider in +# the Prefs panel of the Options menu. +tooltip delay = 0.0 + +# Enable or disable the werewolf overlay. Unable to evaluate fully +# due to issues with becoming a werewolf. werewolf overlay = true -stretch menu background = false +[Game] -# colour definitions (red green blue alpha) -color background owned = 0.15 0 0 1 -color crosshair owned = 1 0.15 0.15 1 +# If this boolean setting is true, the character will always use the +# most powerful attack when striking with a weapon (chop, slash or +# thrust). If this setting is false, the type of attack is determined +# by the direction that the character is moving at the time the attack +# begins. The setting can be toggled with the "Always Use Best +# Attack" button in the Prefs panel of the Options menu. +best attack = false -[General] -# Camera field of view -field of view = 55 +# This integer setting adjusts the difficulty of the game and is +# intended to be in the range -100 to 100 inclusive. Given the +# default game setting for fDifficultyMult of 5.0, a value of -100 +# results in the player taking 80% of the usual damage, doing 6 times +# the normal damage. A value of 100 results in the player taking 6 +# times as much damage, but inflicting only 80% of the usual damage. +# Values less than -500 will result in the player receiving no damage, +# and values greater than 500 will result in the player inflicting no +# damage. The setting can be controlled in game with the Difficulty +# slider in the Prefs panel of the Options menu. +difficulty = 0 + +# Show the remaining duration of magic effects and lights if this +# boolean setting is true. The remaining duration is displayed in the +# tooltip by hovering over the magical effect. +show effect duration = false -# Texture filtering mode. valid values: -# bilinear -# trilinear -texture filtering = +# Enable visual clues for items owned by NPCs when the crosshair is on +# the object. If the setting is 0, no clues are provided which is the +# default Morrowind behavior. If the setting is 1, the background of +# the tool tip for the object is highlight in the color specified by +# the "color background owned" setting in the "GUI" section. If the +# setting is 2, the crosshair is the color of the "color crosshair +# owned" setting in the "GUI" section. If the setting is 3, both the +# tool tip background and the crosshair are colored. Settings 2 and 3 +# only color the crosshair if it's enabled in the "HUD" section. +show owned = 0 +[General] + +# Set the maximum anisotropic filtering on textures. Anisotropic +# filtering is a method of enhancing the image quality of textures on +# surfaces that are at oblique viewing angles with respect to the +# camera. Valid values range from 0 to 16. Modern video cards can +# often perform 8 or 16 anisotropic filtering with a minimal +# performance impact. This effect of this setting can be seen in the +# Video panel of the Options menu by finding a location with straight +# lines (striped rugs and Balmora cobblestones work well) radiating +# into the distance, and adjusting the anisotropy slider. This +# setting can be changed in game using the "Anisotropy" slider in the +# Detail tab of the Video panel of the Options menu. anisotropy = 4 +# Sets the camera field of view in degrees. Recommended values range +# from 30 degrees to 110 degrees. Small values provide a very narrow +# field of view that creates a "zoomed in" effect, while large values +# cause distortion at the edges of the screen. The "field of view" +# setting interacts with aspect ratio of your video resolution in that +# more square aspect ratios (e.g. 4:3) need a wider field of view to +# more resemble the same field of view on a widescreen (e.g. 16:9) +# monitor. This setting can be adjusted in game from the Video tab of +# the Video panel of the Options menu using the "Field of View" +# slider. +field of view = 55.0 + +# Specify the format for screenshots taken by pressing F12. This +# setting should be the file extension commonly associated with the +# desired format. The formats supported will be determined at +# compilation, but "jpg", "png", and "tga" should be allowed. screenshot format = png -[Shadows] -# Shadows are only supported when object shaders are on! -enabled = false +# Set the isotropic texture filtering mode to bilinear or trilinear. +# Bilinear filtering is a texture filtering method used to smooth +# textures when displayed larger or smaller than they actually are. +# Bilinear filtering is reasonably accurate until the scaling of the +# texture gets below half or above double the original size of the +# texture. Trilinear filtering is an extension of the bilinear +# texture filtering method, which also performs linear interpolation +# between mipmaps. Both methods use mipmaps in OpenMW, and the +# corresponding OpenGL modes are LINEAR_MIPMAP_NEAREST and +# LINEAR_MIPMAP_LINEAR. Trilinear filtering produces better texturing +# at a minimal cost on modern video cards. This setting can be +# changed in game using the "Texture filtering" pull down in the +# Detail tab of the Video panel of the Options menu. +texture filtering = trilinear -# Split the shadow maps, allows for a larger shadow distance -split = false +[HUD] -# Increasing shadow distance will lower the shadow quality. -# Uses "shadow distance" or "split shadow distance" depending on "split" setting. -shadow distance = 1300 -# This one shouldn't be too low, otherwise you'll see artifacts. Use at least 2x max viewing distance. -split shadow distance = 14000 +# This boolean setting determines whether the crosshair or reticle is +# displayed. If this setting is disabled it will override "show +# owned" and "color crosshair owned". This setting can be toggled +# with the "Crosshair" button in the Prefs panel of the Options menu. +crosshair = true -# Size of the shadow textures, higher means higher quality -texture size = 1024 +[Input] -# Turn on/off various shadow casters -actor shadows = true -misc shadows = true -statics shadows = true -terrain shadows = true +# Allow zooming in and out using the middle mouse wheel in third +# person view. +allow third person zoom = false -# Fraction of the total shadow distance after which the shadow starts to fade out -fade start = 0.8 +# If this boolean setting is true, the character is running by +# default, otherwise the character is walking by default. The shift +# key will temporarily invert this setting, and the caps lock key will +# invert this setting while it's "locked". Confusingly, this setting +# is updated every time you exit the game, based on whether the caps +# lock key was on or off at the time you exited. +always run = false -debug = false +# This floating point setting controls the camera/mouse sensitivity +# when in "look mode". The default sensitivity is 1.0, with smaller +# values requiring more mouse movement, and larger values requiring +# less. This setting is multiplicative in magnitude. This setting +# does not affect mouse speed in GUI mode. +camera sensitivity = 1.0 -[HUD] -crosshair = true +# This floating point setting controls the vertical camera/mouse +# sensitivity relative to the horizontal sensitivity (see "camera +# sensitivity") above. It is multiplicative with the previous +# setting, meaning that it should remain set at 1.0 unless the player +# desires to have different sensitivities in the two axes. +camera y multiplier = 1.0 -[Objects] -shaders = true +# OpenMW will capture control of the cursor if this boolean setting is +# true. In "look mode", OpenMW will capture the cursor regardless of +# the value of this setting (since the cursor/crosshair is always +# centered in the OpenMW window). However, in GUI mode, this setting +# determines the behavior when the cursor is moved outside the OpenMW +# window. If true, the cursor movement stops at the edge of the +# window preventing access to other applications. If false, the +# cursor is allowed to move freely on the desktop. +# +# This setting does not apply to the screen where escape has been +# pressed, where the cursor is never captured. Regardless of this +# setting "Alt-Tab" or some other operating system dependent key +# sequence can be used to allow the operating system to regain control +# of the mouse cursor. This setting interacts with the "minimize on +# focus loss" setting by affecting what counts as a focus loss. +# Specifically on a two-screen configuration it may be more convenient +# to access the second screen with setting disabled. +grab cursor = true + +# Invert the vertical axis while in "look mode". If this setting is +# true, moving the mouse away from the player will look down, while +# moving it towards the player will look up. This setting does not +# affect cursor movement in GUI mode. +invert y axis = false + +# This boolean setting causes the behavior of the sneak key (Ctrl by +# default) to toggle sneaking on and off rather than requiring the key +# to be held while sneaking. Players that spend significant time +# sneaking may find the character easier to control with this option +# enabled. +toggle sneak = false + +# This setting continues to be loaded and saved, but has no known +# effect. Presumably it and a related but also removed option named +# "ui y sensitivity" used to control mouse sensitivity while in GUI +# mode. The default value is 1.0. +ui sensitivity = 1.0 [Map] -# Adjusts the scale of the global map + +# It is not currently possible to control how many adjacent cells are +# displayed in the map. It appears that this is hardcoded to one +# adjacent cell (3x3) in the code. These settings control the canvas +# and resolution sizes, and therefore the amount of panning required +# to see the entire map, and the level of detail visible. + +# This integer setting adjusts the scale of the world map in the GUI +# mode map display. The value is the width in pixels of each cell in +# the map, so larger values result in larger more detailed world maps, +# while smaller values result in smaller less detailed world maps. +# However, the native resolution of the map source material appears to +# be 9 pixels per unexplored cell and approximately 18 pixels per +# explored cell, so values larger than 36 don't produce much +# additional detail. Similarly, the size of place markers is +# currently fixed at 12 pixels, so values smaller than this result in +# overlapping place markers. Values from 12 to 36 are recommended. +# For reference, Vvardenfell is approximately 41x36 cells. global map cell size = 18 +# This integer setting controls the zoom level for the HUD map display +# (the map in the lower right corner while not in GUI mode). A value +# of 64 results in the HUD map displaying one exterior cell. Since +# the GUI mode map displays 3x3 cells, a value of approximately 21 +# displays the same area as the GUI mode map. Larger values increase +# the level of zoom, while smaller values are wasteful. +# +# Note that the actual size of the widget is always the same on the +# screen unless the "scaling factor" setting in the "GUI" section is +# changed. Increasing both the scaling factor of the GUI and this +# setting does result in a higher resolution HUD map, but +# unfortunately with a scaled direction pointer on top of it. +local map hud widget size = 256 + +# This integer setting controls the resolution of the GUI mode local +# map widget. Larger values generally increase the visible detail in +# map. If this setting is half the "local map widget size" or +# smaller, the map will generally be be fairly blurry. Setting the +# both options to the same value results in a map with good detail. +# Values that exceed the "local map widget size" setting by more than +# a factor of two are unlikely to provide much of an improvement in +# detail since they're subsequently scaled back to the approximately +# the map widget size before display. The video resolution setting +# interacts with this setting in that regard. local map resolution = 256 +# This integer setting controls the canvas size of the GUI mode local +# map widget. Larger values result in a larger physical map size on +# screen, and typically require more panning to see all available +# portions of the map. This larger size also enables an overall +# greater level of detail if the "local map resolution" setting is +# also increased. local map widget size = 512 -local map hud widget size = 256 -[Cells] -exterior cell load distance = 1 +[Objects] -[Camera] -near clip = 5 +# This boolean setting currently has no known impact, but is +# presumably intended to enable shaders for objects other than water. +# Whenever the setting file is written by the game, this option is +# currently reset to false. +shaders = true -# The maximum distance with no pop-in will be: (see RenderingManager::configureFog) -# viewing distance * view frustum factor <= cell size (8192) - loading threshold (1024) -# view frustum factor takes into account that the view frustum end is a plane, so at the edges of the screen you can see further than you should be able to. -# exact factor would depend on FOV -viewing distance = 6666 +[Saves] -# Culling of objects smaller than a pixel -small feature culling = true +# This string setting contains the default character name for loading +# saved games. This setting is automatically updated from the Load +# game menu option when a different character is selected. +character = -[Terrain] -distant land = false +# This boolean setting determines whether the game will be +# automatically saved when the character rests. This setting can be +# toggled in game with the "Auto-Save when Rest" button in the Prefs +# panel of the Options menu. +autosave = true -shader = true +# This boolean setting determines whether the amount of the time the +# player has spent playing will displayed for each saved game in the +# menu for saving and loading games. This setting can not currently +# be adjusted in game. This setting is disabled by default for players +# who would prefer not to know how many hours they've spent +# playing. :-) +timeplayed = false -[Water] -shader = false +[Shadows] -refraction = false +# Shadows in general are dependent on the "shaders" setting be enabled +# in the Objects section. Additionally, the "enabled" setting in this +# section must be true for any other options in this section to have +# effect. Both that setting and the Shadows section options are +# temporarily disabled following the conversion to the OpenSceneGraph +# engine. None of these option can be adjusted in game at the present +# time. -rtt size = 512 +# This boolean setting enables actors to cast shadows. +actor shadows = true + +# Enable debugging of shadows? +debug = false + +# Are shadows enabled in general? +enabled = false + +# This floating point setting determines the fraction of the total +# shadow distance after which the shadow starts to fade out. +fade start = 0.8 + +# Allows miscellaneous object to cast shadows. +misc shadows = true + +# This setting will only have effect if the "split" setting in the +# Shadows section is false. Increasing shadow distance will lower the +# shadow quality. +shadow distance = 1300 + +# Split the shadow maps, allowing for a larger shadow distance? +split = false + +# This setting will only have effect if the "split" setting in the +# Shadows section is true. # This one shouldn't be too low, otherwise +# you'll see artifacts. Use at least 2x max viewing distance. +split shadow distance = 14000 + +# Allow static objects to cast shadows. +statics shadows = true + +# Allow terrain to cast shadows. +terrain shadows = true + +# Size of the shadow textures. Higher resolution texture produce more +# detailed shadows and a better visual effect. +texture size = 1024 [Sound] -# Device name. Blank means default + +# This string setting determines which audio device to use. A blank or +# missing setting means to use the default device, which should +# usually be sufficient, but if you need to explicitly specify a +# device name try doing so here. device = -# Volumes. master volume affects all other volumes. -master volume = 1.0 -sfx volume = 1.0 -music volume = 0.5 +# The settings in the Sound section are generally floating point +# settings in the range from 0.0 (silent) to 1.0 (maximum volume). +# All sound settings are multiplied by the "master volume" setting, and +# will thus have no effect if the master volume is set to 0.0. These +# settings can be adjusted in game from the Audio panel of the Options +# menu under the appropriately labeled slider. + +# The volume of footsteps from the character and other actors. footsteps volume = 0.2 -voice volume = 0.8 +# The master volume is multiplied with all other volume settings to +# determine the final volume +master volume = 1.0 -[Input] +# The volume for music tracks. +music volume = 0.5 -grab cursor = true +# The volume for special effect sounds such as combat noises, etc. +sfx volume = 1.0 -invert y axis = false +# The volume for spoken dialog from NPCs. +voice volume = 0.8 -camera sensitivity = 1.0 +[Terrain] -ui sensitivity = 1.0 +# Not currently used, presumably due to the OpenSceneGraph upgrade. +distant land = false -camera y multiplier = 1.0 +# Not currently used, presumably due to the OpenSceneGraph upgrade. +shader = true -always run = false +[Video] -allow third person zoom = false +# This integer setting controls anti-aliasing. Anti-aliasing is +# technique designed to reduce distortions called aliasing caused by +# displaying high resolution textures at a lower resolution. +# Anti-aliasing can correct these distortions at the cost of a minor +# reduction in the frame rate. A value of 0 disables anti-aliasing. +# Other powers of two (e.g. 2, 4, 8, 16) are supported according to +# the capabilities of your graphics hardware. Higher values do a +# better job of correcting the distortion and have a greater impact on +# frame rate. This setting can be configured from a list of valid +# choices in the Graphics panel of the OpenMW Launcher. +antialiasing = 0 -toggle sneak = false +# This floating point setting controls the contrast correction for all +# video in the game. This setting does not currently work under +# Linux, and the in-game setting in the Options menu has been +# disabled. +contrast = 1.00 -[Game] -# Always use the most powerful attack when striking with a weapon (chop, slash or thrust) -best attack = false +# This floating point setting determines the maximum frame rate in +# frames per second. If this setting is 0.0, the frame rate is +# unlimited. There are several reasons to consider capping your frame +# rate, especially if you're already experiencing a relatively high +# frame rate (greater than 60 frames per second). Lower frame rates +# will consume less power and generate less heat and noise. Frame +# rates above 60 frames per second rarely produce perceptible +# improvements in visual quality. Capping the frame rate may in some +# situations reduce the perception of choppiness (highly variable +# frame rates during game play) by lowering the peak frame rates. +# This setting interacts with the "vsync" setting in the Video section +# in the sense that enabling vertical sync limits the frame rate to +# the refresh rate of your monitor (often 60 frames per second). +framerate limit = 0.0 + +# This boolean setting determines whether the entire screen is used +# for the specified resolution. This setting can be toggled in game +# using the "Fullscreen" button in the Video tab of the Video panel in +# the Options menu. It can also be toggled with the "Full Screen" +# check box in the Graphic tab of the OpenMW Launcher. +fullscreen = false -difficulty = 0 +# Theses two setting determine the horizontal and vertical resolution +# of the OpenMW game window. Larger values produce more detailed +# images within the constraints of your graphics hardware but also +# significantly reduce the frame rate. The window resolution can be +# selected from a menu of common screen sizes in the Video tab of the +# Video Panel of the Options menu. The resolution can also be set to +# a custom value in the Graphics tab of the OpenMW Launcher. +resolution x = 800 +resolution y = 600 -# Change crosshair/toolTip color when pointing on owned object -#0: nothing changed -#1: tint toolTip -#2: tint crosshair -#3: both -show owned = 0 -# Show the remaining duration of magic effects and lights -show effect duration = false +# This boolean setting determines whether there's an operating system +# border drawn around the OpenMW window. If this setting is true, the +# window can be moved and resized with the operating system window +# controls. If this setting is false, the window has no operating +# system border. This setting has no effect if the "fullscreen" +# setting in the Video section is true. This setting can be toggled +# in game using the "Window Border" button in the Video tab of the +# Video panel in the Options menu. It can also be toggled with the +# "Window Border" check box in the OpenMW Launcher. +window border = true -[Saves] -character = -# Save when resting -autosave = true -# display time played -timeplayed = false +# This integer setting determines which screen the game will open on +# in multi-monitor configurations. This setting is particularly +# important when "fullscreen" setting in the Video section is true, +# since this is the only way to control which screen is used, but it +# can also be used to control which screen a normal window or a +# borderless window opens on as well. This setting can be selected +# from a pull down menu in the Graphics tab of the OpenMW Launcher, +# but not adjusted during game play. +screen = 0 -[Windows] -inventory x = 0 -inventory y = 0.4275 -inventory w = 0.6225 -inventory h = 0.5725 +# Minimize the OpenMW window if it loses cursor focus. This setting +# has no effect if the "fullscreen" setting is false. This setting is +# primarily useful for single screen configurations, so that the +# OpenMW screen in full screen mode can be minimized when the +# operating system regains control of the mouse and keyboard. On +# multiple screen configurations, disabling this option make make it +# easier to switch between screens while playing OpenMW. +minimize on focus loss = true -inventory container x = 0 -inventory container y = 0.4275 -inventory container w = 0.6225 -inventory container h = 0.5725 +# This boolean setting determines whether frame draws are synchronized +# with the vertical refresh rate of your monitor. Enabling this +# setting can reduce "tearing", a visual defect caused by updating the +# image buffer in the middle of a screen draw. Enabling this option +# typically implies limiting the framerate to 60 frames per second, +# but may also introduce additional delays caused by having to wait +# until the appropriate time (the vertical blanking interval) to draw +# a frame. + +# This setting can be adjusted in game using the "VSync" button in the +# Video tab of the Video panel in the Options menu. It can also be +# changed by toggling the "Vertical Sync" check box in the Graphics +# tab of the OpenMW Launcher. +vsync = false -inventory barter x = 0 -inventory barter y = 0.4275 -inventory barter w = 0.6225 -inventory barter h = 0.5725 +# This floating point setting controls the gamma correction for all +# video in the game. This setting does not currently work under +# Linux, and the in-game setting in the Options menu has been +# disabled. +gamma = 1.00 -inventory companion x = 0 -inventory companion y = 0.4275 -inventory companion w = 0.6225 -inventory companion h = 0.5725 +[Water] -container x = 0.25 -container y = 0 -container w = 0.75 -container h = 0.375 +# The water settings can be tested experimentally in the Water tab of +# the Video panel in the Options menu. Changes there will be saved to +# these settings. + +# This boolean setting enables the refraction rendering feature of the +# water shader. Refraction causes deep water to be more opaque and +# objects seen through the plane of the water to have a wavy +# appearance. Enabling this feature results in better visuals, and a +# marginally lower framerate depending on your graphics hardware. The +# "shader" setting in the Water section must be enabled for this +# setting to have any effect. +refraction = false -companion x = 0.25 -companion y = 0 -companion w = 0.75 -companion h = 0.375 +# Refracted texture size. In the Video panel of the options menu, the +# choices are Low (512), Medium (1024) and High (2048). This setting +# determines the resolution of the textures used for rendering objects +# on the other wide of the plane of water (which have a wavy +# appearance caused the by the refraction). Higher values produces +# better visuals and result in a marginally lower framerate depending +# on your graphics hardware. The "refraction" setting in the "Water" +# section must be enabled for this setting to have any effect. +rtt size = 512 -map x = 0.625 -map y = 0 -map w = 0.375 -map h = 0.5725 +# This boolean setting enables or disables the water shader, which +# results in much more realistic looking water surfaces, including +# shadows of reflected objects. +shader = false -barter x = 0.25 -barter y = 0 -barter w = 0.75 -barter h = 0.375 +[Windows] + +# Each window in the GUI mode remembers it's previous location. Each +# setting is a floating point number representing a fraction of the +# "resolution x" or "resolution y" setting in the Video section. The +# X and Y values locate the top left corner, while the W value +# determines the width of the window and the H value determines the +# height of the window. +# The alchemy window, for crafting potions. Activated by dragging an +# alchemy tool on to the rag doll. Unlike most other windows, this +# window hides all other windows when opened. +alchemy h = 0.5 +alchemy w = 0.5 alchemy x = 0.25 alchemy y = 0.25 -alchemy w = 0.5 -alchemy h = 0.5 -stats x = 0 -stats y = 0 -stats w = 0.375 -stats h = 0.4275 +# The NPC bartering window, displaying goods owned by the shopkeeper +# while bartering. Activated by clicking on the "Barter" choice in +# the dialog window for an NPC. +barter h = 0.375 +barter w = 0.75 +barter x = 0.25 +barter y = 0 -spells x = 0.625 -spells y = 0.5725 -spells w = 0.375 -spells h = 0.4275 +# Unused? +companion h = 0.375 +companion w = 0.75 +companion x = 0.25 +companion y = 0 +# The console command window. Activated by pressing the tilde (~) key. +console h = 0.5 +console w = 1 console x = 0 console y = 0 -console w = 1 -console h = 0.5 +# The container window, showing the contents of the container. +# Activated by clicking on a container. The same window is used for +# searching dead bodies, and pickpocketing people. +container h = 0.375 +container w = 0.75 +container x = 0.25 +container y = 0 + +# The dialog window, for talking with NPCs. Activated by clicking on a +# NPC. dialogue h = 0.810 dialogue w = 0.810 dialogue x = 0.095 dialogue y = 0.095 + +# The character inventory window while bartering. It displays goods +# owned by the character while bartering. Activated by clicking on the +# "Barter" choice in the dialog window for an NPC. +inventory barter h = 0.5725 +inventory barter w = 0.6225 +inventory barter x = 0 +inventory barter y = 0.4275 + +# Unused? +inventory companion h = 0.5725 +inventory companion w = 0.6225 +inventory companion x = 0 +inventory companion y = 0.4275 + +# The character inventory window while searching a container, showing +# the contents of the character's inventory. Activated by clicking on +# a container. The same window is used for searching dead bodies, and +# pickpocketing people. +inventory container h = 0.5725 +inventory container w = 0.6225 +inventory container x = 0 +inventory container y = 0.4275 + +# The inventory window, displaying the paper doll and possessions. +# Activated by clicking on the inventory widget (second from left) in +# the bottom left corner of the HUD. +inventory h = 0.5725 +inventory w = 0.6225 +inventory x = 0 +inventory y = 0.4275 + +# The local and world map window. Activated by clicking on the map +# widget in the bottom right corner of the HUD. +map h = 0.5725 +map w = 0.375 +map x = 0.625 +map y = 0 + +# The spells window, displaying powers, spells, and magical items. +# Activated by clicking on the spells widget (third from left) in the +# bottom left corner of the HUD. +spells h = 0.4275 +spells w = 0.375 +spells x = 0.625 +spells y = 0.5725 + +# The stats window, displaying level, race, class, skills and stats. +# Activated by clicking on any of the three bars in the lower left +# corner of the HUD. +stats h = 0.4275 +stats w = 0.375 +stats x = 0 +stats y = 0 From 69acacefff5237a851d813e51c67c7b7116a7a57 Mon Sep 17 00:00:00 2001 From: sandstranger Date: Mon, 23 Nov 2015 20:28:35 +0300 Subject: [PATCH 2/9] openmw building on Android with Opengl es --- CMakeLists.txt | 44 +++-- apps/openmw/CMakeLists.txt | 34 +++- apps/openmw/android_main.c | 1 - apps/openmw/main.cpp | 2 +- apps/openmw/mwrender/localmap.cpp | 5 + apps/openmw/mwrender/sky.cpp | 5 + apps/openmw/mwrender/water.cpp | 11 +- cmake/FindOpenGLES.cmake | 94 +++++++++++ cmake/FindOpenGLES2.cmake | 170 +++++++++++++++++++ components/CMakeLists.txt | 105 +++++++----- components/sdlutil/sdlcursormanager.cpp | 3 + files/shaders/CMakeLists.txt | 20 ++- files/shaders/watergles_fragment.glsl | 209 ++++++++++++++++++++++++ files/shaders/watergles_vertex.glsl | 24 +++ 14 files changed, 656 insertions(+), 71 deletions(-) create mode 100644 cmake/FindOpenGLES.cmake create mode 100644 cmake/FindOpenGLES2.cmake create mode 100644 files/shaders/watergles_fragment.glsl create mode 100644 files/shaders/watergles_vertex.glsl diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fac1b77f..4b46542e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,20 @@ include(OpenMWMacros) if (ANDROID) set(CMAKE_FIND_ROOT_PATH ${OPENMW_DEPENDENCIES_DIR} "${CMAKE_FIND_ROOT_PATH}") + set(OSG_PLUGINS_DIR ${OSG_PLUGINS_DIR}) + add_definitions (-DOSG_PLUGINS_DIR) + set(OPENGLES TRUE CACHE BOOL "enable opengl es support for android" FORCE) endif (ANDROID) +option(OPENGLES "enable opengl es support" FALSE ) + +if (OPENGLES) + INCLUDE(cmake/FindOpenGLES.cmake) + INCLUDE(cmake/FindOpenGLES2.cmake) + add_definitions (-DOPENGLES) + INCLUDE_DIRECTORIES(${OPENGLES_INCLUDE_DIR}) +endif (OPENGLES) + # doxygen main page configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_BINARY_DIR}/docs/mainpage.hpp") @@ -145,21 +157,21 @@ if (WIN32) endif() # Dependencies +if (NOT ANDROID) + set(DESIRED_QT_VERSION 4 CACHE STRING "The QT version OpenMW should use (4 or 5)") + message(STATUS "Using Qt${DESIRED_QT_VERSION}") -set(DESIRED_QT_VERSION 4 CACHE STRING "The QT version OpenMW should use (4 or 5)") -message(STATUS "Using Qt${DESIRED_QT_VERSION}") - -if (DESIRED_QT_VERSION MATCHES 4) - find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui QtNetwork QtOpenGL) -else() - find_package(Qt5Widgets REQUIRED) - find_package(Qt5Core REQUIRED) - find_package(Qt5Network REQUIRED) - find_package(Qt5OpenGL REQUIRED) - # Instruct CMake to run moc automatically when needed. - #set(CMAKE_AUTOMOC ON) + if (DESIRED_QT_VERSION MATCHES 4) + find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui QtNetwork QtOpenGL) + else() + find_package(Qt5Widgets REQUIRED) + find_package(Qt5Core REQUIRED) + find_package(Qt5Network REQUIRED) + find_package(Qt5OpenGL REQUIRED) + # Instruct CMake to run moc automatically when needed. + #set(CMAKE_AUTOMOC ON) + endif() endif() - # Fix for not visible pthreads functions for linker with glibc 2.15 if (UNIX AND NOT APPLE) find_package (Threads) @@ -189,7 +201,11 @@ IF(BOOST_STATIC) set(Boost_USE_STATIC_LIBS ON) endif() -find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgQt osgUtil osgFX) +if (NOT ANDROID) + find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgQt osgUtil osgFX) +else() + find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgUtil osgFX) +endif() include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) if(OSG_STATIC) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 59a523023..1f0fe71ab 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -134,18 +134,50 @@ target_link_libraries(openmw ) if (ANDROID) + set (OSG_PLUGINS + -Wl,--whole-archive + ${OSG_PLUGINS_DIR}/libosgdb_dds.a + ${OSG_PLUGINS_DIR}/libosgdb_bmp.a + ${OSG_PLUGINS_DIR}/libosgdb_tga.a + ${OSG_PLUGINS_DIR}/libosgdb_gif.a + ${OSG_PLUGINS_DIR}/libosgdb_jpeg.a + ${OSG_PLUGINS_DIR}/libosgdb_png.a + -Wl,--no-whole-archive + ) target_link_libraries(openmw EGL android log dl MyGUIEngineStatic - cpufeatures BulletCollision LinearMath + z + osg + osgDB + osgAnimation + osgText + osgUtil + osgShadow + ${OPENSCENEGRAPH_LIBRARIES} + ${OSG_PLUGINS} + ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + jpeg + gif + png ) endif (ANDROID) +if (OPENGLES) + target_link_libraries(openmw + ${OPENGLES_gl_LIBRARY} + ${OPENGLES2_gl_LIBRARY} + ) +endif (OPENGLES) + if (USE_SYSTEM_TINYXML) target_link_libraries(openmw ${TINYXML_LIBRARIES}) endif() diff --git a/apps/openmw/android_main.c b/apps/openmw/android_main.c index 47b77a8b3..8cd69e8f0 100644 --- a/apps/openmw/android_main.c +++ b/apps/openmw/android_main.c @@ -1,4 +1,3 @@ -#include "../../SDL_internal.h" #ifdef __ANDROID__ #include "SDL_main.h" diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 17ef46246..c3f0f8688 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -23,7 +23,7 @@ #endif -#if (defined(__APPLE__) || defined(__linux) || defined(__unix) || defined(__posix)) +#if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID)) || (defined(__unix) && !defined(ANDROID)) || defined(__posix)) #define USE_CRASH_CATCHER 1 #else #define USE_CRASH_CATCHER 0 diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index 14ec770e8..077d21512 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -24,6 +24,11 @@ #include "vismask.hpp" +#ifdef OPENGLES + #include +#endif + + namespace { diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 66253f70d..7572d7e92 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -45,6 +45,11 @@ #include "vismask.hpp" #include "renderbin.hpp" +#ifdef OPENGLES + #include +#endif + + namespace { diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index ca099991e..5a9bc664a 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -40,6 +40,10 @@ #include "ripplesimulation.hpp" #include "renderbin.hpp" +#ifdef OPENGLES +#include +#endif + namespace { @@ -575,10 +579,13 @@ void Water::createShaderWaterStateSet(osg::Node* node, Reflection* reflection, R // use a define map to conditionally compile the shader std::map defineMap; defineMap.insert(std::make_pair(std::string("@refraction_enabled"), std::string(refraction ? "1" : "0"))); - +#ifdef OPENGLES + osg::ref_ptr vertexShader (readShader(osg::Shader::VERTEX, mResourcePath + "/shaders/watergles_vertex.glsl", defineMap)); + osg::ref_ptr fragmentShader (readShader(osg::Shader::FRAGMENT, mResourcePath + "/shaders/watergles_fragment.glsl", defineMap)); +#else osg::ref_ptr vertexShader (readShader(osg::Shader::VERTEX, mResourcePath + "/shaders/water_vertex.glsl", defineMap)); osg::ref_ptr fragmentShader (readShader(osg::Shader::FRAGMENT, mResourcePath + "/shaders/water_fragment.glsl", defineMap)); - +#endif osg::ref_ptr normalMap (new osg::Texture2D(readPngImage(mResourcePath + "/shaders/water_nm.png"))); normalMap->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); normalMap->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); diff --git a/cmake/FindOpenGLES.cmake b/cmake/FindOpenGLES.cmake new file mode 100644 index 000000000..7ee2c07f1 --- /dev/null +++ b/cmake/FindOpenGLES.cmake @@ -0,0 +1,94 @@ +#------------------------------------------------------------------- +# This file is part of the CMake build system for OGRE +# (Object-oriented Graphics Rendering Engine) +# For the latest info, see http://www.ogre3d.org/ +# +# The contents of this file are placed in the public domain. Feel +# free to make use of it in any way you like. +#------------------------------------------------------------------- + +# - Try to find OpenGLES +# Once done this will define +# +# OPENGLES_FOUND - system has OpenGLES +# OPENGLES_INCLUDE_DIR - the GL include directory +# OPENGLES_LIBRARIES - Link these to use OpenGLES + +IF (WIN32) + IF (CYGWIN) + + FIND_PATH(OPENGLES_INCLUDE_DIR GLES/gl.h ) + + FIND_LIBRARY(OPENGLES_gl_LIBRARY libgles_cm ) + + ELSE (CYGWIN) + + IF(BORLAND) + SET (OPENGLES_gl_LIBRARY import32 CACHE STRING "OpenGL ES 1.x library for win32") + ELSE(BORLAND) + #MS compiler - todo - fix the following line: + SET (OPENGLES_gl_LIBRARY ${OGRE_SOURCE_DIR}/Dependencies/lib/release/libgles_cm.lib CACHE STRING "OpenGL ES 1.x library for win32") + ENDIF(BORLAND) + + ENDIF (CYGWIN) + +ELSE (WIN32) + + IF (APPLE) + + #create_search_paths(/Developer/Platforms) + #findpkg_framework(OpenGLES) + #set(OPENGLES_gl_LIBRARY "-framework OpenGLES") + + ELSE(APPLE) + + FIND_PATH(OPENGLES_INCLUDE_DIR GLES/gl.h + /opt/vc/include + /opt/graphics/OpenGL/include + /usr/openwin/share/include + /usr/X11R6/include + /usr/include + ) + + FIND_LIBRARY(OPENGLES_gl_LIBRARY + NAMES GLES_CM GLESv1_CM + PATHS /opt/vc/lib + /opt/graphics/OpenGL/lib + /usr/openwin/lib + /usr/shlib /usr/X11R6/lib + /usr/lib + ) + + # On Unix OpenGL most certainly always requires X11. + # Feel free to tighten up these conditions if you don't + # think this is always true. + + #IF (OPENGLES_gl_LIBRARY) + # IF(NOT X11_FOUND) + # INCLUDE(FindX11) + # ENDIF(NOT X11_FOUND) + # IF (X11_FOUND) + # SET (OPENGLES_LIBRARIES ${X11_LIBRARIES}) + # ENDIF (X11_FOUND) + #ENDIF (OPENGLES_gl_LIBRARY) + + ENDIF(APPLE) +ENDIF (WIN32) + +SET( OPENGLES_FOUND "NO" ) +IF(OPENGLES_gl_LIBRARY) + + SET( OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY} ${OPENGLES_LIBRARIES}) + + SET( OPENGLES_FOUND "YES" ) + +ENDIF(OPENGLES_gl_LIBRARY) + +MARK_AS_ADVANCED( + OPENGLES_INCLUDE_DIR + OPENGLES_gl_LIBRARY +) + +INCLUDE(FindPackageHandleStandardArgs) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGLES REQUIRED_VARS OPENGLES_LIBRARIES OPENGLES_INCLUDE_DIR) diff --git a/cmake/FindOpenGLES2.cmake b/cmake/FindOpenGLES2.cmake new file mode 100644 index 000000000..136e7618b --- /dev/null +++ b/cmake/FindOpenGLES2.cmake @@ -0,0 +1,170 @@ +#------------------------------------------------------------------- +# This file is part of the CMake build system for OGRE +# (Object-oriented Graphics Rendering Engine) +# For the latest info, see http://www.ogre3d.org/ +# +# The contents of this file are placed in the public domain. Feel +# free to make use of it in any way you like. +#------------------------------------------------------------------- + +# - Try to find OpenGLES and EGL +# If using ARM Mali emulation you can specify the parent directory that contains the bin and include directories by +# setting the MALI_SDK_ROOT variable in the environment. +# +# For AMD emulation use the AMD_SDK_ROOT variable +# +# Once done this will define +# +# OPENGLES2_FOUND - system has OpenGLES +# OPENGLES2_INCLUDE_DIR - the GL include directory +# OPENGLES2_LIBRARIES - Link these to use OpenGLES +# +# EGL_FOUND - system has EGL +# EGL_INCLUDE_DIR - the EGL include directory +# EGL_LIBRARIES - Link these to use EGL + +#include(FindPkgMacros) + +IF (WIN32) + IF (CYGWIN) + + FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h ) + + FIND_LIBRARY(OPENGLES2_gl_LIBRARY libGLESv2 ) + + ELSE (CYGWIN) + + IF(BORLAND) + SET (OPENGLES2_gl_LIBRARY import32 CACHE STRING "OpenGL ES 2.x library for win32") + ELSE(BORLAND) + #getenv_path(AMD_SDK_ROOT) + #getenv_path(MALI_SDK_ROOT) + + SET(POWERVR_SDK_PATH "C:/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds") + FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h + ${ENV_AMD_SDK_ROOT}/include + ${ENV_MALI_SDK_ROOT}/include + ${POWERVR_SDK_PATH}/Include + "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include" + ) + + FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h + ${ENV_AMD_SDK_ROOT}/include + ${ENV_MALI_SDK_ROOT}/include + ${POWERVR_SDK_PATH}/Include + "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include" + ) + + FIND_LIBRARY(OPENGLES2_gl_LIBRARY + NAMES libGLESv2 + PATHS ${ENV_AMD_SDK_ROOT}/x86 + ${ENV_MALI_SDK_ROOT}/bin + ${POWERVR_SDK_PATH}/Windows/x86_32/Lib + "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib" + ) + + FIND_LIBRARY(EGL_egl_LIBRARY + NAMES libEGL + PATHS ${ENV_AMD_SDK_ROOT}/x86 + ${ENV_MALI_SDK_ROOT}/bin + ${POWERVR_SDK_PATH}/Windows/x86_32/Lib + "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib" + ) + ENDIF(BORLAND) + + ENDIF (CYGWIN) + +ELSE (WIN32) + + IF (APPLE) + + #create_search_paths(/Developer/Platforms) + #findpkg_framework(OpenGLES2) + #set(OPENGLES2_gl_LIBRARY "-framework OpenGLES") + + ELSE(APPLE) + #getenv_path(AMD_SDK_ROOT) + #getenv_path(MALI_SDK_ROOT) + + FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h + ${ENV_AMD_SDK_ROOT}/include + ${ENV_MALI_SDK_ROOT}/include + /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Include + /opt/vc/include + /usr/openwin/share/include + /opt/graphics/OpenGL/include /usr/X11R6/include + /usr/include + ) + + FIND_LIBRARY(OPENGLES2_gl_LIBRARY + NAMES GLESv2 + PATHS ${ENV_AMD_SDK_ROOT}/x86 + ${ENV_MALI_SDK_ROOT}/bin + /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib + /opt/vc/lib + /opt/graphics/OpenGL/lib + /usr/openwin/lib + /usr/shlib /usr/X11R6/lib + /usr/lib + ) + + FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h + ${ENV_AMD_SDK_ROOT}/include + ${ENV_MALI_SDK_ROOT}/include + /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Include + /opt/vc/include + /usr/openwin/share/include + /opt/graphics/OpenGL/include /usr/X11R6/include + /usr/include + ) + + FIND_LIBRARY(EGL_egl_LIBRARY + NAMES EGL + PATHS ${ENV_AMD_SDK_ROOT}/x86 + ${ENV_MALI_SDK_ROOT}/bin + /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib + /opt/vc/lib + /opt/graphics/OpenGL/lib + /usr/openwin/lib + /usr/shlib /usr/X11R6/lib + /usr/lib + ) + + # On Unix OpenGL most certainly always requires X11. + # Feel free to tighten up these conditions if you don't + # think this is always true. + # It's not true on OSX. + + #IF (OPENGLES2_gl_LIBRARY) + # IF(NOT X11_FOUND) + # INCLUDE(FindX11) + # ENDIF(NOT X11_FOUND) + # IF (X11_FOUND) + # IF (NOT APPLE) + # SET (OPENGLES2_LIBRARIES ${X11_LIBRARIES}) + # ENDIF (NOT APPLE) + # ENDIF (X11_FOUND) + #ENDIF (OPENGLES2_gl_LIBRARY) + + ENDIF(APPLE) +ENDIF (WIN32) + +SET( OPENGLES2_FOUND "YES" ) +IF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY) + + SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES}) + SET( EGL_LIBRARIES ${EGL_egl_LIBRARY} ${EGL_LIBRARIES}) + SET( OPENGLES2_FOUND "YES" ) + +ENDIF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY) + +MARK_AS_ADVANCED( + OPENGLES2_INCLUDE_DIR + OPENGLES2_gl_LIBRARY + EGL_INCLUDE_DIR + EGL_egl_LIBRARY +) + +INCLUDE(FindPackageHandleStandardArgs) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGLES2 REQUIRED_VARS OPENGLES2_LIBRARIES OPENGLES2_INCLUDE_DIR) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index c80e27e4d..7bfbf6d93 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -20,8 +20,9 @@ else (GIT_CHECKOUT) configure_file(${VERSION_IN_FILE} ${VERSION_FILE}) endif (GIT_CHECKOUT) -find_package(OpenGL REQUIRED) - +if (NOT ANDROID) + find_package(OpenGL REQUIRED) +endif() # source files add_component_dir (settings @@ -137,31 +138,31 @@ add_component_dir (version set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui ) -add_component_qt_dir (contentselector - model/modelitem model/esmfile - model/naturalsort model/contentmodel - model/loadordererror - view/combobox view/contentselector - ) -add_component_qt_dir (config - gamesettings - launchersettings - settingsbase - ) - -add_component_qt_dir (process - processinvoker -) - -if (DESIRED_QT_VERSION MATCHES 4) - include(${QT_USE_FILE}) - QT4_WRAP_UI(ESM_UI_HDR ${ESM_UI}) - QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) -else() - QT5_WRAP_UI(ESM_UI_HDR ${ESM_UI}) - QT5_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) +if (NOT ANDROID) + add_component_qt_dir (contentselector + model/modelitem model/esmfile + model/naturalsort model/contentmodel + model/loadordererror + view/combobox view/contentselector + ) + add_component_qt_dir (config + gamesettings + launchersettings + settingsbase + ) + + add_component_qt_dir (process + processinvoker + ) + if (DESIRED_QT_VERSION MATCHES 4) + include(${QT_USE_FILE}) + QT4_WRAP_UI(ESM_UI_HDR ${ESM_UI}) + QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) + else() + QT5_WRAP_UI(ESM_UI_HDR ${ESM_UI}) + QT5_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) + endif() endif() - if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) add_definitions(-fPIC) @@ -172,32 +173,46 @@ include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR}) -target_link_libraries(components - ${Boost_SYSTEM_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${OPENSCENEGRAPH_LIBRARIES} - ${BULLET_LIBRARIES} - ${SDL2_LIBRARY} - # For MyGUI platform - ${OPENGL_gl_LIBRARY} - ${MYGUI_LIBRARIES} -) +if (NOT ANDROID) + target_link_libraries(components + ${Boost_SYSTEM_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${OPENSCENEGRAPH_LIBRARIES} + ${BULLET_LIBRARIES} + ${SDL2_LIBRARY} + # For MyGUI platform + ${OPENGL_gl_LIBRARY} + ${MYGUI_LIBRARIES} + ) +else() + target_link_libraries(components + ${Boost_SYSTEM_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${OPENSCENEGRAPH_LIBRARIES} + ${BULLET_LIBRARIES} + ${SDL2_LIBRARY} + ${MYGUI_LIBRARIES} + ) +endif() if (WIN32) target_link_libraries(components ${Boost_LOCALE_LIBRARY}) endif() -if (DESIRED_QT_VERSION MATCHES 4) - target_link_libraries(components - ${QT_QTCORE_LIBRARY} - ${QT_QTGUI_LIBRARY}) -else() - qt5_use_modules(components Widgets Core) +if (NOT ANDROID) + if (DESIRED_QT_VERSION MATCHES 4) + target_link_libraries(components + ${QT_QTCORE_LIBRARY} + ${QT_QTGUI_LIBRARY}) + else() + qt5_use_modules(components Widgets Core) + endif() endif() - if (GIT_CHECKOUT) add_dependencies (components git-version) endif (GIT_CHECKOUT) diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index e1a67aff8..23f01f3a7 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -217,6 +217,9 @@ namespace SDLUtil void SDLCursorManager::_createCursorFromResource(const std::string& name, int rotDegrees, osg::Image* image, Uint8 size_x, Uint8 size_y, Uint8 hotspot_x, Uint8 hotspot_y) { + #ifdef ANDROID + return; + #endif if (mCursorMap.find(name) != mCursorMap.end()) return; diff --git a/files/shaders/CMakeLists.txt b/files/shaders/CMakeLists.txt index fc4706c1f..da2550275 100644 --- a/files/shaders/CMakeLists.txt +++ b/files/shaders/CMakeLists.txt @@ -1,11 +1,17 @@ # Copy resource files into the build directory set(SDIR ${CMAKE_CURRENT_SOURCE_DIR}) set(DDIR ${OpenMW_BINARY_DIR}/resources/shaders) - -set(SHADER_FILES - water_vertex.glsl - water_fragment.glsl - water_nm.png -) - +if (OPENGLES) + set(SHADER_FILES + watergles_vertex.glsl + watergles_fragment.glsl + water_nm.png + ) +else() + set(SHADER_FILES + water_vertex.glsl + water_fragment.glsl + water_nm.png + ) +endif() copy_all_files(${CMAKE_CURRENT_SOURCE_DIR} ${DDIR} "${SHADER_FILES}") diff --git a/files/shaders/watergles_fragment.glsl b/files/shaders/watergles_fragment.glsl new file mode 100644 index 000000000..e3f756087 --- /dev/null +++ b/files/shaders/watergles_fragment.glsl @@ -0,0 +1,209 @@ +#version 100 +precision mediump float; +precision mediump int; + +struct osg_LightSourceParameters { + mediump vec4 ambient; + mediump vec4 diffuse; + mediump vec4 specular; + mediump vec4 position; + mediump vec4 halfVector; + mediump vec3 spotDirection; + mediump float spotExponent; + mediump float spotCutoff; + mediump float spotCosCutoff; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; +uniform osg_LightSourceParameters osg_LightSource[1]; + +#define REFRACTION @refraction_enabled + +// Inspired by Blender GLSL Water by martinsh ( http://devlog-martinsh.blogspot.de/2012/07/waterundewater-shader-wip.html ) + +// tweakables -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +const float VISIBILITY = 1200.0; // how far you can look through water + +const float BIG_WAVES_X = 0.1; // strength of big waves +const float BIG_WAVES_Y = 0.1; + +const float MID_WAVES_X = 0.1; // strength of middle sized waves +const float MID_WAVES_Y = 0.1; + +const float SMALL_WAVES_X = 0.1; // strength of small waves +const float SMALL_WAVES_Y = 0.1; + +const float WAVE_CHOPPYNESS = 0.05; // wave choppyness +const float WAVE_SCALE = 75.0; // overall wave scale + +const float BUMP = 0.5; // overall water surface bumpiness +const float REFL_BUMP = 0.10; // reflection distortion amount +const float REFR_BUMP = 0.07; // refraction distortion amount + +const float SCATTER_AMOUNT = 0.3; // amount of sunlight scattering +const vec3 SCATTER_COLOUR = vec3(0.0,1.0,0.95); // colour of sunlight scattering + +const vec3 SUN_EXT = vec3(0.45, 0.55, 0.68); //sunlight extinction + +const float SPEC_HARDNESS = 256.0; // specular highlights hardness + +const vec2 WIND_DIR = vec2(0.5, -0.8); +const float WIND_SPEED = 0.2; + +const vec3 WATER_COLOR = vec3(0.090195, 0.115685, 0.12745); + +// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + +float fresnel_dielectric(vec3 Incoming, vec3 Normal, float eta) +{ + float c = abs(dot(Incoming, Normal)); + float g = eta * eta - 1.0 + c * c; + float result; + + if(g > 0.0) { + g = sqrt(g); + float A =(g - c)/(g + c); + float B =(c *(g + c)- 1.0)/(c *(g - c)+ 1.0); + result = 0.5 * A * A *(1.0 + B * B); + } + else + result = 1.0; + + return result; +} + +varying vec3 screenCoordsPassthrough; +varying vec4 position; +varying float depthPassthrough; + +uniform sampler2D normalMap; + +uniform sampler2D reflectionMap; +#if REFRACTION +uniform sampler2D refractionMap; +uniform sampler2D refractionDepthMap; +#endif + +uniform float osg_SimulationTime; + +uniform float near; +uniform float far; +uniform vec3 nodePosition; + +void main(void) +{ + vec3 worldPos = position.xyz + nodePosition.xyz; + vec2 UV = worldPos.xy / (8192.0*5.0) * 3.0; + UV.y *= -1.0; + + float shadow = 1.0; + + vec2 screenCoords = screenCoordsPassthrough.xy / screenCoordsPassthrough.z; + screenCoords.y = (1.0-screenCoords.y); + + vec2 nCoord = vec2(0.0,0.0); + + #define waterTimer osg_SimulationTime + + nCoord = UV * (WAVE_SCALE * 0.05) + WIND_DIR * waterTimer * (WIND_SPEED*0.04); + vec3 normal0 = 2.0 * texture2D(normalMap, nCoord + vec2(-waterTimer*0.015,-waterTimer*0.005)).rgb - 1.0; + nCoord = UV * (WAVE_SCALE * 0.1) + WIND_DIR * waterTimer * (WIND_SPEED*0.08)-(normal0.xy/normal0.zz)*WAVE_CHOPPYNESS; + vec3 normal1 = 2.0 * texture2D(normalMap, nCoord + vec2(+waterTimer*0.020,+waterTimer*0.015)).rgb - 1.0; + + nCoord = UV * (WAVE_SCALE * 0.25) + WIND_DIR * waterTimer * (WIND_SPEED*0.07)-(normal1.xy/normal1.zz)*WAVE_CHOPPYNESS; + vec3 normal2 = 2.0 * texture2D(normalMap, nCoord + vec2(-waterTimer*0.04,-waterTimer*0.03)).rgb - 1.0; + nCoord = UV * (WAVE_SCALE * 0.5) + WIND_DIR * waterTimer * (WIND_SPEED*0.09)-(normal2.xy/normal2.z)*WAVE_CHOPPYNESS; + vec3 normal3 = 2.0 * texture2D(normalMap, nCoord + vec2(+waterTimer*0.03,+waterTimer*0.04)).rgb - 1.0; + + nCoord = UV * (WAVE_SCALE* 1.0) + WIND_DIR * waterTimer * (WIND_SPEED*0.4)-(normal3.xy/normal3.zz)*WAVE_CHOPPYNESS; + vec3 normal4 = 2.0 * texture2D(normalMap, nCoord + vec2(-waterTimer*0.02,+waterTimer*0.1)).rgb - 1.0; + nCoord = UV * (WAVE_SCALE * 2.0) + WIND_DIR * waterTimer * (WIND_SPEED*0.7)-(normal4.xy/normal4.zz)*WAVE_CHOPPYNESS; + vec3 normal5 = 2.0 * texture2D(normalMap, nCoord + vec2(+waterTimer*0.1,-waterTimer*0.06)).rgb - 1.0; + + + + vec3 normal = (normal0 * BIG_WAVES_X + normal1 * BIG_WAVES_Y + + normal2 * MID_WAVES_X + normal3 * MID_WAVES_Y + + normal4 * SMALL_WAVES_X + normal5 * SMALL_WAVES_Y); + + normal = normalize(vec3(normal.x * BUMP, normal.y * BUMP, normal.z)); + + normal = vec3(-normal.x, -normal.y, normal.z); + + // normal for sunlight scattering + vec3 lNormal = (normal0 * BIG_WAVES_X*0.5 + normal1 * BIG_WAVES_Y*0.5 + + normal2 * MID_WAVES_X*0.2 + normal3 * MID_WAVES_Y*0.2 + + normal4 * SMALL_WAVES_X*0.1 + normal5 * SMALL_WAVES_Y*0.1).xyz; + lNormal = normalize(vec3(lNormal.x * BUMP, lNormal.y * BUMP, lNormal.z)); + lNormal = vec3(-lNormal.x, -lNormal.y, lNormal.z); + + + vec3 lVec = normalize((gl_ModelViewMatrixInverse * vec4(osg_LightSource[0].position.xyz, 0.0)).xyz); + + vec3 cameraPos = (gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0)).xyz; + vec3 vVec = normalize(position.xyz - cameraPos.xyz); + + float isUnderwater = (cameraPos.z > 0.0) ? 0.0 : 1.0; + + // sunlight scattering + vec3 pNormal = vec3(0.0,0.0,1.0); + vec3 lR = reflect(lVec, lNormal); + vec3 llR = reflect(lVec, pNormal); + + float sunHeight = lVec.z; + float sunFade = length(gl_LightModel.ambient.xyz); + + float s = clamp(dot(lR, vVec)*2.0-1.2, 0.0, 1.0); + float lightScatter = shadow * clamp(dot(lVec,lNormal)*0.7+0.3, 0.0, 1.0) * s * SCATTER_AMOUNT * sunFade * clamp(1.0-exp(-sunHeight), 0.0, 1.0); + vec3 scatterColour = mix(vec3(SCATTER_COLOUR)*vec3(1.0,0.4,0.0), SCATTER_COLOUR, clamp(1.0-exp(-sunHeight*SUN_EXT), 0.0, 1.0)); + + // fresnel + float ior = (cameraPos.z>0.0)?(1.333/1.0):(1.0/1.333); //air to water; water to air + float fresnel = fresnel_dielectric(vVec, normal, ior); + + fresnel = clamp(fresnel, 0.0, 1.0); + + // reflection + vec3 reflection = texture2D(reflectionMap, screenCoords+(normal.xy*REFL_BUMP)).rgb; + + // refraction +#if REFRACTION + vec3 refraction = texture2D(refractionMap, screenCoords-(normal.xy*REFR_BUMP)).rgb; + + // brighten up the refraction underwater + refraction = (cameraPos.z < 0.0) ? clamp(refraction * 1.5, 0.0, 1.0) : refraction; +#endif + + // specular + vec3 R = reflect(vVec, normal); + float specular = pow(max(dot(R, lVec), 0.0),SPEC_HARDNESS) * shadow; + + vec3 waterColor = WATER_COLOR; + waterColor = waterColor * length(gl_LightModel.ambient.xyz); +#if REFRACTION + float refractionDepth = texture2D(refractionDepthMap, screenCoords-(normal.xy*REFR_BUMP)).x; + float z_n = 2.0 * refractionDepth - 1.0; + refractionDepth = 2.0 * near * far / (far + near - z_n * (far - near)); + + float waterDepth = refractionDepth - depthPassthrough; + + if (cameraPos.z > 0.0) + refraction = mix(refraction, waterColor, clamp(waterDepth/VISIBILITY, 0.0, 1.0)); + + gl_FragData[0].xyz = mix( mix(refraction, scatterColour, lightScatter), reflection, fresnel) + specular * osg_LightSource[0].specular.xyz; +#else + gl_FragData[0].xyz = mix(reflection, waterColor, (1.0-fresnel)*0.5) + specular * osg_LightSource[0].specular.xyz; +#endif + + // fog + float fogValue = clamp((depthPassthrough - gl_Fog.start) * gl_Fog.scale, 0.0, 1.0); + gl_FragData[0].xyz = mix(gl_FragData[0].xyz, gl_Fog.color.xyz, fogValue); + +#if REFRACTION + gl_FragData[0].w = 1.0; +#else + gl_FragData[0].w = clamp(fresnel*2.0 + specular, 0.0, 1.0); +#endif +} diff --git a/files/shaders/watergles_vertex.glsl b/files/shaders/watergles_vertex.glsl new file mode 100644 index 000000000..71cc9718b --- /dev/null +++ b/files/shaders/watergles_vertex.glsl @@ -0,0 +1,24 @@ +#version 100 +precision mediump float; +precision mediump int; + +varying vec3 screenCoordsPassthrough; +varying vec4 position; +varying float depthPassthrough; + +void main(void) +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + mat4 scalemat = mat4(0.5, 0.0, 0.0, 0.0, + 0.0, -0.5, 0.0, 0.0, + 0.0, 0.0, 0.5, 0.0, + 0.5, 0.5, 0.5, 1.0); + + vec4 texcoordProj = ((scalemat) * ( gl_Position)); + screenCoordsPassthrough = vec3(texcoordProj.x, texcoordProj.y, texcoordProj.w); + + position = gl_Vertex; + + depthPassthrough = gl_Position.z; +} From 16c6816a6fd9c6c94db15b97681b72d6150531e7 Mon Sep 17 00:00:00 2001 From: sandstranger Date: Mon, 23 Nov 2015 20:42:30 +0300 Subject: [PATCH 3/9] add forgotten file for building on opengles --- components/myguiplatform/myguirendermanager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/myguiplatform/myguirendermanager.cpp b/components/myguiplatform/myguirendermanager.cpp index 5bd56dc8f..5fb3054a6 100644 --- a/components/myguiplatform/myguirendermanager.cpp +++ b/components/myguiplatform/myguirendermanager.cpp @@ -17,6 +17,10 @@ #include #include "myguitexture.hpp" + +#ifdef OPENGLES + #include +#endif #define MYGUI_PLATFORM_LOG_SECTION "Platform" #define MYGUI_PLATFORM_LOG(level, text) MYGUI_LOGGING(MYGUI_PLATFORM_LOG_SECTION, level, text) From d7e27fa9f443bcc1aa6394314456ad457ef7cf70 Mon Sep 17 00:00:00 2001 From: cfcohen Date: Mon, 23 Nov 2015 16:36:59 -0500 Subject: [PATCH 4/9] New brief comments version of settings.cfg. --- files/settings-default.cfg | 614 ++++++++----------------------------- 1 file changed, 121 insertions(+), 493 deletions(-) diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 9a8d8c67e..6ad4ccff9 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -1,713 +1,341 @@ -# WARNING: Editing this file might have no effect, as these settings -# are overwritten by your user settings file. Your user settings file -# varies with your operating system: -# -# Linux: $HOME/.config/openmw -# Mac: $HOME/Library/Preferences/openmw -# Windows: C:\Users\Username\Documents\my games\openmw -# This path may vary depending on your installation hard drive, your -# Windows username, and your default language. +# This file provides minimal documentation for each setting, and +# ranges of recommended values. For detailed explanations of the +# significance of each setting, interaction with other settings, hard +# limits on value ranges and more information in general, please read +# the detailed documentation at the OpenMW Wiki page: +# +# https://wiki.openmw.org/index.php?title=Settings # -# Additionally, the user settings file is often written to disk when -# exiting OpenMW, so comments and changes to that file may also be -# discarded after running OpenMW. While most changes to the file will -# reflect setting changes made in game, some settings can have a wider -# range of values in the settings file than the GUI settings widgets -# allow. You may want to exercise some caution and backup this file -# when editing it by hand. +# The version of this file that actually controls the behavior of +# OpenMW is user specific, and it's location can be found in the +# documentation above. This file is probably NOT that file. [Camera] -# This floating point setting controls the distance to the near -# clipping plane. The value must be greater than zero. Values -# greater than approximately 18.0 will occasionally clip objects in -# the world in front of the character. Values greater than -# approximately 8.0 will clip the character's hands in first person -# view and/or the back of their head in third person view. +# Near clipping plane (0.01 to 18.0). near clip = 5.0 -# This boolean setting determines whether objects that render to one -# pixel or smaller will be culled. It generally improves performance -# to enable this feature. +# Cull objects smaller than one pixel. small feature culling = true -# Set the maximum visible distance. Larger values significantly -# improve rendering in exterior spaces, but also increase the amount -# rendered geometry and significantly reduce the frame rate. This -# value is a floating point value that defaults to 6666.0. This value -# interacts with the "exterior cell load distance" setting in that -# it's probably undesired for this value to provide visibility into -# cells that have not yet been loaded. When cells are visible before -# loading, the geometry will "pop-in" suddenly, creating a jarring -# visual effect. To prevent this effect, this value must be less -# than: -# -# 8192 * exterior cell load distance - 1024 -# -# The constant 8192 is the size of a cell, and 1024 is the threshold -# distance for loading a new cell. Additionally, the "field of view" -# setting also interacts with this setting because the view frustrum -# end is a plane, so you can see further at the edges of the screen -# than you should be able to. This can be observed in game by looking -# at distant objects and rotating the camera so the object are near -# the edge of the screen. As a result, the "viewing distance" setting -# should further be reduced by a factor that depends on the "field of -# view" setting. In the default configuration this reduction is 7%. -# Using this factor, approximate values recommended for other -# "exterior cell load distance" settings are: 14285 for 2 cells, 21903 -# for 3 cells, 29522 for 4 cells, and 35924 for 5 cells. -# -# Reductions of up 25% or more can be required to completely eliminate -# pop-in for wide fields of view and long viewing distances near the -# edges of the screen, but such situations are unusual and probably -# not worth the performance penalty introduced by loading geometry -# obscured by fog in the center of the screen. -# -# This setting can be adjusted in game from the ridiculously low value -# of 2000 to a maximum of 6666, using the "View Distance" slider in -# the Detail tab of the Video panel of the Options menu. See -# RenderingManager::configureFog for the relevant source code. +# Maximum visible distance (2000.0 to 6666.0+). Caution: this setting +# can dramatically affect performance, see documentation for details. viewing distance = 6666.0 [Cells] -# This integer setting determines the number of exterior cells -# adjacent to the character that will be loaded for rendering. It -# interacts with "viewing distance" and "field of view" as described -# previously, and it is generally very wasteful for this value to load -# geometry than will almost never be visible due to viewing distance -# and fog. For low frame rate screenshots of scenic vistas, this -# setting should be set high, and viewing distances adjusted -# accordingly. This value must be greater than or equal to 1. +# Adjacent exterior cells loaded (>0). Caution: this setting can +# dramatically affect performance, see documentation for details. exterior cell load distance = 1 [GUI] -# These two settings determine the background color of the tool tip -# and the crosshair when hovering over an item owned by an NPC. The -# color definitions are composed of four floating point values between -# 0.0 and 1.0 inclusive, representing the red, green, blue and alpha -# channels. The alpha value is currently ignored. The crosshair -# color will have no effect if the "crosshair" setting in the HUD -# section is disabled. These colors are used only if the "show owned" -# setting is enabled in the Game section. +# Color for tool tips and crosshair when owned by an NPC (R G B A). color background owned = 0.15 0.0 0.0 1.0 color crosshair owned = 1.0 0.15 0.15 1.0 -# This boolean setting enables or disables the "red flash" overlay -# that provides a visual clue when the character has taken damage. +# Red flash visually showing player damage. hit fader = true -# This floating point setting controls the transparency of the GUI -# windows. The value should be between 0.0 (transparent) and 1.0 -# (opaque). The setting can be adjusted in game with the "Menu -# Transparency" slider in the Prefs panel of the Options menu. +# Transparency of GUI windows (0.0 to 1.0, transparent to opaque). menu transparency = 0.84 -# This floating point setting scales the GUI interface windows. The -# value must be greater than 0.0. A value of 1.0 results in the -# default scale. Values much larger than 2.0 may result in user -# interface components being inaccessible. +# Scales GUI window and widget size. (<1 is smaller, >1 is larger). scaling factor = 1.0 -# Stretch or shrink the introductory movie, new game screen, and -# loading screens to fill the specified video resolution. The default -# assets have a 4:3 aspect ratio, but other assets may have other -# resolutions. If this setting is false, the assets will be centered -# in their correct aspect ratio. +# Stretch menus, load screens, etc. to the window aspect ratio. stretch menu background = false -# Enable or disable subtitles for NPC spoken dialog (and some sound -# effects). Subtitles will appear in a tool tip box in the lower -# center of the screen. The setting can be toggled in game with the -# "Subtitles" button in the Prefs panel of Options menu. +# Subtitles for NPC spoken dialog and some sound effects. subtitles = false -# Set the delay between when you begin hovering over an item and when -# it's tooltip appears. This setting is a floating point value -# between 0.0, which displays the tool tip instantly and 1.0 which -# results in the maximum delay (approximately 1.5 seconds). This -# setting does not affect the tooltip delay for object under the -# crosshair in the "look mode", only widgets in the GUI windows. This -# setting can be adjusted in game with the "Menu Help Delay" slider in -# the Prefs panel of the Options menu. +# Time until tool tip appears when hovering over an object (0.0 is +# instantly, 1.0 is the maximum delay of about 1.5 seconds). tooltip delay = 0.0 -# Enable or disable the werewolf overlay. Unable to evaluate fully -# due to issues with becoming a werewolf. +# Werewolf overlay border around screen or window. werewolf overlay = true [Game] -# If this boolean setting is true, the character will always use the -# most powerful attack when striking with a weapon (chop, slash or -# thrust). If this setting is false, the type of attack is determined -# by the direction that the character is moving at the time the attack -# begins. The setting can be toggled with the "Always Use Best -# Attack" button in the Prefs panel of the Options menu. +# Always use the best mode of attack: e.g. chop, slash or thrust. best attack = false -# This integer setting adjusts the difficulty of the game and is -# intended to be in the range -100 to 100 inclusive. Given the -# default game setting for fDifficultyMult of 5.0, a value of -100 -# results in the player taking 80% of the usual damage, doing 6 times -# the normal damage. A value of 100 results in the player taking 6 -# times as much damage, but inflicting only 80% of the usual damage. -# Values less than -500 will result in the player receiving no damage, -# and values greater than 500 will result in the player inflicting no -# damage. The setting can be controlled in game with the Difficulty -# slider in the Prefs panel of the Options menu. +# Difficulty. Expressed as damage dealt and received. (-100 to 100). difficulty = 0 -# Show the remaining duration of magic effects and lights if this -# boolean setting is true. The remaining duration is displayed in the -# tooltip by hovering over the magical effect. +# Show duration of magic effect and lights in the spells window. show effect duration = false -# Enable visual clues for items owned by NPCs when the crosshair is on -# the object. If the setting is 0, no clues are provided which is the -# default Morrowind behavior. If the setting is 1, the background of -# the tool tip for the object is highlight in the color specified by -# the "color background owned" setting in the "GUI" section. If the -# setting is 2, the crosshair is the color of the "color crosshair -# owned" setting in the "GUI" section. If the setting is 3, both the -# tool tip background and the crosshair are colored. Settings 2 and 3 -# only color the crosshair if it's enabled in the "HUD" section. +# Color crosshair and tool tip when object is owned by an NPC. (O is +# no color, 1 is tool tip only, 2 is crosshair only, and 3 is both). show owned = 0 [General] -# Set the maximum anisotropic filtering on textures. Anisotropic -# filtering is a method of enhancing the image quality of textures on -# surfaces that are at oblique viewing angles with respect to the -# camera. Valid values range from 0 to 16. Modern video cards can -# often perform 8 or 16 anisotropic filtering with a minimal -# performance impact. This effect of this setting can be seen in the -# Video panel of the Options menu by finding a location with straight -# lines (striped rugs and Balmora cobblestones work well) radiating -# into the distance, and adjusting the anisotropy slider. This -# setting can be changed in game using the "Anisotropy" slider in the -# Detail tab of the Video panel of the Options menu. +# Anisotropy reduces distortion in textures at low angles (0 to 16). anisotropy = 4 -# Sets the camera field of view in degrees. Recommended values range -# from 30 degrees to 110 degrees. Small values provide a very narrow -# field of view that creates a "zoomed in" effect, while large values -# cause distortion at the edges of the screen. The "field of view" -# setting interacts with aspect ratio of your video resolution in that -# more square aspect ratios (e.g. 4:3) need a wider field of view to -# more resemble the same field of view on a widescreen (e.g. 16:9) -# monitor. This setting can be adjusted in game from the Video tab of -# the Video panel of the Options menu using the "Field of View" -# slider. +# Camera field of view in degrees (30.0 to 110.0). field of view = 55.0 -# Specify the format for screenshots taken by pressing F12. This -# setting should be the file extension commonly associated with the -# desired format. The formats supported will be determined at -# compilation, but "jpg", "png", and "tga" should be allowed. +# File format for screenshots. (jpg, png, tga, and possibly more). screenshot format = png -# Set the isotropic texture filtering mode to bilinear or trilinear. -# Bilinear filtering is a texture filtering method used to smooth -# textures when displayed larger or smaller than they actually are. -# Bilinear filtering is reasonably accurate until the scaling of the -# texture gets below half or above double the original size of the -# texture. Trilinear filtering is an extension of the bilinear -# texture filtering method, which also performs linear interpolation -# between mipmaps. Both methods use mipmaps in OpenMW, and the -# corresponding OpenGL modes are LINEAR_MIPMAP_NEAREST and -# LINEAR_MIPMAP_LINEAR. Trilinear filtering produces better texturing -# at a minimal cost on modern video cards. This setting can be -# changed in game using the "Texture filtering" pull down in the -# Detail tab of the Video panel of the Options menu. +# Isotropic texture filtering. (bilinear or trilinear). texture filtering = trilinear [HUD] -# This boolean setting determines whether the crosshair or reticle is -# displayed. If this setting is disabled it will override "show -# owned" and "color crosshair owned". This setting can be toggled -# with the "Crosshair" button in the Prefs panel of the Options menu. +# Displays the crosshair or reticle when not in GUI mode. crosshair = true [Input] -# Allow zooming in and out using the middle mouse wheel in third -# person view. +# Zoom in and out from player in third person view with mouse wheel. allow third person zoom = false -# If this boolean setting is true, the character is running by -# default, otherwise the character is walking by default. The shift -# key will temporarily invert this setting, and the caps lock key will -# invert this setting while it's "locked". Confusingly, this setting -# is updated every time you exit the game, based on whether the caps -# lock key was on or off at the time you exited. +# Player is running by default. always run = false -# This floating point setting controls the camera/mouse sensitivity -# when in "look mode". The default sensitivity is 1.0, with smaller -# values requiring more mouse movement, and larger values requiring -# less. This setting is multiplicative in magnitude. This setting -# does not affect mouse speed in GUI mode. +# Camera sensitivity when not in GUI mode. (0.1 to 5.0). camera sensitivity = 1.0 -# This floating point setting controls the vertical camera/mouse -# sensitivity relative to the horizontal sensitivity (see "camera -# sensitivity") above. It is multiplicative with the previous -# setting, meaning that it should remain set at 1.0 unless the player -# desires to have different sensitivities in the two axes. +# Vertical camera sensitivity multiplier when not in GUI mode. +# Because it's a multiplier values should be near one (0.5 to 1.5). camera y multiplier = 1.0 -# OpenMW will capture control of the cursor if this boolean setting is -# true. In "look mode", OpenMW will capture the cursor regardless of -# the value of this setting (since the cursor/crosshair is always -# centered in the OpenMW window). However, in GUI mode, this setting -# determines the behavior when the cursor is moved outside the OpenMW -# window. If true, the cursor movement stops at the edge of the -# window preventing access to other applications. If false, the -# cursor is allowed to move freely on the desktop. -# -# This setting does not apply to the screen where escape has been -# pressed, where the cursor is never captured. Regardless of this -# setting "Alt-Tab" or some other operating system dependent key -# sequence can be used to allow the operating system to regain control -# of the mouse cursor. This setting interacts with the "minimize on -# focus loss" setting by affecting what counts as a focus loss. -# Specifically on a two-screen configuration it may be more convenient -# to access the second screen with setting disabled. +# Capture control of the cursor prevent movement outside the window. grab cursor = true -# Invert the vertical axis while in "look mode". If this setting is -# true, moving the mouse away from the player will look down, while -# moving it towards the player will look up. This setting does not -# affect cursor movement in GUI mode. +# Invert the vertical axis while not in GUI mode. invert y axis = false -# This boolean setting causes the behavior of the sneak key (Ctrl by -# default) to toggle sneaking on and off rather than requiring the key -# to be held while sneaking. Players that spend significant time -# sneaking may find the character easier to control with this option -# enabled. +# Key controlling sneak toggles setting instead of being held down. toggle sneak = false -# This setting continues to be loaded and saved, but has no known -# effect. Presumably it and a related but also removed option named -# "ui y sensitivity" used to control mouse sensitivity while in GUI -# mode. The default value is 1.0. -ui sensitivity = 1.0 - [Map] -# It is not currently possible to control how many adjacent cells are -# displayed in the map. It appears that this is hardcoded to one -# adjacent cell (3x3) in the code. These settings control the canvas -# and resolution sizes, and therefore the amount of panning required -# to see the entire map, and the level of detail visible. - -# This integer setting adjusts the scale of the world map in the GUI -# mode map display. The value is the width in pixels of each cell in -# the map, so larger values result in larger more detailed world maps, -# while smaller values result in smaller less detailed world maps. -# However, the native resolution of the map source material appears to -# be 9 pixels per unexplored cell and approximately 18 pixels per -# explored cell, so values larger than 36 don't produce much -# additional detail. Similarly, the size of place markers is -# currently fixed at 12 pixels, so values smaller than this result in -# overlapping place markers. Values from 12 to 36 are recommended. -# For reference, Vvardenfell is approximately 41x36 cells. +# Size of each exterior cell in pixels in the world map. (12 to 24). +# Warning: affects explored areas in save files, see documentation. global map cell size = 18 -# This integer setting controls the zoom level for the HUD map display -# (the map in the lower right corner while not in GUI mode). A value -# of 64 results in the HUD map displaying one exterior cell. Since -# the GUI mode map displays 3x3 cells, a value of approximately 21 -# displays the same area as the GUI mode map. Larger values increase -# the level of zoom, while smaller values are wasteful. -# -# Note that the actual size of the widget is always the same on the -# screen unless the "scaling factor" setting in the "GUI" section is -# changed. Increasing both the scaling factor of the GUI and this -# setting does result in a higher resolution HUD map, but -# unfortunately with a scaled direction pointer on top of it. +# Zoom level in pixels for HUD map widget. 64 is one cell, 128 is 1/4 +# cell, 256 is 1/8 cell. See documentation for details. (64 to 256). local map hud widget size = 256 -# This integer setting controls the resolution of the GUI mode local -# map widget. Larger values generally increase the visible detail in -# map. If this setting is half the "local map widget size" or -# smaller, the map will generally be be fairly blurry. Setting the -# both options to the same value results in a map with good detail. -# Values that exceed the "local map widget size" setting by more than -# a factor of two are unlikely to provide much of an improvement in -# detail since they're subsequently scaled back to the approximately -# the map widget size before display. The video resolution setting -# interacts with this setting in that regard. +# Resolution of local map in GUI window in pixels. See documentation +# for details which may affect cell load performance. (128 to 1024). local map resolution = 256 -# This integer setting controls the canvas size of the GUI mode local -# map widget. Larger values result in a larger physical map size on -# screen, and typically require more panning to see all available -# portions of the map. This larger size also enables an overall -# greater level of detail if the "local map resolution" setting is -# also increased. +# Size of local map in GUI window in pixels. See documentation for +# details which may affect cell load performance. (256 to 1024). local map widget size = 512 [Objects] -# This boolean setting currently has no known impact, but is -# presumably intended to enable shaders for objects other than water. -# Whenever the setting file is written by the game, this option is -# currently reset to false. +# Enable shaders for objects other than water. Unused. shaders = true [Saves] -# This string setting contains the default character name for loading -# saved games. This setting is automatically updated from the Load -# game menu option when a different character is selected. -character = - -# This boolean setting determines whether the game will be -# automatically saved when the character rests. This setting can be -# toggled in game with the "Auto-Save when Rest" button in the Prefs -# panel of the Options menu. +# Automatically save the game whenever the player rests. autosave = true -# This boolean setting determines whether the amount of the time the -# player has spent playing will displayed for each saved game in the -# menu for saving and loading games. This setting can not currently -# be adjusted in game. This setting is disabled by default for players -# who would prefer not to know how many hours they've spent -# playing. :-) +# Name of last character played, and default for loading save files. +character = + +# Display the time played on each save file in the load menu. timeplayed = false [Shadows] -# Shadows in general are dependent on the "shaders" setting be enabled -# in the Objects section. Additionally, the "enabled" setting in this -# section must be true for any other options in this section to have -# effect. Both that setting and the Shadows section options are -# temporarily disabled following the conversion to the OpenSceneGraph -# engine. None of these option can be adjusted in game at the present -# time. - -# This boolean setting enables actors to cast shadows. +# Actors cast shadows. Unused. actor shadows = true -# Enable debugging of shadows? +# Debugging of shadows. Unused. debug = false -# Are shadows enabled in general? +# Enable shadows. Other shadow settings disabled if false. Unused. enabled = false -# This floating point setting determines the fraction of the total -# shadow distance after which the shadow starts to fade out. +# Fraction of distance after which shadow starts to fade out. Unused. fade start = 0.8 -# Allows miscellaneous object to cast shadows. +# Miscellaneous object cast shadows. misc shadows = true -# This setting will only have effect if the "split" setting in the -# Shadows section is false. Increasing shadow distance will lower the -# shadow quality. +# Distance for shadows if not split. Smaller is poorer. Unused. shadow distance = 1300 -# Split the shadow maps, allowing for a larger shadow distance? +# Split shadow maps, allowing for a larger shadow distance. Unused. split = false -# This setting will only have effect if the "split" setting in the -# Shadows section is true. # This one shouldn't be too low, otherwise -# you'll see artifacts. Use at least 2x max viewing distance. +# Distance for shadows if split. Unused. split shadow distance = 14000 -# Allow static objects to cast shadows. +# Static objects cast shadows. Unused. statics shadows = true -# Allow terrain to cast shadows. +# Terrain cast shadows. Unused. terrain shadows = true -# Size of the shadow textures. Higher resolution texture produce more -# detailed shadows and a better visual effect. +# Size of the shadow textures in pixels. Unused. (256 to 2048). texture size = 1024 [Sound] -# This string setting determines which audio device to use. A blank or -# missing setting means to use the default device, which should -# usually be sufficient, but if you need to explicitly specify a -# device name try doing so here. +# Name of audio device file. Blank means use the default device. device = -# The settings in the Sound section are generally floating point -# settings in the range from 0.0 (silent) to 1.0 (maximum volume). -# All sound settings are multiplied by the "master volume" setting, and -# will thus have no effect if the master volume is set to 0.0. These -# settings can be adjusted in game from the Audio panel of the Options -# menu under the appropriately labeled slider. +# Volumes are 0.0 for silent and 1.0 for the maximum volume. -# The volume of footsteps from the character and other actors. +# Footsteps volume. footsteps volume = 0.2 -# The master volume is multiplied with all other volume settings to -# determine the final volume +# Master volume. Controls all other volumes. master volume = 1.0 -# The volume for music tracks. +# Music tracks volume. music volume = 0.5 -# The volume for special effect sounds such as combat noises, etc. +# Sound effects volume. sfx volume = 1.0 -# The volume for spoken dialog from NPCs. +# Voice dialog volume. voice volume = 0.8 [Terrain] -<<<<<<< HEAD -# Not currently used, presumably due to the OpenSceneGraph upgrade. +# Distant land is rendered? Unused. distant land = false -# Not currently used, presumably due to the OpenSceneGraph upgrade. +# Use shaders for terrain? Unused. shader = true -======= -camera y multiplier = 1.0 ->>>>>>> upstream/master [Video] -# This integer setting controls anti-aliasing. Anti-aliasing is -# technique designed to reduce distortions called aliasing caused by -# displaying high resolution textures at a lower resolution. -# Anti-aliasing can correct these distortions at the cost of a minor -# reduction in the frame rate. A value of 0 disables anti-aliasing. -# Other powers of two (e.g. 2, 4, 8, 16) are supported according to -# the capabilities of your graphics hardware. Higher values do a -# better job of correcting the distortion and have a greater impact on -# frame rate. This setting can be configured from a list of valid -# choices in the Graphics panel of the OpenMW Launcher. +# Anti-aliasing reduces texture distortion. (0, 2, 4, 8, 16). antialiasing = 0 -# This floating point setting controls the contrast correction for all -# video in the game. This setting does not currently work under -# Linux, and the in-game setting in the Options menu has been -# disabled. -contrast = 1.00 - -# This floating point setting determines the maximum frame rate in -# frames per second. If this setting is 0.0, the frame rate is -# unlimited. There are several reasons to consider capping your frame -# rate, especially if you're already experiencing a relatively high -# frame rate (greater than 60 frames per second). Lower frame rates -# will consume less power and generate less heat and noise. Frame -# rates above 60 frames per second rarely produce perceptible -# improvements in visual quality. Capping the frame rate may in some -# situations reduce the perception of choppiness (highly variable -# frame rates during game play) by lowering the peak frame rates. -# This setting interacts with the "vsync" setting in the Video section -# in the sense that enabling vertical sync limits the frame rate to -# the refresh rate of your monitor (often 60 frames per second). +# Game video contrast. (0.0 to 1.0). No effect in Linux. +contrast = 1.0 + +# Maximum frames per second. (1.0 to 200.0). framerate limit = 0.0 -# This boolean setting determines whether the entire screen is used -# for the specified resolution. This setting can be toggled in game -# using the "Fullscreen" button in the Video tab of the Video panel in -# the Options menu. It can also be toggled with the "Full Screen" -# check box in the Graphic tab of the OpenMW Launcher. +# OpenMW takes complete control of the screen. fullscreen = false -# Theses two setting determine the horizontal and vertical resolution -# of the OpenMW game window. Larger values produce more detailed -# images within the constraints of your graphics hardware but also -# significantly reduce the frame rate. The window resolution can be -# selected from a menu of common screen sizes in the Video tab of the -# Video Panel of the Options menu. The resolution can also be set to -# a custom value in the Graphics tab of the OpenMW Launcher. +# Resolution of the Open window or screen. (600 to 2560). resolution x = 800 resolution y = 600 -# This boolean setting determines whether there's an operating system -# border drawn around the OpenMW window. If this setting is true, the -# window can be moved and resized with the operating system window -# controls. If this setting is false, the window has no operating -# system border. This setting has no effect if the "fullscreen" -# setting in the Video section is true. This setting can be toggled -# in game using the "Window Border" button in the Video tab of the -# Video panel in the Options menu. It can also be toggled with the -# "Window Border" check box in the OpenMW Launcher. +# An operating system border is drawn around the OpenMW window. window border = true -# This integer setting determines which screen the game will open on -# in multi-monitor configurations. This setting is particularly -# important when "fullscreen" setting in the Video section is true, -# since this is the only way to control which screen is used, but it -# can also be used to control which screen a normal window or a -# borderless window opens on as well. This setting can be selected -# from a pull down menu in the Graphics tab of the OpenMW Launcher, -# but not adjusted during game play. +# Determines which screen OpenMW is on. (0 or 1). screen = 0 -# Minimize the OpenMW window if it loses cursor focus. This setting -# has no effect if the "fullscreen" setting is false. This setting is -# primarily useful for single screen configurations, so that the -# OpenMW screen in full screen mode can be minimized when the -# operating system regains control of the mouse and keyboard. On -# multiple screen configurations, disabling this option make make it -# easier to switch between screens while playing OpenMW. +# Minimize OpenMW if it loses cursor or keyboard focus. minimize on focus loss = true -# This boolean setting determines whether frame draws are synchronized -# with the vertical refresh rate of your monitor. Enabling this -# setting can reduce "tearing", a visual defect caused by updating the -# image buffer in the middle of a screen draw. Enabling this option -# typically implies limiting the framerate to 60 frames per second, -# but may also introduce additional delays caused by having to wait -# until the appropriate time (the vertical blanking interval) to draw -# a frame. - -# This setting can be adjusted in game using the "VSync" button in the -# Video tab of the Video panel in the Options menu. It can also be -# changed by toggling the "Vertical Sync" check box in the Graphics -# tab of the OpenMW Launcher. +# Enable vertical syncing to reduce tearing defects. vsync = false -# This floating point setting controls the gamma correction for all -# video in the game. This setting does not currently work under -# Linux, and the in-game setting in the Options menu has been -# disabled. -gamma = 1.00 +# Video gamma setting. (0.0 to 1.0). No effect in Linux. +gamma = 1.0 [Water] -# The water settings can be tested experimentally in the Water tab of -# the Video panel in the Options menu. Changes there will be saved to -# these settings. - -# This boolean setting enables the refraction rendering feature of the -# water shader. Refraction causes deep water to be more opaque and -# objects seen through the plane of the water to have a wavy -# appearance. Enabling this feature results in better visuals, and a -# marginally lower framerate depending on your graphics hardware. The -# "shader" setting in the Water section must be enabled for this -# setting to have any effect. +# Enable refraction which affects visibility through water plane. refraction = false -# Refracted texture size. In the Video panel of the options menu, the -# choices are Low (512), Medium (1024) and High (2048). This setting -# determines the resolution of the textures used for rendering objects -# on the other wide of the plane of water (which have a wavy -# appearance caused the by the refraction). Higher values produces -# better visuals and result in a marginally lower framerate depending -# on your graphics hardware. The "refraction" setting in the "Water" -# section must be enabled for this setting to have any effect. +# Reflection and refraction texture size in pixels. (512, 1024, 2048). rtt size = 512 -# This boolean setting enables or disables the water shader, which -# results in much more realistic looking water surfaces, including -# shadows of reflected objects. +# Enable water shader with reflections and optionally refraction. shader = false [Windows] -# Each window in the GUI mode remembers it's previous location. Each -# setting is a floating point number representing a fraction of the -# "resolution x" or "resolution y" setting in the Video section. The -# X and Y values locate the top left corner, while the W value -# determines the width of the window and the H value determines the -# height of the window. +# Location and sizes of windows as a fraction of the OpenMW window or +# screen size. (0.0 to 1.0). X & Y, Height & Width. -# The alchemy window, for crafting potions. Activated by dragging an -# alchemy tool on to the rag doll. Unlike most other windows, this -# window hides all other windows when opened. +# Alchemy window for crafting potions. alchemy h = 0.5 alchemy w = 0.5 alchemy x = 0.25 alchemy y = 0.25 -# The NPC bartering window, displaying goods owned by the shopkeeper -# while bartering. Activated by clicking on the "Barter" choice in -# the dialog window for an NPC. +# NPC inventory window when bartering with a shopkeeper. barter h = 0.375 barter w = 0.75 barter x = 0.25 -barter y = 0 +barter y = 0.0 -# Unused? +# NPC inventory window when trading with a companion. companion h = 0.375 companion w = 0.75 companion x = 0.25 -companion y = 0 +companion y = 0.0 -# The console command window. Activated by pressing the tilde (~) key. +# Console command window for debugging commands. console h = 0.5 -console w = 1 -console x = 0 -console y = 0 +console w = 1.0 +console x = 0.0 +console y = 0.0 -# The container window, showing the contents of the container. -# Activated by clicking on a container. The same window is used for -# searching dead bodies, and pickpocketing people. +# Container inventory when searching a container. container h = 0.375 container w = 0.75 container x = 0.25 -container y = 0 +container y = 0.0 -# The dialog window, for talking with NPCs. Activated by clicking on a -# NPC. +# Dialog window for talking with NPCs. dialogue h = 0.810 dialogue w = 0.810 dialogue x = 0.095 dialogue y = 0.095 -# The character inventory window while bartering. It displays goods -# owned by the character while bartering. Activated by clicking on the -# "Barter" choice in the dialog window for an NPC. +# Player inventory window when bartering with a shopkeeper. inventory barter h = 0.5725 inventory barter w = 0.6225 -inventory barter x = 0 +inventory barter x = 0.0 inventory barter y = 0.4275 -# Unused? +# Player inventory window when trading with a companion. inventory companion h = 0.5725 inventory companion w = 0.6225 -inventory companion x = 0 +inventory companion x = 0.0 inventory companion y = 0.4275 -# The character inventory window while searching a container, showing -# the contents of the character's inventory. Activated by clicking on -# a container. The same window is used for searching dead bodies, and -# pickpocketing people. +# Player inventory window when searching a container. inventory container h = 0.5725 inventory container w = 0.6225 -inventory container x = 0 +inventory container x = 0.0 inventory container y = 0.4275 -# The inventory window, displaying the paper doll and possessions. -# Activated by clicking on the inventory widget (second from left) in -# the bottom left corner of the HUD. +# Player inventory window when explicitly opened. inventory h = 0.5725 inventory w = 0.6225 -inventory x = 0 +inventory x = 0.0 inventory y = 0.4275 -# The local and world map window. Activated by clicking on the map -# widget in the bottom right corner of the HUD. +# Local and world map window. map h = 0.5725 map w = 0.375 map x = 0.625 -map y = 0 +map y = 0.0 -# The spells window, displaying powers, spells, and magical items. -# Activated by clicking on the spells widget (third from left) in the -# bottom left corner of the HUD. +# Spells window displaying powers, spells, and magical items. spells h = 0.4275 spells w = 0.375 spells x = 0.625 spells y = 0.5725 -# The stats window, displaying level, race, class, skills and stats. -# Activated by clicking on any of the three bars in the lower left -# corner of the HUD. +# Stats window displaying level, race, class, skills and stats. stats h = 0.4275 stats w = 0.375 -stats x = 0 -stats y = 0 +stats x = 0.0 +stats y = 0.0 From 89100088f35a66834e83ce88979226898f55c450 Mon Sep 17 00:00:00 2001 From: cfcohen Date: Mon, 23 Nov 2015 20:07:48 -0500 Subject: [PATCH 5/9] The latest version of the settings.cfg without any code changes. --- files/settings-default.cfg | 354 ++++++++++++++++++------------------- 1 file changed, 177 insertions(+), 177 deletions(-) diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 6ad4ccff9..3b91e7f0a 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -8,7 +8,7 @@ # # The version of this file that actually controls the behavior of # OpenMW is user specific, and it's location can be found in the -# documentation above. This file is probably NOT that file. +# documentation above. This file is probably NOT that file... [Camera] @@ -28,36 +28,63 @@ viewing distance = 6666.0 # dramatically affect performance, see documentation for details. exterior cell load distance = 1 -[GUI] +[Map] -# Color for tool tips and crosshair when owned by an NPC (R G B A). -color background owned = 0.15 0.0 0.0 1.0 -color crosshair owned = 1.0 0.15 0.15 1.0 +# Size of each exterior cell in pixels in the world map. (12 to 24). +# Warning: affects explored areas in save files, see documentation. +global map cell size = 18 -# Red flash visually showing player damage. -hit fader = true +# Zoom level in pixels for HUD map widget. 64 is one cell, 128 is 1/4 +# cell, 256 is 1/8 cell. See documentation for details. (64 to 256). +local map hud widget size = 256 -# Transparency of GUI windows (0.0 to 1.0, transparent to opaque). -menu transparency = 0.84 +# Resolution of local map in GUI window in pixels. See documentation +# for details which may affect cell load performance. (128 to 1024). +local map resolution = 256 + +# Size of local map in GUI window in pixels. See documentation for +# details which may affect cell load performance. (256 to 1024). +local map widget size = 512 + +[GUI] # Scales GUI window and widget size. (<1 is smaller, >1 is larger). scaling factor = 1.0 +# Transparency of GUI windows (0.0 to 1.0, transparent to opaque). +menu transparency = 0.84 + +# Time until tool tip appears when hovering over an object (0.0 is +# instantly, 1.0 is the maximum delay of about 1.5 seconds). +tooltip delay = 0.0 + # Stretch menus, load screens, etc. to the window aspect ratio. stretch menu background = false # Subtitles for NPC spoken dialog and some sound effects. subtitles = false -# Time until tool tip appears when hovering over an object (0.0 is -# instantly, 1.0 is the maximum delay of about 1.5 seconds). -tooltip delay = 0.0 +# Red flash visually showing player damage. +hit fader = true # Werewolf overlay border around screen or window. werewolf overlay = true +# Color for tool tips and crosshair when owned by an NPC (R G B A). +color background owned = 0.15 0.0 0.0 1.0 +color crosshair owned = 1.0 0.15 0.15 1.0 + +[HUD] + +# Displays the crosshair or reticle when not in GUI mode. +crosshair = true + [Game] +# Color crosshair and tool tip when object is owned by an NPC. (O is +# no color, 1 is tool tip only, 2 is crosshair only, and 3 is both). +show owned = 0 + # Always use the best mode of attack: e.g. chop, slash or thrust. best attack = false @@ -67,10 +94,6 @@ difficulty = 0 # Show duration of magic effect and lights in the spells window. show effect duration = false -# Color crosshair and tool tip when object is owned by an NPC. (O is -# no color, 1 is tool tip only, 2 is crosshair only, and 3 is both). -show owned = 0 - [General] # Anisotropy reduces distortion in textures at low angles (0 to 16). @@ -85,19 +108,20 @@ screenshot format = png # Isotropic texture filtering. (bilinear or trilinear). texture filtering = trilinear -[HUD] - -# Displays the crosshair or reticle when not in GUI mode. -crosshair = true - [Input] -# Zoom in and out from player in third person view with mouse wheel. -allow third person zoom = false +# Capture control of the cursor prevent movement outside the window. +grab cursor = true + +# Key controlling sneak toggles setting instead of being held down. +toggle sneak = false # Player is running by default. always run = false +# Zoom in and out from player in third person view with mouse wheel. +allow third person zoom = false + # Camera sensitivity when not in GUI mode. (0.1 to 5.0). camera sensitivity = 1.0 @@ -105,84 +129,20 @@ camera sensitivity = 1.0 # Because it's a multiplier values should be near one (0.5 to 1.5). camera y multiplier = 1.0 -# Capture control of the cursor prevent movement outside the window. -grab cursor = true - # Invert the vertical axis while not in GUI mode. invert y axis = false -# Key controlling sneak toggles setting instead of being held down. -toggle sneak = false - -[Map] - -# Size of each exterior cell in pixels in the world map. (12 to 24). -# Warning: affects explored areas in save files, see documentation. -global map cell size = 18 - -# Zoom level in pixels for HUD map widget. 64 is one cell, 128 is 1/4 -# cell, 256 is 1/8 cell. See documentation for details. (64 to 256). -local map hud widget size = 256 - -# Resolution of local map in GUI window in pixels. See documentation -# for details which may affect cell load performance. (128 to 1024). -local map resolution = 256 - -# Size of local map in GUI window in pixels. See documentation for -# details which may affect cell load performance. (256 to 1024). -local map widget size = 512 - -[Objects] - -# Enable shaders for objects other than water. Unused. -shaders = true - [Saves] -# Automatically save the game whenever the player rests. -autosave = true - # Name of last character played, and default for loading save files. character = +# Automatically save the game whenever the player rests. +autosave = true + # Display the time played on each save file in the load menu. timeplayed = false -[Shadows] - -# Actors cast shadows. Unused. -actor shadows = true - -# Debugging of shadows. Unused. -debug = false - -# Enable shadows. Other shadow settings disabled if false. Unused. -enabled = false - -# Fraction of distance after which shadow starts to fade out. Unused. -fade start = 0.8 - -# Miscellaneous object cast shadows. -misc shadows = true - -# Distance for shadows if not split. Smaller is poorer. Unused. -shadow distance = 1300 - -# Split shadow maps, allowing for a larger shadow distance. Unused. -split = false - -# Distance for shadows if split. Unused. -split shadow distance = 14000 - -# Static objects cast shadows. Unused. -statics shadows = true - -# Terrain cast shadows. Unused. -terrain shadows = true - -# Size of the shadow textures in pixels. Unused. (256 to 2048). -texture size = 1024 - [Sound] # Name of audio device file. Blank means use the default device. @@ -190,12 +150,12 @@ device = # Volumes are 0.0 for silent and 1.0 for the maximum volume. -# Footsteps volume. -footsteps volume = 0.2 - # Master volume. Controls all other volumes. master volume = 1.0 +# Footsteps volume. +footsteps volume = 0.2 + # Music tracks volume. music volume = 0.5 @@ -205,34 +165,14 @@ sfx volume = 1.0 # Voice dialog volume. voice volume = 0.8 -[Terrain] - -# Distant land is rendered? Unused. -distant land = false - -# Use shaders for terrain? Unused. -shader = true - [Video] -# Anti-aliasing reduces texture distortion. (0, 2, 4, 8, 16). -antialiasing = 0 - -# Game video contrast. (0.0 to 1.0). No effect in Linux. -contrast = 1.0 - -# Maximum frames per second. (1.0 to 200.0). -framerate limit = 0.0 - -# OpenMW takes complete control of the screen. -fullscreen = false - # Resolution of the Open window or screen. (600 to 2560). resolution x = 800 resolution y = 600 -# An operating system border is drawn around the OpenMW window. -window border = true +# OpenMW takes complete control of the screen. +fullscreen = false # Determines which screen OpenMW is on. (0 or 1). screen = 0 @@ -240,102 +180,162 @@ screen = 0 # Minimize OpenMW if it loses cursor or keyboard focus. minimize on focus loss = true +# An operating system border is drawn around the OpenMW window. +window border = true + +# Anti-aliasing reduces texture distortion. (0, 2, 4, 8, 16). +antialiasing = 0 + # Enable vertical syncing to reduce tearing defects. vsync = false +# Maximum frames per second. (1.0 to 200.0). +framerate limit = 0.0 + +# Game video contrast. (0.0 to 1.0). No effect in Linux. +contrast = 1.0 + # Video gamma setting. (0.0 to 1.0). No effect in Linux. gamma = 1.0 [Water] -# Enable refraction which affects visibility through water plane. -refraction = false +# Enable water shader with reflections and optionally refraction. +shader = false # Reflection and refraction texture size in pixels. (512, 1024, 2048). rtt size = 512 -# Enable water shader with reflections and optionally refraction. -shader = false +# Enable refraction which affects visibility through water plane. +refraction = false + +[Objects] + +# Enable shaders for objects other than water. Unused. +shaders = true + +[Terrain] + +# Use shaders for terrain? Unused. +shader = true + +# Distant land is rendered? Unused. +distant land = false + +[Shadows] + +# Enable shadows. Other shadow settings disabled if false. Unused. +enabled = false + +# Size of the shadow textures in pixels. Unused. (256 to 2048). +texture size = 1024 + +# Actors cast shadows. Unused. +actor shadows = true + +# Static objects cast shadows. Unused. +statics shadows = true + +# Terrain cast shadows. Unused. +terrain shadows = true + +# Miscellaneous objects cast shadows. Unused. +misc shadows = true + +# Debugging of shadows. Unused. +debug = false + +# Fraction of distance after which shadow starts to fade out. Unused. +fade start = 0.8 + +# Split shadow maps, allowing for a larger shadow distance. Unused. +split = false + +# Distance for shadows if not split. Smaller is poorer. Unused. +shadow distance = 1300 + +# Distance for shadows if split. Unused. +split shadow distance = 14000 [Windows] # Location and sizes of windows as a fraction of the OpenMW window or -# screen size. (0.0 to 1.0). X & Y, Height & Width. +# screen size. (0.0 to 1.0). X & Y, Width & Height. + +# Stats window displaying level, race, class, skills and stats. +stats x = 0.0 +stats y = 0.0 +stats w = 0.375 +stats h = 0.4275 + +# Spells window displaying powers, spells, and magical items. +spells x = 0.625 +spells y = 0.5725 +spells w = 0.375 +spells h = 0.4275 + +# Local and world map window. +map x = 0.625 +map y = 0.0 +map w = 0.375 +map h = 0.5725 + +# Dialog window for talking with NPCs. +dialogue x = 0.095 +dialogue y = 0.095 +dialogue w = 0.810 +dialogue h = 0.810 # Alchemy window for crafting potions. -alchemy h = 0.5 -alchemy w = 0.5 alchemy x = 0.25 alchemy y = 0.25 - -# NPC inventory window when bartering with a shopkeeper. -barter h = 0.375 -barter w = 0.75 -barter x = 0.25 -barter y = 0.0 - -# NPC inventory window when trading with a companion. -companion h = 0.375 -companion w = 0.75 -companion x = 0.25 -companion y = 0.0 +alchemy w = 0.5 +alchemy h = 0.5 # Console command window for debugging commands. -console h = 0.5 -console w = 1.0 console x = 0.0 console y = 0.0 +console w = 1.0 +console h = 0.5 -# Container inventory when searching a container. -container h = 0.375 -container w = 0.75 -container x = 0.25 -container y = 0.0 +# Player inventory window when explicitly opened. +inventory x = 0.0 +inventory y = 0.4275 +inventory w = 0.6225 +inventory h = 0.5725 -# Dialog window for talking with NPCs. -dialogue h = 0.810 -dialogue w = 0.810 -dialogue x = 0.095 -dialogue y = 0.095 +# Player inventory window when searching a container. +inventory container x = 0.0 +inventory container y = 0.4275 +inventory container w = 0.6225 +inventory container h = 0.5725 # Player inventory window when bartering with a shopkeeper. -inventory barter h = 0.5725 -inventory barter w = 0.6225 inventory barter x = 0.0 inventory barter y = 0.4275 +inventory barter w = 0.6225 +inventory barter h = 0.5725 # Player inventory window when trading with a companion. -inventory companion h = 0.5725 -inventory companion w = 0.6225 inventory companion x = 0.0 inventory companion y = 0.4275 +inventory companion w = 0.6225 +inventory companion h = 0.5725 -# Player inventory window when searching a container. -inventory container h = 0.5725 -inventory container w = 0.6225 -inventory container x = 0.0 -inventory container y = 0.4275 - -# Player inventory window when explicitly opened. -inventory h = 0.5725 -inventory w = 0.6225 -inventory x = 0.0 -inventory y = 0.4275 - -# Local and world map window. -map h = 0.5725 -map w = 0.375 -map x = 0.625 -map y = 0.0 +# Container inventory when searching a container. +container x = 0.25 +container y = 0.0 +container w = 0.75 +container h = 0.375 -# Spells window displaying powers, spells, and magical items. -spells h = 0.4275 -spells w = 0.375 -spells x = 0.625 -spells y = 0.5725 +# NPC inventory window when bartering with a shopkeeper. +barter x = 0.25 +barter y = 0.0 +barter w = 0.75 +barter h = 0.375 -# Stats window displaying level, race, class, skills and stats. -stats h = 0.4275 -stats w = 0.375 -stats x = 0.0 -stats y = 0.0 +# NPC inventory window when trading with a companion. +companion x = 0.25 +companion y = 0.0 +companion w = 0.75 +companion h = 0.375 From e0752ccdd058e3ef6daff73d661b6f24e99c5be8 Mon Sep 17 00:00:00 2001 From: cfcohen Date: Tue, 24 Nov 2015 00:10:23 -0500 Subject: [PATCH 6/9] Prioritize warning about user settings. Make recommendations for screen number more generic. Remove resolution recommendation. --- files/settings-default.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 3b91e7f0a..f16ef9124 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -1,3 +1,6 @@ +# WARNING: Editing this file might have no effect, as these settings +# are overwritten by your user settings file. +# # This file provides minimal documentation for each setting, and # ranges of recommended values. For detailed explanations of the # significance of each setting, interaction with other settings, hard @@ -6,9 +9,6 @@ # # https://wiki.openmw.org/index.php?title=Settings # -# The version of this file that actually controls the behavior of -# OpenMW is user specific, and it's location can be found in the -# documentation above. This file is probably NOT that file... [Camera] @@ -167,14 +167,14 @@ voice volume = 0.8 [Video] -# Resolution of the Open window or screen. (600 to 2560). +# Resolution of the Open window or screen. resolution x = 800 resolution y = 600 # OpenMW takes complete control of the screen. fullscreen = false -# Determines which screen OpenMW is on. (0 or 1). +# Determines which screen OpenMW is on. (>=0). screen = 0 # Minimize OpenMW if it loses cursor or keyboard focus. From ac2eedcb7d944240bb8f35ef179ade8811f3b544 Mon Sep 17 00:00:00 2001 From: cfcohen Date: Wed, 25 Nov 2015 09:24:38 -0500 Subject: [PATCH 7/9] Change wording in warning to be clearer. Correct ranges on contrast and gamma. --- files/settings-default.cfg | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/files/settings-default.cfg b/files/settings-default.cfg index f16ef9124..5ed2d688d 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -1,5 +1,6 @@ -# WARNING: Editing this file might have no effect, as these settings -# are overwritten by your user settings file. +# WARNING: If this file is named settings-default.cfg, then editing +# this file might have no effect, as these settings may be overwritten +# by your user settings.cfg file (see docmentation for its location). # # This file provides minimal documentation for each setting, and # ranges of recommended values. For detailed explanations of the @@ -192,10 +193,10 @@ vsync = false # Maximum frames per second. (1.0 to 200.0). framerate limit = 0.0 -# Game video contrast. (0.0 to 1.0). No effect in Linux. +# Game video contrast. (>0.0). No effect in Linux. contrast = 1.0 -# Video gamma setting. (0.0 to 1.0). No effect in Linux. +# Video gamma setting. (>0.0). No effect in Linux. gamma = 1.0 [Water] From 8a3ec14bc616e897f3bbf22c2e6992ae752c6460 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 25 Nov 2015 19:22:48 +0100 Subject: [PATCH 8/9] Revert "Merge remote-tracking branch 'sandstranger/opengles'" This reverts commit cc9cab6fd1531a8df6e44ea34c5843c7e9070ad5, reversing changes made to da856eed9512aa202f93b955552f6f7d8ca7ecd2. --- CMakeLists.txt | 44 ++-- apps/openmw/CMakeLists.txt | 34 +-- apps/openmw/android_main.c | 1 + apps/openmw/main.cpp | 2 +- apps/openmw/mwrender/localmap.cpp | 5 - apps/openmw/mwrender/sky.cpp | 5 - apps/openmw/mwrender/water.cpp | 11 +- cmake/FindOpenGLES.cmake | 94 -------- cmake/FindOpenGLES2.cmake | 170 -------------- components/CMakeLists.txt | 105 ++++----- .../myguiplatform/myguirendermanager.cpp | 4 - components/sdlutil/sdlcursormanager.cpp | 3 - files/shaders/CMakeLists.txt | 20 +- files/shaders/watergles_fragment.glsl | 209 ------------------ files/shaders/watergles_vertex.glsl | 24 -- 15 files changed, 71 insertions(+), 660 deletions(-) delete mode 100644 cmake/FindOpenGLES.cmake delete mode 100644 cmake/FindOpenGLES2.cmake delete mode 100644 files/shaders/watergles_fragment.glsl delete mode 100644 files/shaders/watergles_vertex.glsl diff --git a/CMakeLists.txt b/CMakeLists.txt index ec14d5916..d038936d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,20 +47,8 @@ include(OpenMWMacros) if (ANDROID) set(CMAKE_FIND_ROOT_PATH ${OPENMW_DEPENDENCIES_DIR} "${CMAKE_FIND_ROOT_PATH}") - set(OSG_PLUGINS_DIR ${OSG_PLUGINS_DIR}) - add_definitions (-DOSG_PLUGINS_DIR) - set(OPENGLES TRUE CACHE BOOL "enable opengl es support for android" FORCE) endif (ANDROID) -option(OPENGLES "enable opengl es support" FALSE ) - -if (OPENGLES) - INCLUDE(cmake/FindOpenGLES.cmake) - INCLUDE(cmake/FindOpenGLES2.cmake) - add_definitions (-DOPENGLES) - INCLUDE_DIRECTORIES(${OPENGLES_INCLUDE_DIR}) -endif (OPENGLES) - # doxygen main page configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_BINARY_DIR}/docs/mainpage.hpp") @@ -157,21 +145,21 @@ if (WIN32) endif() # Dependencies -if (NOT ANDROID) - set(DESIRED_QT_VERSION 4 CACHE STRING "The QT version OpenMW should use (4 or 5)") - message(STATUS "Using Qt${DESIRED_QT_VERSION}") - if (DESIRED_QT_VERSION MATCHES 4) - find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui QtNetwork QtOpenGL) - else() - find_package(Qt5Widgets REQUIRED) - find_package(Qt5Core REQUIRED) - find_package(Qt5Network REQUIRED) - find_package(Qt5OpenGL REQUIRED) - # Instruct CMake to run moc automatically when needed. - #set(CMAKE_AUTOMOC ON) - endif() +set(DESIRED_QT_VERSION 4 CACHE STRING "The QT version OpenMW should use (4 or 5)") +message(STATUS "Using Qt${DESIRED_QT_VERSION}") + +if (DESIRED_QT_VERSION MATCHES 4) + find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui QtNetwork QtOpenGL) +else() + find_package(Qt5Widgets REQUIRED) + find_package(Qt5Core REQUIRED) + find_package(Qt5Network REQUIRED) + find_package(Qt5OpenGL REQUIRED) + # Instruct CMake to run moc automatically when needed. + #set(CMAKE_AUTOMOC ON) endif() + # Fix for not visible pthreads functions for linker with glibc 2.15 if (UNIX AND NOT APPLE) find_package (Threads) @@ -201,11 +189,7 @@ IF(BOOST_STATIC) set(Boost_USE_STATIC_LIBS ON) endif() -if (NOT ANDROID) - find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgQt osgUtil osgFX) -else() - find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgUtil osgFX) -endif() +find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgQt osgUtil osgFX) include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) if(OSG_STATIC) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 1f0fe71ab..59a523023 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -134,50 +134,18 @@ target_link_libraries(openmw ) if (ANDROID) - set (OSG_PLUGINS - -Wl,--whole-archive - ${OSG_PLUGINS_DIR}/libosgdb_dds.a - ${OSG_PLUGINS_DIR}/libosgdb_bmp.a - ${OSG_PLUGINS_DIR}/libosgdb_tga.a - ${OSG_PLUGINS_DIR}/libosgdb_gif.a - ${OSG_PLUGINS_DIR}/libosgdb_jpeg.a - ${OSG_PLUGINS_DIR}/libosgdb_png.a - -Wl,--no-whole-archive - ) target_link_libraries(openmw EGL android log dl MyGUIEngineStatic + cpufeatures BulletCollision LinearMath - z - osg - osgDB - osgAnimation - osgText - osgUtil - osgShadow - ${OPENSCENEGRAPH_LIBRARIES} - ${OSG_PLUGINS} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - jpeg - gif - png ) endif (ANDROID) -if (OPENGLES) - target_link_libraries(openmw - ${OPENGLES_gl_LIBRARY} - ${OPENGLES2_gl_LIBRARY} - ) -endif (OPENGLES) - if (USE_SYSTEM_TINYXML) target_link_libraries(openmw ${TINYXML_LIBRARIES}) endif() diff --git a/apps/openmw/android_main.c b/apps/openmw/android_main.c index 8cd69e8f0..47b77a8b3 100644 --- a/apps/openmw/android_main.c +++ b/apps/openmw/android_main.c @@ -1,3 +1,4 @@ +#include "../../SDL_internal.h" #ifdef __ANDROID__ #include "SDL_main.h" diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index c3f0f8688..17ef46246 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -23,7 +23,7 @@ #endif -#if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID)) || (defined(__unix) && !defined(ANDROID)) || defined(__posix)) +#if (defined(__APPLE__) || defined(__linux) || defined(__unix) || defined(__posix)) #define USE_CRASH_CATCHER 1 #else #define USE_CRASH_CATCHER 0 diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index 077d21512..14ec770e8 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -24,11 +24,6 @@ #include "vismask.hpp" -#ifdef OPENGLES - #include -#endif - - namespace { diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 7572d7e92..66253f70d 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -45,11 +45,6 @@ #include "vismask.hpp" #include "renderbin.hpp" -#ifdef OPENGLES - #include -#endif - - namespace { diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 5a9bc664a..ca099991e 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -40,10 +40,6 @@ #include "ripplesimulation.hpp" #include "renderbin.hpp" -#ifdef OPENGLES -#include -#endif - namespace { @@ -579,13 +575,10 @@ void Water::createShaderWaterStateSet(osg::Node* node, Reflection* reflection, R // use a define map to conditionally compile the shader std::map defineMap; defineMap.insert(std::make_pair(std::string("@refraction_enabled"), std::string(refraction ? "1" : "0"))); -#ifdef OPENGLES - osg::ref_ptr vertexShader (readShader(osg::Shader::VERTEX, mResourcePath + "/shaders/watergles_vertex.glsl", defineMap)); - osg::ref_ptr fragmentShader (readShader(osg::Shader::FRAGMENT, mResourcePath + "/shaders/watergles_fragment.glsl", defineMap)); -#else + osg::ref_ptr vertexShader (readShader(osg::Shader::VERTEX, mResourcePath + "/shaders/water_vertex.glsl", defineMap)); osg::ref_ptr fragmentShader (readShader(osg::Shader::FRAGMENT, mResourcePath + "/shaders/water_fragment.glsl", defineMap)); -#endif + osg::ref_ptr normalMap (new osg::Texture2D(readPngImage(mResourcePath + "/shaders/water_nm.png"))); normalMap->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); normalMap->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); diff --git a/cmake/FindOpenGLES.cmake b/cmake/FindOpenGLES.cmake deleted file mode 100644 index 7ee2c07f1..000000000 --- a/cmake/FindOpenGLES.cmake +++ /dev/null @@ -1,94 +0,0 @@ -#------------------------------------------------------------------- -# This file is part of the CMake build system for OGRE -# (Object-oriented Graphics Rendering Engine) -# For the latest info, see http://www.ogre3d.org/ -# -# The contents of this file are placed in the public domain. Feel -# free to make use of it in any way you like. -#------------------------------------------------------------------- - -# - Try to find OpenGLES -# Once done this will define -# -# OPENGLES_FOUND - system has OpenGLES -# OPENGLES_INCLUDE_DIR - the GL include directory -# OPENGLES_LIBRARIES - Link these to use OpenGLES - -IF (WIN32) - IF (CYGWIN) - - FIND_PATH(OPENGLES_INCLUDE_DIR GLES/gl.h ) - - FIND_LIBRARY(OPENGLES_gl_LIBRARY libgles_cm ) - - ELSE (CYGWIN) - - IF(BORLAND) - SET (OPENGLES_gl_LIBRARY import32 CACHE STRING "OpenGL ES 1.x library for win32") - ELSE(BORLAND) - #MS compiler - todo - fix the following line: - SET (OPENGLES_gl_LIBRARY ${OGRE_SOURCE_DIR}/Dependencies/lib/release/libgles_cm.lib CACHE STRING "OpenGL ES 1.x library for win32") - ENDIF(BORLAND) - - ENDIF (CYGWIN) - -ELSE (WIN32) - - IF (APPLE) - - #create_search_paths(/Developer/Platforms) - #findpkg_framework(OpenGLES) - #set(OPENGLES_gl_LIBRARY "-framework OpenGLES") - - ELSE(APPLE) - - FIND_PATH(OPENGLES_INCLUDE_DIR GLES/gl.h - /opt/vc/include - /opt/graphics/OpenGL/include - /usr/openwin/share/include - /usr/X11R6/include - /usr/include - ) - - FIND_LIBRARY(OPENGLES_gl_LIBRARY - NAMES GLES_CM GLESv1_CM - PATHS /opt/vc/lib - /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/shlib /usr/X11R6/lib - /usr/lib - ) - - # On Unix OpenGL most certainly always requires X11. - # Feel free to tighten up these conditions if you don't - # think this is always true. - - #IF (OPENGLES_gl_LIBRARY) - # IF(NOT X11_FOUND) - # INCLUDE(FindX11) - # ENDIF(NOT X11_FOUND) - # IF (X11_FOUND) - # SET (OPENGLES_LIBRARIES ${X11_LIBRARIES}) - # ENDIF (X11_FOUND) - #ENDIF (OPENGLES_gl_LIBRARY) - - ENDIF(APPLE) -ENDIF (WIN32) - -SET( OPENGLES_FOUND "NO" ) -IF(OPENGLES_gl_LIBRARY) - - SET( OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY} ${OPENGLES_LIBRARIES}) - - SET( OPENGLES_FOUND "YES" ) - -ENDIF(OPENGLES_gl_LIBRARY) - -MARK_AS_ADVANCED( - OPENGLES_INCLUDE_DIR - OPENGLES_gl_LIBRARY -) - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGLES REQUIRED_VARS OPENGLES_LIBRARIES OPENGLES_INCLUDE_DIR) diff --git a/cmake/FindOpenGLES2.cmake b/cmake/FindOpenGLES2.cmake deleted file mode 100644 index 136e7618b..000000000 --- a/cmake/FindOpenGLES2.cmake +++ /dev/null @@ -1,170 +0,0 @@ -#------------------------------------------------------------------- -# This file is part of the CMake build system for OGRE -# (Object-oriented Graphics Rendering Engine) -# For the latest info, see http://www.ogre3d.org/ -# -# The contents of this file are placed in the public domain. Feel -# free to make use of it in any way you like. -#------------------------------------------------------------------- - -# - Try to find OpenGLES and EGL -# If using ARM Mali emulation you can specify the parent directory that contains the bin and include directories by -# setting the MALI_SDK_ROOT variable in the environment. -# -# For AMD emulation use the AMD_SDK_ROOT variable -# -# Once done this will define -# -# OPENGLES2_FOUND - system has OpenGLES -# OPENGLES2_INCLUDE_DIR - the GL include directory -# OPENGLES2_LIBRARIES - Link these to use OpenGLES -# -# EGL_FOUND - system has EGL -# EGL_INCLUDE_DIR - the EGL include directory -# EGL_LIBRARIES - Link these to use EGL - -#include(FindPkgMacros) - -IF (WIN32) - IF (CYGWIN) - - FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h ) - - FIND_LIBRARY(OPENGLES2_gl_LIBRARY libGLESv2 ) - - ELSE (CYGWIN) - - IF(BORLAND) - SET (OPENGLES2_gl_LIBRARY import32 CACHE STRING "OpenGL ES 2.x library for win32") - ELSE(BORLAND) - #getenv_path(AMD_SDK_ROOT) - #getenv_path(MALI_SDK_ROOT) - - SET(POWERVR_SDK_PATH "C:/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds") - FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h - ${ENV_AMD_SDK_ROOT}/include - ${ENV_MALI_SDK_ROOT}/include - ${POWERVR_SDK_PATH}/Include - "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include" - ) - - FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h - ${ENV_AMD_SDK_ROOT}/include - ${ENV_MALI_SDK_ROOT}/include - ${POWERVR_SDK_PATH}/Include - "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include" - ) - - FIND_LIBRARY(OPENGLES2_gl_LIBRARY - NAMES libGLESv2 - PATHS ${ENV_AMD_SDK_ROOT}/x86 - ${ENV_MALI_SDK_ROOT}/bin - ${POWERVR_SDK_PATH}/Windows/x86_32/Lib - "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib" - ) - - FIND_LIBRARY(EGL_egl_LIBRARY - NAMES libEGL - PATHS ${ENV_AMD_SDK_ROOT}/x86 - ${ENV_MALI_SDK_ROOT}/bin - ${POWERVR_SDK_PATH}/Windows/x86_32/Lib - "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib" - ) - ENDIF(BORLAND) - - ENDIF (CYGWIN) - -ELSE (WIN32) - - IF (APPLE) - - #create_search_paths(/Developer/Platforms) - #findpkg_framework(OpenGLES2) - #set(OPENGLES2_gl_LIBRARY "-framework OpenGLES") - - ELSE(APPLE) - #getenv_path(AMD_SDK_ROOT) - #getenv_path(MALI_SDK_ROOT) - - FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h - ${ENV_AMD_SDK_ROOT}/include - ${ENV_MALI_SDK_ROOT}/include - /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Include - /opt/vc/include - /usr/openwin/share/include - /opt/graphics/OpenGL/include /usr/X11R6/include - /usr/include - ) - - FIND_LIBRARY(OPENGLES2_gl_LIBRARY - NAMES GLESv2 - PATHS ${ENV_AMD_SDK_ROOT}/x86 - ${ENV_MALI_SDK_ROOT}/bin - /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib - /opt/vc/lib - /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/shlib /usr/X11R6/lib - /usr/lib - ) - - FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h - ${ENV_AMD_SDK_ROOT}/include - ${ENV_MALI_SDK_ROOT}/include - /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Include - /opt/vc/include - /usr/openwin/share/include - /opt/graphics/OpenGL/include /usr/X11R6/include - /usr/include - ) - - FIND_LIBRARY(EGL_egl_LIBRARY - NAMES EGL - PATHS ${ENV_AMD_SDK_ROOT}/x86 - ${ENV_MALI_SDK_ROOT}/bin - /opt/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib - /opt/vc/lib - /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/shlib /usr/X11R6/lib - /usr/lib - ) - - # On Unix OpenGL most certainly always requires X11. - # Feel free to tighten up these conditions if you don't - # think this is always true. - # It's not true on OSX. - - #IF (OPENGLES2_gl_LIBRARY) - # IF(NOT X11_FOUND) - # INCLUDE(FindX11) - # ENDIF(NOT X11_FOUND) - # IF (X11_FOUND) - # IF (NOT APPLE) - # SET (OPENGLES2_LIBRARIES ${X11_LIBRARIES}) - # ENDIF (NOT APPLE) - # ENDIF (X11_FOUND) - #ENDIF (OPENGLES2_gl_LIBRARY) - - ENDIF(APPLE) -ENDIF (WIN32) - -SET( OPENGLES2_FOUND "YES" ) -IF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY) - - SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES}) - SET( EGL_LIBRARIES ${EGL_egl_LIBRARY} ${EGL_LIBRARIES}) - SET( OPENGLES2_FOUND "YES" ) - -ENDIF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY) - -MARK_AS_ADVANCED( - OPENGLES2_INCLUDE_DIR - OPENGLES2_gl_LIBRARY - EGL_INCLUDE_DIR - EGL_egl_LIBRARY -) - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGLES2 REQUIRED_VARS OPENGLES2_LIBRARIES OPENGLES2_INCLUDE_DIR) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 7bfbf6d93..c80e27e4d 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -20,9 +20,8 @@ else (GIT_CHECKOUT) configure_file(${VERSION_IN_FILE} ${VERSION_FILE}) endif (GIT_CHECKOUT) -if (NOT ANDROID) - find_package(OpenGL REQUIRED) -endif() +find_package(OpenGL REQUIRED) + # source files add_component_dir (settings @@ -138,31 +137,31 @@ add_component_dir (version set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui ) -if (NOT ANDROID) - add_component_qt_dir (contentselector - model/modelitem model/esmfile - model/naturalsort model/contentmodel - model/loadordererror - view/combobox view/contentselector - ) - add_component_qt_dir (config - gamesettings - launchersettings - settingsbase - ) - - add_component_qt_dir (process - processinvoker - ) - if (DESIRED_QT_VERSION MATCHES 4) - include(${QT_USE_FILE}) - QT4_WRAP_UI(ESM_UI_HDR ${ESM_UI}) - QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) - else() - QT5_WRAP_UI(ESM_UI_HDR ${ESM_UI}) - QT5_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) - endif() +add_component_qt_dir (contentselector + model/modelitem model/esmfile + model/naturalsort model/contentmodel + model/loadordererror + view/combobox view/contentselector + ) +add_component_qt_dir (config + gamesettings + launchersettings + settingsbase + ) + +add_component_qt_dir (process + processinvoker +) + +if (DESIRED_QT_VERSION MATCHES 4) + include(${QT_USE_FILE}) + QT4_WRAP_UI(ESM_UI_HDR ${ESM_UI}) + QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) +else() + QT5_WRAP_UI(ESM_UI_HDR ${ESM_UI}) + QT5_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) endif() + if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) add_definitions(-fPIC) @@ -173,46 +172,32 @@ include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR}) -if (NOT ANDROID) - target_link_libraries(components - ${Boost_SYSTEM_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${OPENSCENEGRAPH_LIBRARIES} - ${BULLET_LIBRARIES} - ${SDL2_LIBRARY} - # For MyGUI platform - ${OPENGL_gl_LIBRARY} - ${MYGUI_LIBRARIES} - ) -else() - target_link_libraries(components - ${Boost_SYSTEM_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${OPENSCENEGRAPH_LIBRARIES} - ${BULLET_LIBRARIES} - ${SDL2_LIBRARY} - ${MYGUI_LIBRARIES} - ) -endif() +target_link_libraries(components + ${Boost_SYSTEM_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${OPENSCENEGRAPH_LIBRARIES} + ${BULLET_LIBRARIES} + ${SDL2_LIBRARY} + # For MyGUI platform + ${OPENGL_gl_LIBRARY} + ${MYGUI_LIBRARIES} +) if (WIN32) target_link_libraries(components ${Boost_LOCALE_LIBRARY}) endif() -if (NOT ANDROID) - if (DESIRED_QT_VERSION MATCHES 4) - target_link_libraries(components - ${QT_QTCORE_LIBRARY} - ${QT_QTGUI_LIBRARY}) - else() - qt5_use_modules(components Widgets Core) - endif() +if (DESIRED_QT_VERSION MATCHES 4) + target_link_libraries(components + ${QT_QTCORE_LIBRARY} + ${QT_QTGUI_LIBRARY}) +else() + qt5_use_modules(components Widgets Core) endif() + if (GIT_CHECKOUT) add_dependencies (components git-version) endif (GIT_CHECKOUT) diff --git a/components/myguiplatform/myguirendermanager.cpp b/components/myguiplatform/myguirendermanager.cpp index 5fb3054a6..5bd56dc8f 100644 --- a/components/myguiplatform/myguirendermanager.cpp +++ b/components/myguiplatform/myguirendermanager.cpp @@ -17,10 +17,6 @@ #include #include "myguitexture.hpp" - -#ifdef OPENGLES - #include -#endif #define MYGUI_PLATFORM_LOG_SECTION "Platform" #define MYGUI_PLATFORM_LOG(level, text) MYGUI_LOGGING(MYGUI_PLATFORM_LOG_SECTION, level, text) diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index 23f01f3a7..e1a67aff8 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -217,9 +217,6 @@ namespace SDLUtil void SDLCursorManager::_createCursorFromResource(const std::string& name, int rotDegrees, osg::Image* image, Uint8 size_x, Uint8 size_y, Uint8 hotspot_x, Uint8 hotspot_y) { - #ifdef ANDROID - return; - #endif if (mCursorMap.find(name) != mCursorMap.end()) return; diff --git a/files/shaders/CMakeLists.txt b/files/shaders/CMakeLists.txt index da2550275..fc4706c1f 100644 --- a/files/shaders/CMakeLists.txt +++ b/files/shaders/CMakeLists.txt @@ -1,17 +1,11 @@ # Copy resource files into the build directory set(SDIR ${CMAKE_CURRENT_SOURCE_DIR}) set(DDIR ${OpenMW_BINARY_DIR}/resources/shaders) -if (OPENGLES) - set(SHADER_FILES - watergles_vertex.glsl - watergles_fragment.glsl - water_nm.png - ) -else() - set(SHADER_FILES - water_vertex.glsl - water_fragment.glsl - water_nm.png - ) -endif() + +set(SHADER_FILES + water_vertex.glsl + water_fragment.glsl + water_nm.png +) + copy_all_files(${CMAKE_CURRENT_SOURCE_DIR} ${DDIR} "${SHADER_FILES}") diff --git a/files/shaders/watergles_fragment.glsl b/files/shaders/watergles_fragment.glsl deleted file mode 100644 index e3f756087..000000000 --- a/files/shaders/watergles_fragment.glsl +++ /dev/null @@ -1,209 +0,0 @@ -#version 100 -precision mediump float; -precision mediump int; - -struct osg_LightSourceParameters { - mediump vec4 ambient; - mediump vec4 diffuse; - mediump vec4 specular; - mediump vec4 position; - mediump vec4 halfVector; - mediump vec3 spotDirection; - mediump float spotExponent; - mediump float spotCutoff; - mediump float spotCosCutoff; - mediump float constantAttenuation; - mediump float linearAttenuation; - mediump float quadraticAttenuation; - }; -uniform osg_LightSourceParameters osg_LightSource[1]; - -#define REFRACTION @refraction_enabled - -// Inspired by Blender GLSL Water by martinsh ( http://devlog-martinsh.blogspot.de/2012/07/waterundewater-shader-wip.html ) - -// tweakables -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -const float VISIBILITY = 1200.0; // how far you can look through water - -const float BIG_WAVES_X = 0.1; // strength of big waves -const float BIG_WAVES_Y = 0.1; - -const float MID_WAVES_X = 0.1; // strength of middle sized waves -const float MID_WAVES_Y = 0.1; - -const float SMALL_WAVES_X = 0.1; // strength of small waves -const float SMALL_WAVES_Y = 0.1; - -const float WAVE_CHOPPYNESS = 0.05; // wave choppyness -const float WAVE_SCALE = 75.0; // overall wave scale - -const float BUMP = 0.5; // overall water surface bumpiness -const float REFL_BUMP = 0.10; // reflection distortion amount -const float REFR_BUMP = 0.07; // refraction distortion amount - -const float SCATTER_AMOUNT = 0.3; // amount of sunlight scattering -const vec3 SCATTER_COLOUR = vec3(0.0,1.0,0.95); // colour of sunlight scattering - -const vec3 SUN_EXT = vec3(0.45, 0.55, 0.68); //sunlight extinction - -const float SPEC_HARDNESS = 256.0; // specular highlights hardness - -const vec2 WIND_DIR = vec2(0.5, -0.8); -const float WIND_SPEED = 0.2; - -const vec3 WATER_COLOR = vec3(0.090195, 0.115685, 0.12745); - -// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - -float fresnel_dielectric(vec3 Incoming, vec3 Normal, float eta) -{ - float c = abs(dot(Incoming, Normal)); - float g = eta * eta - 1.0 + c * c; - float result; - - if(g > 0.0) { - g = sqrt(g); - float A =(g - c)/(g + c); - float B =(c *(g + c)- 1.0)/(c *(g - c)+ 1.0); - result = 0.5 * A * A *(1.0 + B * B); - } - else - result = 1.0; - - return result; -} - -varying vec3 screenCoordsPassthrough; -varying vec4 position; -varying float depthPassthrough; - -uniform sampler2D normalMap; - -uniform sampler2D reflectionMap; -#if REFRACTION -uniform sampler2D refractionMap; -uniform sampler2D refractionDepthMap; -#endif - -uniform float osg_SimulationTime; - -uniform float near; -uniform float far; -uniform vec3 nodePosition; - -void main(void) -{ - vec3 worldPos = position.xyz + nodePosition.xyz; - vec2 UV = worldPos.xy / (8192.0*5.0) * 3.0; - UV.y *= -1.0; - - float shadow = 1.0; - - vec2 screenCoords = screenCoordsPassthrough.xy / screenCoordsPassthrough.z; - screenCoords.y = (1.0-screenCoords.y); - - vec2 nCoord = vec2(0.0,0.0); - - #define waterTimer osg_SimulationTime - - nCoord = UV * (WAVE_SCALE * 0.05) + WIND_DIR * waterTimer * (WIND_SPEED*0.04); - vec3 normal0 = 2.0 * texture2D(normalMap, nCoord + vec2(-waterTimer*0.015,-waterTimer*0.005)).rgb - 1.0; - nCoord = UV * (WAVE_SCALE * 0.1) + WIND_DIR * waterTimer * (WIND_SPEED*0.08)-(normal0.xy/normal0.zz)*WAVE_CHOPPYNESS; - vec3 normal1 = 2.0 * texture2D(normalMap, nCoord + vec2(+waterTimer*0.020,+waterTimer*0.015)).rgb - 1.0; - - nCoord = UV * (WAVE_SCALE * 0.25) + WIND_DIR * waterTimer * (WIND_SPEED*0.07)-(normal1.xy/normal1.zz)*WAVE_CHOPPYNESS; - vec3 normal2 = 2.0 * texture2D(normalMap, nCoord + vec2(-waterTimer*0.04,-waterTimer*0.03)).rgb - 1.0; - nCoord = UV * (WAVE_SCALE * 0.5) + WIND_DIR * waterTimer * (WIND_SPEED*0.09)-(normal2.xy/normal2.z)*WAVE_CHOPPYNESS; - vec3 normal3 = 2.0 * texture2D(normalMap, nCoord + vec2(+waterTimer*0.03,+waterTimer*0.04)).rgb - 1.0; - - nCoord = UV * (WAVE_SCALE* 1.0) + WIND_DIR * waterTimer * (WIND_SPEED*0.4)-(normal3.xy/normal3.zz)*WAVE_CHOPPYNESS; - vec3 normal4 = 2.0 * texture2D(normalMap, nCoord + vec2(-waterTimer*0.02,+waterTimer*0.1)).rgb - 1.0; - nCoord = UV * (WAVE_SCALE * 2.0) + WIND_DIR * waterTimer * (WIND_SPEED*0.7)-(normal4.xy/normal4.zz)*WAVE_CHOPPYNESS; - vec3 normal5 = 2.0 * texture2D(normalMap, nCoord + vec2(+waterTimer*0.1,-waterTimer*0.06)).rgb - 1.0; - - - - vec3 normal = (normal0 * BIG_WAVES_X + normal1 * BIG_WAVES_Y + - normal2 * MID_WAVES_X + normal3 * MID_WAVES_Y + - normal4 * SMALL_WAVES_X + normal5 * SMALL_WAVES_Y); - - normal = normalize(vec3(normal.x * BUMP, normal.y * BUMP, normal.z)); - - normal = vec3(-normal.x, -normal.y, normal.z); - - // normal for sunlight scattering - vec3 lNormal = (normal0 * BIG_WAVES_X*0.5 + normal1 * BIG_WAVES_Y*0.5 + - normal2 * MID_WAVES_X*0.2 + normal3 * MID_WAVES_Y*0.2 + - normal4 * SMALL_WAVES_X*0.1 + normal5 * SMALL_WAVES_Y*0.1).xyz; - lNormal = normalize(vec3(lNormal.x * BUMP, lNormal.y * BUMP, lNormal.z)); - lNormal = vec3(-lNormal.x, -lNormal.y, lNormal.z); - - - vec3 lVec = normalize((gl_ModelViewMatrixInverse * vec4(osg_LightSource[0].position.xyz, 0.0)).xyz); - - vec3 cameraPos = (gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0)).xyz; - vec3 vVec = normalize(position.xyz - cameraPos.xyz); - - float isUnderwater = (cameraPos.z > 0.0) ? 0.0 : 1.0; - - // sunlight scattering - vec3 pNormal = vec3(0.0,0.0,1.0); - vec3 lR = reflect(lVec, lNormal); - vec3 llR = reflect(lVec, pNormal); - - float sunHeight = lVec.z; - float sunFade = length(gl_LightModel.ambient.xyz); - - float s = clamp(dot(lR, vVec)*2.0-1.2, 0.0, 1.0); - float lightScatter = shadow * clamp(dot(lVec,lNormal)*0.7+0.3, 0.0, 1.0) * s * SCATTER_AMOUNT * sunFade * clamp(1.0-exp(-sunHeight), 0.0, 1.0); - vec3 scatterColour = mix(vec3(SCATTER_COLOUR)*vec3(1.0,0.4,0.0), SCATTER_COLOUR, clamp(1.0-exp(-sunHeight*SUN_EXT), 0.0, 1.0)); - - // fresnel - float ior = (cameraPos.z>0.0)?(1.333/1.0):(1.0/1.333); //air to water; water to air - float fresnel = fresnel_dielectric(vVec, normal, ior); - - fresnel = clamp(fresnel, 0.0, 1.0); - - // reflection - vec3 reflection = texture2D(reflectionMap, screenCoords+(normal.xy*REFL_BUMP)).rgb; - - // refraction -#if REFRACTION - vec3 refraction = texture2D(refractionMap, screenCoords-(normal.xy*REFR_BUMP)).rgb; - - // brighten up the refraction underwater - refraction = (cameraPos.z < 0.0) ? clamp(refraction * 1.5, 0.0, 1.0) : refraction; -#endif - - // specular - vec3 R = reflect(vVec, normal); - float specular = pow(max(dot(R, lVec), 0.0),SPEC_HARDNESS) * shadow; - - vec3 waterColor = WATER_COLOR; - waterColor = waterColor * length(gl_LightModel.ambient.xyz); -#if REFRACTION - float refractionDepth = texture2D(refractionDepthMap, screenCoords-(normal.xy*REFR_BUMP)).x; - float z_n = 2.0 * refractionDepth - 1.0; - refractionDepth = 2.0 * near * far / (far + near - z_n * (far - near)); - - float waterDepth = refractionDepth - depthPassthrough; - - if (cameraPos.z > 0.0) - refraction = mix(refraction, waterColor, clamp(waterDepth/VISIBILITY, 0.0, 1.0)); - - gl_FragData[0].xyz = mix( mix(refraction, scatterColour, lightScatter), reflection, fresnel) + specular * osg_LightSource[0].specular.xyz; -#else - gl_FragData[0].xyz = mix(reflection, waterColor, (1.0-fresnel)*0.5) + specular * osg_LightSource[0].specular.xyz; -#endif - - // fog - float fogValue = clamp((depthPassthrough - gl_Fog.start) * gl_Fog.scale, 0.0, 1.0); - gl_FragData[0].xyz = mix(gl_FragData[0].xyz, gl_Fog.color.xyz, fogValue); - -#if REFRACTION - gl_FragData[0].w = 1.0; -#else - gl_FragData[0].w = clamp(fresnel*2.0 + specular, 0.0, 1.0); -#endif -} diff --git a/files/shaders/watergles_vertex.glsl b/files/shaders/watergles_vertex.glsl deleted file mode 100644 index 71cc9718b..000000000 --- a/files/shaders/watergles_vertex.glsl +++ /dev/null @@ -1,24 +0,0 @@ -#version 100 -precision mediump float; -precision mediump int; - -varying vec3 screenCoordsPassthrough; -varying vec4 position; -varying float depthPassthrough; - -void main(void) -{ - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - - mat4 scalemat = mat4(0.5, 0.0, 0.0, 0.0, - 0.0, -0.5, 0.0, 0.0, - 0.0, 0.0, 0.5, 0.0, - 0.5, 0.5, 0.5, 1.0); - - vec4 texcoordProj = ((scalemat) * ( gl_Position)); - screenCoordsPassthrough = vec3(texcoordProj.x, texcoordProj.y, texcoordProj.w); - - position = gl_Vertex; - - depthPassthrough = gl_Position.z; -} From fa610c447c7325963b537be1cec7ce02d3c6fb47 Mon Sep 17 00:00:00 2001 From: cfcohen Date: Wed, 25 Nov 2015 17:42:10 -0500 Subject: [PATCH 9/9] Fix typos. Add "e.g." in places where ranges are only recommmendations. Add more factual limits where that's easy. --- files/settings-default.cfg | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 5ed2d688d..cab6e7c4a 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -1,6 +1,6 @@ # WARNING: If this file is named settings-default.cfg, then editing # this file might have no effect, as these settings may be overwritten -# by your user settings.cfg file (see docmentation for its location). +# by your user settings.cfg file (see documentation for its location). # # This file provides minimal documentation for each setting, and # ranges of recommended values. For detailed explanations of the @@ -13,13 +13,13 @@ [Camera] -# Near clipping plane (0.01 to 18.0). +# Near clipping plane (>0.0, e.g. 0.01 to 18.0). near clip = 5.0 # Cull objects smaller than one pixel. small feature culling = true -# Maximum visible distance (2000.0 to 6666.0+). Caution: this setting +# Maximum visible distance (e.g. 2000.0 to 6666.0). Caution: this setting # can dramatically affect performance, see documentation for details. viewing distance = 6666.0 @@ -31,25 +31,24 @@ exterior cell load distance = 1 [Map] -# Size of each exterior cell in pixels in the world map. (12 to 24). +# Size of each exterior cell in pixels in the world map. (e.g. 12 to 24). # Warning: affects explored areas in save files, see documentation. global map cell size = 18 # Zoom level in pixels for HUD map widget. 64 is one cell, 128 is 1/4 -# cell, 256 is 1/8 cell. See documentation for details. (64 to 256). +# cell, 256 is 1/8 cell. See documentation for details. (e.g. 64 to 256). local map hud widget size = 256 # Resolution of local map in GUI window in pixels. See documentation -# for details which may affect cell load performance. (128 to 1024). +# for details which may affect cell load performance. (e.g. 128 to 1024). local map resolution = 256 -# Size of local map in GUI window in pixels. See documentation for -# details which may affect cell load performance. (256 to 1024). +# Size of local map in GUI window in pixels. (e.g. 256 to 1024). local map widget size = 512 [GUI] -# Scales GUI window and widget size. (<1 is smaller, >1 is larger). +# Scales GUI window and widget size. (<1.0 is smaller, >1.0 is larger). scaling factor = 1.0 # Transparency of GUI windows (0.0 to 1.0, transparent to opaque). @@ -89,7 +88,7 @@ show owned = 0 # Always use the best mode of attack: e.g. chop, slash or thrust. best attack = false -# Difficulty. Expressed as damage dealt and received. (-100 to 100). +# Difficulty. Expressed as damage dealt and received. (e.g. -100 to 100). difficulty = 0 # Show duration of magic effect and lights in the spells window. @@ -97,10 +96,10 @@ show effect duration = false [General] -# Anisotropy reduces distortion in textures at low angles (0 to 16). +# Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16). anisotropy = 4 -# Camera field of view in degrees (30.0 to 110.0). +# Camera field of view in degrees (e.g. 30.0 to 110.0). field of view = 55.0 # File format for screenshots. (jpg, png, tga, and possibly more). @@ -123,11 +122,11 @@ always run = false # Zoom in and out from player in third person view with mouse wheel. allow third person zoom = false -# Camera sensitivity when not in GUI mode. (0.1 to 5.0). +# Camera sensitivity when not in GUI mode. (>0.0, e.g. 0.1 to 5.0). camera sensitivity = 1.0 # Vertical camera sensitivity multiplier when not in GUI mode. -# Because it's a multiplier values should be near one (0.5 to 1.5). +# (>0.0, Because it's a multiplier values should be near 1.0) camera y multiplier = 1.0 # Invert the vertical axis while not in GUI mode. @@ -168,7 +167,7 @@ voice volume = 0.8 [Video] -# Resolution of the Open window or screen. +# Resolution of the OpenMW window or screen. resolution x = 800 resolution y = 600 @@ -190,13 +189,13 @@ antialiasing = 0 # Enable vertical syncing to reduce tearing defects. vsync = false -# Maximum frames per second. (1.0 to 200.0). +# Maximum frames per second. 0.0 is unlimited, or >0.0 to limit. framerate limit = 0.0 # Game video contrast. (>0.0). No effect in Linux. contrast = 1.0 -# Video gamma setting. (>0.0). No effect in Linux. +# Video gamma setting. (>0.0). No effect in Linux. gamma = 1.0 [Water] @@ -228,7 +227,7 @@ distant land = false # Enable shadows. Other shadow settings disabled if false. Unused. enabled = false -# Size of the shadow textures in pixels. Unused. (256 to 2048). +# Size of the shadow textures in pixels. Unused. (e.g. 256 to 2048). texture size = 1024 # Actors cast shadows. Unused.