Legacy Shaders option

This commit is contained in:
Lubos Lenco 2018-02-16 18:09:03 +01:00
parent f65bbb97de
commit 6403977ec6
3 changed files with 15 additions and 6 deletions

View file

@ -6,7 +6,7 @@ bl_info = {
"location": "Properties -> Render -> Armory Player",
"description": "3D game engine for Blender",
"author": "Armory3D.org",
"version": (11, 5, 0),
"version": (11, 6, 0),
"blender": (2, 79, 0),
"wiki_url": "http://armory3d.org/manual",
"tracker_url": "https://github.com/armory3d/armory/issues"
@ -52,6 +52,7 @@ class ArmoryAddonPreferences(AddonPreferences):
renderdoc_path = StringProperty(name="RenderDoc Path", subtype="FILE_PATH", update=renderdoc_path_update, default="")
ffmpeg_path = StringProperty(name="FFMPEG Path", subtype="FILE_PATH", update=ffmpeg_path_update, default="")
save_on_build = BoolProperty(name="Save on Build", default=True)
legacy_shaders = BoolProperty(name="Legacy Shaders", default=False)
viewport_controls = EnumProperty(
items=[('qwerty', 'qwerty', 'qwerty'),
('azerty', 'azerty', 'azerty')],
@ -75,6 +76,7 @@ class ArmoryAddonPreferences(AddonPreferences):
layout.prop(self, "ffmpeg_path")
layout.prop(self, "viewport_controls")
layout.prop(self, "save_on_build")
layout.prop(self, "legacy_shaders")
layout.separator()
layout.label("Armory Updater")

View file

@ -240,15 +240,17 @@ def compile_project(target_name=None, watch=False, patch=False, no_project_file=
cmd.append('-g')
cmd.append(arm.utils.get_gapi())
# Kha defaults to 110 on Linux
is_linux = arm.utils.get_os() == 'linux'
is_native = kha_target_name == 'krom' or kha_target_name == ''
if is_linux and is_native and not state.in_viewport and not arm.utils.get_legacy_shaders():
cmd.append('--shaderversion')
cmd.append('330')
if '_VR' in wrd.world_defs:
cmd.append('--vr')
cmd.append('webvr')
# Kha defaults to 110
if arm.utils.get_os() == 'linux' and (kha_target_name == 'krom' or kha_target_name == '') and state.in_viewport == False:
cmd.append('--shaderversion')
cmd.append('330')
cmd.append('--to')
if (kha_target_name == 'krom' and not state.in_viewport) or (kha_target_name == 'html5' and not state.is_publish):
cmd.append(arm.utils.build_dir() + '/debug')

View file

@ -119,6 +119,11 @@ def get_viewport_controls():
addon_prefs = user_preferences.addons['armory'].preferences
return 'qwerty' if not hasattr(addon_prefs, 'viewport_controls') else addon_prefs.viewport_controls
def get_legacy_shaders():
user_preferences = bpy.context.user_preferences
addon_prefs = user_preferences.addons['armory'].preferences
return False if not hasattr(addon_prefs, 'legacy_shaders') else addon_prefs.legacy_shaders
def get_node_path():
if get_os() == 'win':
return get_sdk_path() + '/nodejs/node.exe'