diff options
-rw-r--r-- | SConstruct | 4 | ||||
-rw-r--r-- | core/globals.cpp | 1 | ||||
-rw-r--r-- | core/image.cpp | 55 | ||||
-rw-r--r-- | core/image.h | 2 | ||||
-rw-r--r-- | core/io/resource_import.cpp | 25 | ||||
-rw-r--r-- | core/io/resource_import.h | 1 | ||||
-rw-r--r-- | core/os/os.h | 2 | ||||
-rw-r--r-- | core/translation.cpp | 1 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_gles3.cpp | 1 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 84 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.h | 6 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 88 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.h | 21 | ||||
-rw-r--r-- | drivers/gles3/shader_compiler_gles3.cpp | 1 | ||||
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 131 | ||||
-rw-r--r-- | drivers/unix/os_unix.cpp | 8 | ||||
-rw-r--r-- | drivers/unix/os_unix.h | 2 | ||||
-rw-r--r-- | main/main.cpp | 6 | ||||
-rw-r--r-- | misc/dist/docker/Dockerfile (renamed from tools/dist/docker/Dockerfile) | 0 | ||||
-rw-r--r-- | misc/dist/docker/README.md (renamed from tools/dist/docker/README.md) | 0 | ||||
-rw-r--r-- | misc/dist/docker/scripts/install-android-tools (renamed from tools/dist/docker/scripts/install-android-tools) | 0 | ||||
-rw-r--r-- | misc/dist/html_fs/godotfs.js (renamed from tools/dist/html_fs/godotfs.js) | 0 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/data.pck (renamed from tools/dist/ios_xcode/godot_xcode/data.pck) | 0 | ||||
-rwxr-xr-x | misc/dist/ios_xcode/godot_xcode/godot_debug.iphone (renamed from tools/dist/ios_xcode/godot_xcode/godot_debug.iphone) | 0 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.pbxproj (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.pbxproj) | 0 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata) | 0 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-568h@2x~iphone.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-568h@2x~iphone.png) | bin | 564 -> 564 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-667h.png) | bin | 683 -> 683 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h@2x.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-667h@2x.png) | bin | 817 -> 817 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-736h.png) | bin | 1676 -> 1676 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h@3x.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-736h@3x.png) | bin | 2582 -> 2582 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape-736h.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape-736h.png) | bin | 2582 -> 2582 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape@2x~ipad.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape@2x~ipad.png) | bin | 3131 -> 3131 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape~ipad.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape~ipad.png) | bin | 634 -> 634 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait@2x~ipad.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait@2x~ipad.png) | bin | 3070 -> 3070 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait~ipad.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait~ipad.png) | bin | 589 -> 589 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default@2x~iphone.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default@2x~iphone.png) | bin | 515 -> 515 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Default~iphone.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Default~iphone.png) | bin | 309 -> 309 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json) | 0 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png) | bin | 250 -> 250 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png) | bin | 253 -> 253 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png) | bin | 253 -> 253 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png) | bin | 259 -> 259 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png) | bin | 260 -> 260 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png) | bin | 265 -> 265 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png) | bin | 242 -> 242 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png) | bin | 240 -> 240 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png) | bin | 243 -> 243 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png) | bin | 243 -> 243 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png) | bin | 243 -> 243 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png) | bin | 244 -> 244 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png) | bin | 244 -> 244 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png) | bin | 246 -> 246 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png) | bin | 245 -> 245 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png) | bin | 262 -> 262 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png) | bin | 247 -> 247 bytes | |||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes) | 0 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/en.lproj/InfoPlist.strings (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/en.lproj/InfoPlist.strings) | 0 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/godot_ios-Info.plist (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/godot_ios-Info.plist) | 0 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_xcode/godot_ios/main.m (renamed from tools/dist/ios_xcode/godot_xcode/godot_ios/main.m) | 0 | ||||
-rwxr-xr-x | misc/dist/ios_xcode/godot_xcode/godot_opt.iphone (renamed from tools/dist/ios_xcode/godot_xcode/godot_opt.iphone) | 0 | ||||
-rwxr-xr-x | misc/dist/osx_template.app/Contents/Info.plist (renamed from tools/dist/osx_template.app/Contents/Info.plist) | 0 | ||||
-rw-r--r-- | misc/dist/osx_template.app/Contents/PkgInfo (renamed from tools/dist/osx_template.app/Contents/PkgInfo) | 0 | ||||
-rw-r--r-- | misc/dist/osx_template.app/Contents/Resources/icon.icns (renamed from tools/dist/osx_template.app/Contents/Resources/icon.icns) | bin | 120942 -> 120942 bytes | |||
-rwxr-xr-x | misc/dist/osx_tools.app/Contents/Info.plist (renamed from tools/dist/osx_tools.app/Contents/Info.plist) | 0 | ||||
-rw-r--r-- | misc/dist/osx_tools.app/Contents/PkgInfo (renamed from tools/dist/osx_tools.app/Contents/PkgInfo) | 0 | ||||
-rw-r--r-- | misc/dist/osx_tools.app/Contents/Resources/Godot.icns (renamed from tools/dist/osx_tools.app/Contents/Resources/Godot.icns) | bin | 120942 -> 120942 bytes | |||
-rw-r--r-- | misc/dist/uwp_template/AppxManifest.xml (renamed from tools/dist/uwp_template/AppxManifest.xml) | 0 | ||||
-rw-r--r-- | misc/dist/uwp_template/Assets/SplashScreen.scale-100.png (renamed from tools/dist/uwp_template/Assets/SplashScreen.scale-100.png) | bin | 14919 -> 14919 bytes | |||
-rw-r--r-- | misc/dist/uwp_template/Assets/Square150x150Logo.scale-100.png (renamed from tools/dist/uwp_template/Assets/Square150x150Logo.scale-100.png) | bin | 7001 -> 7001 bytes | |||
-rw-r--r-- | misc/dist/uwp_template/Assets/Square310x310Logo.scale-100.png (renamed from tools/dist/uwp_template/Assets/Square310x310Logo.scale-100.png) | bin | 14490 -> 14490 bytes | |||
-rw-r--r-- | misc/dist/uwp_template/Assets/Square44x44Logo.scale-100.png (renamed from tools/dist/uwp_template/Assets/Square44x44Logo.scale-100.png) | bin | 2067 -> 2067 bytes | |||
-rw-r--r-- | misc/dist/uwp_template/Assets/Square71x71Logo.scale-100.png (renamed from tools/dist/uwp_template/Assets/Square71x71Logo.scale-100.png) | bin | 3369 -> 3369 bytes | |||
-rw-r--r-- | misc/dist/uwp_template/Assets/StoreLogo.scale-100.png (renamed from tools/dist/uwp_template/Assets/StoreLogo.scale-100.png) | bin | 2339 -> 2339 bytes | |||
-rw-r--r-- | misc/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png (renamed from tools/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png) | bin | 7390 -> 7390 bytes | |||
-rw-r--r-- | misc/scripts/addheader.py (renamed from tools/scripts/addheader.py) | 0 | ||||
-rwxr-xr-x | misc/scripts/file-hex-array.py (renamed from tools/scripts/file-hex-array.py) | 0 | ||||
-rw-r--r-- | misc/scripts/make_bmfhdr.py (renamed from tools/scripts/make_bmfhdr.py) | 0 | ||||
-rw-r--r-- | misc/scripts/make_glwrapper.py (renamed from tools/scripts/make_glwrapper.py) | 0 | ||||
-rw-r--r-- | misc/scripts/make_icons.sh (renamed from tools/scripts/make_icons.sh) | 0 | ||||
-rw-r--r-- | misc/scripts/makeargs.py (renamed from tools/scripts/makeargs.py) | 0 | ||||
-rw-r--r-- | misc/scripts/memsort.py (renamed from tools/scripts/memsort.py) | 0 | ||||
-rw-r--r-- | misc/scripts/sort-demos.sh (renamed from tools/scripts/sort-demos.sh) | 0 | ||||
-rw-r--r-- | misc/scripts/svgs_2_pngs.py (renamed from tools/scripts/svgs_2_pngs.py) | 0 | ||||
-rw-r--r-- | modules/etc1/image_etc.cpp | 19 | ||||
-rw-r--r-- | modules/gdscript/gd_parser.cpp | 7 | ||||
-rw-r--r-- | modules/squish/image_compress_squish.cpp | 5 | ||||
-rw-r--r-- | scene/2d/screen_button.cpp | 209 | ||||
-rw-r--r-- | scene/2d/screen_button.h | 15 | ||||
-rw-r--r-- | scene/3d/gi_probe.cpp | 52 | ||||
-rw-r--r-- | scene/3d/gi_probe.h | 11 | ||||
-rw-r--r-- | scene/3d/light.cpp | 3 | ||||
-rw-r--r-- | scene/3d/light.h | 1 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 39 | ||||
-rw-r--r-- | scene/resources/texture.cpp | 44 | ||||
-rw-r--r-- | scene/resources/texture.h | 10 | ||||
-rw-r--r-- | servers/physics/joints/generic_6dof_joint_sw.cpp | 2 | ||||
-rw-r--r-- | servers/visual/rasterizer.h | 6 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 6 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 8 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.cpp | 41 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.h | 3 | ||||
-rw-r--r-- | servers/visual_server.h | 11 | ||||
-rw-r--r-- | thirdparty/README.md | 14 | ||||
-rw-r--r-- | thirdparty/certs/ca-certificates.crt (renamed from tools/certs/ca-certificates.crt) | 0 | ||||
-rw-r--r-- | thirdparty/fonts/DroidSans.ttf (renamed from tools/editor_fonts/DroidSans.ttf) | bin | 190044 -> 190044 bytes | |||
-rw-r--r-- | thirdparty/fonts/DroidSansArabic.ttf (renamed from tools/editor_fonts/DroidSansArabic.ttf) | bin | 35908 -> 35908 bytes | |||
-rw-r--r-- | thirdparty/fonts/DroidSansFallback.ttf (renamed from tools/editor_fonts/DroidSansFallback.ttf) | bin | 3640264 -> 3640264 bytes | |||
-rw-r--r-- | thirdparty/fonts/DroidSansHebrew.ttf (renamed from tools/editor_fonts/DroidSansHebrew.ttf) | bin | 23076 -> 23076 bytes | |||
-rw-r--r-- | thirdparty/fonts/DroidSansJapanese.ttf (renamed from tools/editor_fonts/DroidSansJapanese.ttf) | bin | 1173140 -> 1173140 bytes | |||
-rw-r--r-- | thirdparty/fonts/DroidSansThai.ttf (renamed from tools/editor_fonts/DroidSansThai.ttf) | bin | 36028 -> 36028 bytes | |||
-rw-r--r-- | thirdparty/fonts/LICENSE.DroidSans.txt (renamed from tools/editor_fonts/LICENSE.DroidSans.txt) | 0 | ||||
-rw-r--r-- | thirdparty/fonts/LICENSE.SourceCodePro.txt (renamed from tools/editor_fonts/LICENSE.SourceCodePro.txt) | 0 | ||||
-rw-r--r-- | thirdparty/fonts/source_code_pro.otf (renamed from tools/editor_fonts/source_code_pro.otf) | bin | 140088 -> 140088 bytes | |||
-rw-r--r-- | tools/SCsub | 121 | ||||
-rw-r--r-- | tools/editor/SCsub | 147 | ||||
-rw-r--r-- | tools/editor/collada/SCsub (renamed from tools/doc/SCsub) | 2 | ||||
-rw-r--r-- | tools/editor/collada/collada.cpp (renamed from tools/collada/collada.cpp) | 0 | ||||
-rw-r--r-- | tools/editor/collada/collada.h (renamed from tools/collada/collada.h) | 0 | ||||
-rw-r--r-- | tools/editor/doc/SCsub (renamed from tools/collada/SCsub) | 2 | ||||
-rw-r--r-- | tools/editor/doc/doc_data.cpp (renamed from tools/doc/doc_data.cpp) | 0 | ||||
-rw-r--r-- | tools/editor/doc/doc_data.h (renamed from tools/doc/doc_data.h) | 0 | ||||
-rw-r--r-- | tools/editor/doc/doc_dump.cpp (renamed from tools/doc/doc_dump.cpp) | 0 | ||||
-rw-r--r-- | tools/editor/doc/doc_dump.h (renamed from tools/doc/doc_dump.h) | 0 | ||||
-rw-r--r-- | tools/editor/editor_file_system.cpp | 31 | ||||
-rw-r--r-- | tools/editor/editor_file_system.h | 2 | ||||
-rw-r--r-- | tools/editor/editor_help.h | 2 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 4 | ||||
-rw-r--r-- | tools/editor/fileserver/SCsub | 2 | ||||
-rw-r--r-- | tools/editor/icons/SCsub | 2 | ||||
-rw-r--r-- | tools/editor/import/SCsub | 2 | ||||
-rw-r--r-- | tools/editor/import/editor_import_collada.cpp | 18 | ||||
-rw-r--r-- | tools/editor/import/resource_importer_texture.cpp | 139 | ||||
-rw-r--r-- | tools/editor/import/resource_importer_texture.h | 29 | ||||
-rw-r--r-- | tools/editor/io_plugins/SCsub | 2 | ||||
-rw-r--r-- | tools/editor/plugins/SCsub | 2 | ||||
-rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 43 | ||||
-rw-r--r-- | tools/editor/plugins/script_editor_plugin.h | 11 | ||||
-rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.cpp | 90 | ||||
-rw-r--r-- | tools/editor/spatial_editor_gizmos.cpp | 4 | ||||
-rw-r--r-- | tools/editor/translations/Makefile (renamed from tools/translations/Makefile) | 0 | ||||
-rw-r--r-- | tools/editor/translations/README.md (renamed from tools/translations/README.md) | 0 | ||||
-rw-r--r-- | tools/editor/translations/ar.po (renamed from tools/translations/ar.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/bg.po (renamed from tools/translations/bg.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/bn.po (renamed from tools/translations/bn.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/ca.po (renamed from tools/translations/ca.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/cs.po (renamed from tools/translations/cs.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/da.po (renamed from tools/translations/da.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/de.po (renamed from tools/translations/de.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/de_CH.po (renamed from tools/translations/de_CH.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/es.po (renamed from tools/translations/es.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/es_AR.po (renamed from tools/translations/es_AR.po) | 0 | ||||
-rwxr-xr-x | tools/editor/translations/extract.py (renamed from tools/translations/extract.py) | 0 | ||||
-rw-r--r-- | tools/editor/translations/fa.po (renamed from tools/translations/fa.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/fr.po (renamed from tools/translations/fr.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/hu.po (renamed from tools/translations/hu.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/id.po (renamed from tools/translations/id.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/it.po (renamed from tools/translations/it.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/ja.po (renamed from tools/translations/ja.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/ko.po (renamed from tools/translations/ko.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/nb.po (renamed from tools/translations/nb.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/pl.po (renamed from tools/translations/pl.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/pr.po (renamed from tools/translations/pr.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/pt_BR.po (renamed from tools/translations/pt_BR.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/pt_PT.po (renamed from tools/translations/pt_PT.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/ru.po (renamed from tools/translations/ru.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/sk.po (renamed from tools/translations/sk.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/sl.po (renamed from tools/translations/sl.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/tools.pot (renamed from tools/translations/tools.pot) | 0 | ||||
-rw-r--r-- | tools/editor/translations/tr.po (renamed from tools/translations/tr.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/ur_PK.po (renamed from tools/translations/ur_PK.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/zh_CN.po (renamed from tools/translations/zh_CN.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/zh_HK.po (renamed from tools/translations/zh_HK.po) | 0 | ||||
-rw-r--r-- | tools/editor/translations/zh_TW.po (renamed from tools/translations/zh_TW.po) | 0 |
174 files changed, 1123 insertions, 477 deletions
diff --git a/SConstruct b/SConstruct index 2ecfea92e3..4c79304ef2 100644 --- a/SConstruct +++ b/SConstruct @@ -358,7 +358,7 @@ if selected_platform in platform_list: SConscript("core/SCsub") SConscript("servers/SCsub") SConscript("scene/SCsub") - SConscript("tools/SCsub") + SConscript("tools/editor/SCsub") SConscript("drivers/SCsub") SConscript("modules/SCsub") @@ -374,7 +374,7 @@ if selected_platform in platform_list: AddToVSProject(env.modules_sources) AddToVSProject(env.scene_sources) AddToVSProject(env.servers_sources) - AddToVSProject(env.tool_sources) + AddToVSProject(env.editor_sources) # this env flag won't work, it needs to be set in env_base=Environment(MSVC_VERSION='9.0') # Even then, SCons still seems to ignore it and builds with the latest MSVC... diff --git a/core/globals.cpp b/core/globals.cpp index e748f561f1..ed0b6f6d8b 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -125,6 +125,7 @@ bool GlobalConfig::_set(const StringName& p_name, const Variant& p_value) { _THREAD_SAFE_METHOD_ + if (p_value.get_type()==Variant::NIL) props.erase(p_name); else { diff --git a/core/image.cpp b/core/image.cpp index 2d038691f2..037ff82452 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -245,7 +245,7 @@ void Image::_get_mipmap_offset_and_size(int p_mipmap,int &r_offset, int &r_width } int Image::get_mipmap_offset(int p_mipmap) const { - ERR_FAIL_INDEX_V(p_mipmap,(mipmaps+1),-1); + ERR_FAIL_INDEX_V(p_mipmap,get_mipmap_count()+1,-1); int ofs,w,h; _get_mipmap_offset_and_size(p_mipmap,ofs,w,h); @@ -1011,7 +1011,7 @@ void Image::shrink_x2() { } } -Error Image::generate_mipmaps(bool p_keep_existing) { +Error Image::generate_mipmaps() { if (!_can_modify(format)) { ERR_EXPLAIN("Cannot generate mipmaps in indexed, compressed or custom image formats."); @@ -1019,15 +1019,14 @@ Error Image::generate_mipmaps(bool p_keep_existing) { } - int mmcount = get_mipmap_count(); + ERR_FAIL_COND_V(width==0 || height==0,ERR_UNCONFIGURED); + + int mmcount; - int from_mm=1; - if (p_keep_existing) { - from_mm=mmcount+1; - } int size = _get_dst_image_size(width,height,format,mmcount); data.resize(size); + print_line("to gen mipmaps w "+itos(width)+" h "+itos(height) +" format "+get_format_name(format)+" mipmaps " +itos(mmcount)+" new size is: "+itos(size)); PoolVector<uint8_t>::Write wp=data.write(); @@ -1043,18 +1042,16 @@ Error Image::generate_mipmaps(bool p_keep_existing) { int ofs,w,h; _get_mipmap_offset_and_size(i,ofs, w,h); - if (i>=from_mm) { - switch(format) { + switch(format) { - case FORMAT_L8: - case FORMAT_R8: _generate_po2_mipmap<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - case FORMAT_LA8: - case FORMAT_RG8: _generate_po2_mipmap<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - case FORMAT_RGB8: _generate_po2_mipmap<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - case FORMAT_RGBA8: _generate_po2_mipmap<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - default: {} - } + case FORMAT_L8: + case FORMAT_R8: _generate_po2_mipmap<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_LA8: + case FORMAT_RG8: _generate_po2_mipmap<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_RGB8: _generate_po2_mipmap<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_RGBA8: _generate_po2_mipmap<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + default: {} } prev_ofs=ofs; @@ -1077,18 +1074,15 @@ Error Image::generate_mipmaps(bool p_keep_existing) { int ofs,w,h; _get_mipmap_offset_and_size(i,ofs, w,h); - if (i>=from_mm) { - - switch(format) { + switch(format) { - case FORMAT_L8: - case FORMAT_R8: _scale_bilinear<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - case FORMAT_LA8: - case FORMAT_RG8: _scale_bilinear<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - case FORMAT_RGB8:_scale_bilinear<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - case FORMAT_RGBA8: _scale_bilinear<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - default: {} - } + case FORMAT_L8: + case FORMAT_R8: _scale_bilinear<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_LA8: + case FORMAT_RG8: _scale_bilinear<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_RGB8:_scale_bilinear<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_RGBA8: _scale_bilinear<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + default: {} } prev_ofs=ofs; @@ -1096,8 +1090,11 @@ Error Image::generate_mipmaps(bool p_keep_existing) { prev_h=h; } + + } + mipmaps=true; return OK; } @@ -1154,7 +1151,7 @@ void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_forma ERR_FAIL_INDEX(p_height-1,MAX_HEIGHT); int mm; - int size = _get_dst_image_size(p_width,p_height,p_format,mm,p_use_mipmaps); + int size = _get_dst_image_size(p_width,p_height,p_format,mm,p_use_mipmaps?-1:0); if (size!=p_data.size()) { ERR_EXPLAIN("Expected data size of "+itos(size)+" in Image::create()"); diff --git a/core/image.h b/core/image.h index 620160147b..1a257f28a0 100644 --- a/core/image.h +++ b/core/image.h @@ -196,7 +196,7 @@ public: /** * Generate a mipmap to an image (creates an image 1/4 the size, with averaging of 4->1) */ - Error generate_mipmaps(bool p_keep_existing=false); + Error generate_mipmaps(); void clear_mipmaps(); diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp index d0799cdbe6..556dff3125 100644 --- a/core/io/resource_import.cpp +++ b/core/io/resource_import.cpp @@ -1,5 +1,6 @@ #include "resource_import.h" #include "variant_parser.h" +#include "os/os.h" Error ResourceFormatImporter::_get_path_and_type(const String& p_path, PathAndType &r_path_and_type) const { @@ -36,7 +37,13 @@ Error ResourceFormatImporter::_get_path_and_type(const String& p_path, PathAndTy } if (assign!=String()) { - if (assign=="path") { + if (assign.begins_with("path.") && r_path_and_type.path==String()) { + String feature = assign.get_slicec('.',1); + if (OS::get_singleton()->check_feature_support(feature)) { + r_path_and_type.path=value; + } + + } else if (assign=="path") { r_path_and_type.path=value; } else if (assign=="type") { r_path_and_type.type=value; @@ -84,7 +91,6 @@ RES ResourceFormatImporter::load(const String &p_path,const String& p_original_p void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extensions) const{ - print_line("getting exts from: "+itos(importers.size())); Set<String> found; for (Set< Ref<ResourceImporter> >::Element *E=importers.front();E;E=E->next()) { @@ -92,7 +98,6 @@ void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extension E->get()->get_recognized_extensions(&local_exts); for (List<String>::Element *F=local_exts.front();F;F=F->next()) { if (!found.has(F->get())) { - print_line("adding ext "+String(F->get())); p_extensions->push_back(F->get()); found.insert(F->get()); } @@ -154,6 +159,20 @@ bool ResourceFormatImporter::handles_type(const String& p_type) const { return true; } + +String ResourceFormatImporter::get_internal_resource_path(const String& p_path) const { + + PathAndType pat; + Error err = _get_path_and_type(p_path,pat); + + if (err!=OK) { + + return String(); + } + + return pat.path; +} + String ResourceFormatImporter::get_resource_type(const String &p_path) const { PathAndType pat; diff --git a/core/io/resource_import.h b/core/io/resource_import.h index 939cecfbd9..387b3902fe 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -31,6 +31,7 @@ public: virtual bool can_be_imported(const String& p_path) const; + String get_internal_resource_path(const String& p_path) const; void add_importer(const Ref<ResourceImporter>& p_importer) { importers.insert(p_importer); } Ref<ResourceImporter> get_importer_by_name(const String& p_name); diff --git a/core/os/os.h b/core/os/os.h index 42c7c18b0c..e179b82dae 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -403,6 +403,8 @@ public: virtual void set_use_vsync(bool p_enable); virtual bool is_vsync_enabled() const; + virtual bool check_feature_support(const String& p_feature)=0; + bool is_hidpi_allowed() const { return _allow_hidpi; } OS(); virtual ~OS(); diff --git a/core/translation.cpp b/core/translation.cpp index 8835cb133c..2fee0e6550 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -670,6 +670,7 @@ static const char* locale_names[]={ "Sanskrit (India)", "Santali (India)", "Sardinian (Italy)", +"Scots (Scotland)", "Sindhi (India)", "Northern Sami (Norway)", "Samogitian (Lithuania)", diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index 5c6b9c5410..e1ddad0dc9 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -167,6 +167,7 @@ void RasterizerGLES3::initialize() { void RasterizerGLES3::begin_frame(){ + uint64_t tick = OS::get_singleton()->get_ticks_usec(); double time_total = double(tick)/1000000.0; diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index c0af9b3bcf..b504ef819f 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -148,6 +148,9 @@ void RasterizerSceneGLES3::shadow_atlas_set_size(RID p_atlas,int p_size){ glClearDepth(0.0f); glClear(GL_DEPTH_BUFFER_BIT); + glBindFramebuffer(GL_FRAMEBUFFER,0); + + } } @@ -557,6 +560,8 @@ void RasterizerSceneGLES3::reflection_atlas_set_size(RID p_ref_atlas,int p_size) } + + void RasterizerSceneGLES3::reflection_atlas_set_subdivision(RID p_ref_atlas,int p_subdiv) { ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(p_ref_atlas); @@ -1081,6 +1086,18 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material* p_m state.current_line_width=p_material->line_width; } + if (state.current_depth_test!=(!p_material->shader->spatial.ontop)) { + if (p_material->shader->spatial.ontop) { + glDisable(GL_DEPTH_TEST); + + } else { + glEnable(GL_DEPTH_TEST); + + } + + state.current_depth_test=!p_material->shader->spatial.ontop; + } + if (state.current_depth_draw!=p_material->shader->spatial.depth_draw_mode) { switch(p_material->shader->spatial.depth_draw_mode) { case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS: @@ -1204,6 +1221,11 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material* p_m } else { +#ifdef TOOLS_ENABLED + if (t->detect_3d) { + t->detect_3d(t->detect_3d_ud); + } +#endif if (storage->config.srgb_decode_supported) { //if SRGB decode extension is present, simply switch the texture to whathever is needed bool must_srgb=false; @@ -1216,9 +1238,8 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material* p_m if (must_srgb) { glTexParameteri(t->target,_TEXTURE_SRGB_DECODE_EXT,_DECODE_EXT); #ifdef TOOLS_ENABLED - if (!(t->flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { - t->flags|=VS::TEXTURE_FLAG_CONVERT_TO_LINEAR; - //notify that texture must be set to linear beforehand, so it works in other platforms when exported + if (t->detect_srgb) { + t->detect_srgb(t->detect_srgb_ud); } #endif @@ -1714,6 +1735,9 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements,int p_e state.cull_front=false; glCullFace(GL_BACK); + state.current_depth_test=true; + glEnable(GL_DEPTH_TEST); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON,false); state.current_blend_mode=-1; @@ -2297,10 +2321,10 @@ void RasterizerSceneGLES3::_setup_directional_light(int p_index,const Transform& ubo_data.light_params[3]=0; Color shadow_color = li->light_ptr->shadow_color.to_linear(); - ubo_data.light_shadow_color[0]=shadow_color.r; - ubo_data.light_shadow_color[1]=shadow_color.g; - ubo_data.light_shadow_color[2]=shadow_color.b; - ubo_data.light_shadow_color[3]=1.0; + ubo_data.light_shadow_color_contact[0]=shadow_color.r; + ubo_data.light_shadow_color_contact[1]=shadow_color.g; + ubo_data.light_shadow_color_contact[2]=shadow_color.b; + ubo_data.light_shadow_color_contact[3]=li->light_ptr->param[VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE]; if (p_use_shadows && li->light_ptr->shadow) { @@ -2456,10 +2480,10 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result,int p_light_cu ubo_data.light_params[3]=0; Color shadow_color = li->light_ptr->shadow_color.to_linear(); - ubo_data.light_shadow_color[0]=shadow_color.r; - ubo_data.light_shadow_color[1]=shadow_color.g; - ubo_data.light_shadow_color[2]=shadow_color.b; - ubo_data.light_shadow_color[3]=1.0; + ubo_data.light_shadow_color_contact[0]=shadow_color.r; + ubo_data.light_shadow_color_contact[1]=shadow_color.g; + ubo_data.light_shadow_color_contact[2]=shadow_color.b; + ubo_data.light_shadow_color_contact[3]=li->light_ptr->param[VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE]; if (li->light_ptr->shadow && shadow_atlas && shadow_atlas->shadow_owners.has(li->self)) { // fill in the shadow information @@ -2549,10 +2573,10 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result,int p_light_cu ubo_data.light_params[3]=0; Color shadow_color = li->light_ptr->shadow_color.to_linear(); - ubo_data.light_shadow_color[0]=shadow_color.r; - ubo_data.light_shadow_color[1]=shadow_color.g; - ubo_data.light_shadow_color[2]=shadow_color.b; - ubo_data.light_shadow_color[3]=1.0; + ubo_data.light_shadow_color_contact[0]=shadow_color.r; + ubo_data.light_shadow_color_contact[1]=shadow_color.g; + ubo_data.light_shadow_color_contact[2]=shadow_color.b; + ubo_data.light_shadow_color_contact[3]=li->light_ptr->param[VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE]; if (li->light_ptr->shadow && shadow_atlas && shadow_atlas->shadow_owners.has(li->self)) { // fill in the shadow information @@ -3736,14 +3760,20 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C state.ubo_data.shadow_dual_paraboloid_render_side=0; state.ubo_data.shadow_dual_paraboloid_render_zfar=0; + if (storage->frame.current_rt) { + state.ubo_data.screen_pixel_size[0]=1.0/storage->frame.current_rt->width; + state.ubo_data.screen_pixel_size[1]=1.0/storage->frame.current_rt->height; + } + _setup_environment(env,p_cam_projection,p_cam_transform); bool fb_cleared=false; glDepthFunc(GL_LEQUAL); + state.used_contact_shadows=true; - if (storage->frame.current_rt && true) { + if (storage->frame.current_rt && true) { //detect with state.used_contact_shadows too //pre z pass @@ -3770,6 +3800,19 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C glColorMask(1,1,1,1); + if (state.used_contact_shadows) { + + glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); + glReadBuffer(GL_COLOR_ATTACHMENT0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->fbo); + glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_DEPTH_BUFFER_BIT, GL_NEAREST); + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + //bind depth for read + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-8); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->depth); + } + fb_cleared=true; render_pass++; } @@ -4403,18 +4446,18 @@ void RasterizerSceneGLES3::render_shadow(RID p_light,RID p_shadow_atlas,int p_pa render_list.sort_by_depth(false); //shadow is front to back for performance - glDepthMask(true); - glColorMask(1,1,1,1); glDisable(GL_BLEND); glDisable(GL_DITHER); glEnable(GL_DEPTH_TEST); glBindFramebuffer(GL_FRAMEBUFFER,fbo); + glDepthMask(true); + glColorMask(0,0,0,0); + if (custom_vp_size) { glViewport(0,0,custom_vp_size,custom_vp_size); glScissor(0,0,custom_vp_size,custom_vp_size); - } else { glViewport(x,y,width,height); glScissor(x,y,width,height); @@ -4434,7 +4477,7 @@ void RasterizerSceneGLES3::render_shadow(RID p_light,RID p_shadow_atlas,int p_pa state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH,true); - _render_list(render_list.elements,render_list.element_count,light_transform,light_projection,0,!flip_facing,false,true,false,false); + _render_list(render_list.elements,render_list.element_count,light_transform,light_projection,0,flip_facing,false,true,false,false); state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH,false); state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH_DUAL_PARABOLOID,false); @@ -5009,5 +5052,4 @@ void RasterizerSceneGLES3::finalize(){ RasterizerSceneGLES3::RasterizerSceneGLES3() { - } diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 7838345e59..81dfa1bf46 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -61,6 +61,7 @@ public: int current_blend_mode; float current_line_width; int current_depth_draw; + bool current_depth_test; GLuint current_main_tex; SceneShaderGLES3 scene_shader; @@ -90,6 +91,7 @@ public: float shadow_slope_scale; float shadow_dual_paraboloid_render_zfar; float shadow_dual_paraboloid_render_side; + float screen_pixel_size[2]; float shadow_atlas_pixel_size[2]; float shadow_directional_pixel_size[2]; float reflection_multiplier; @@ -135,6 +137,7 @@ public: int max_ubo_reflections; int max_skeleton_bones; + bool used_contact_shadows; int spot_light_count; @@ -209,7 +212,6 @@ public: bool _shadow_atlas_find_shadow(ShadowAtlas *shadow_atlas, int *p_in_quadrants, int p_quadrant_count, int p_current_subdiv, uint64_t p_tick, int &r_quadrant, int &r_shadow); bool shadow_atlas_update_light(RID p_atlas,RID p_light_intance,float p_coverage,uint64_t p_light_version); - struct DirectionalShadow { GLuint fbo; GLuint depth; @@ -467,7 +469,7 @@ public: float light_color_energy[4]; float light_params[4]; //spot attenuation, spot angle, specular, shadow enabled float light_clamp[4]; - float light_shadow_color[4]; + float light_shadow_color_contact[4]; float shadow_matrix1[16]; //up to here for spot and omni, rest is for directional float shadow_matrix2[16]; float shadow_matrix3[16]; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index a96fd8dd41..06daebbf82 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -218,7 +218,7 @@ Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image& p_image, Ima if (config.s3tc_supported) { - r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV:_EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT; + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_S3TC_DXT1_NV:_EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT; r_gl_format=GL_RGBA; r_gl_type=GL_UNSIGNED_BYTE; r_compressed=true; @@ -785,7 +785,7 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture,const Image& p_image if (texture->compressed) { glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glCompressedTexImage2D( blit_target, i, format,w,h,0,size,&read[ofs] ); + glCompressedTexImage2D( blit_target, i, internal_format,w,h,0,size,&read[ofs] ); } else { glPixelStorei(GL_UNPACK_ALIGNMENT, 1); @@ -814,6 +814,10 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture,const Image& p_image if (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && mipmaps==1 && !texture->ignore_mipmaps && (!(texture->flags&VS::TEXTURE_FLAG_CUBEMAP) || texture->stored_cube_sides==(1<<6)-1)) { //generate mipmaps if they were requested and the image does not contain them glGenerateMipmap(texture->target); + } else if (mipmaps>1) { + glTexParameteri(texture->target, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, mipmaps-1); + } texture->mipmaps=mipmaps; @@ -1066,6 +1070,26 @@ void RasterizerStorageGLES3::textures_keep_original(bool p_enable) { config.keep_original_textures=p_enable; } +void RasterizerStorageGLES3::texture_set_detect_3d_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata) { + + Texture * texture = texture_owner.get(p_texture); + ERR_FAIL_COND(!texture); + + texture->detect_3d=p_callback; + texture->detect_3d_ud=p_userdata; +} + +void RasterizerStorageGLES3::texture_set_detect_srgb_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata){ + Texture * texture = texture_owner.get(p_texture); + ERR_FAIL_COND(!texture); + + texture->detect_srgb=p_callback; + texture->detect_srgb_ud=p_userdata; + +} + + + RID RasterizerStorageGLES3::texture_create_radiance_cubemap(RID p_source,int p_resolution) const { Texture * texture = texture_owner.get(p_source); @@ -1515,12 +1539,12 @@ void RasterizerStorageGLES3::_update_shader(Shader* p_shader) const { actions->uniforms=&p_shader->uniforms; - } + } break; case VS::SHADER_PARTICLES: { actions=&shaders.actions_particles; actions->uniforms=&p_shader->uniforms; - } + } break; } @@ -2471,6 +2495,7 @@ RID RasterizerStorageGLES3::mesh_create(){ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes,const Vector<Rect3>& p_bone_aabbs){ + PoolVector<uint8_t> array = p_array; Mesh *mesh = mesh_owner.getornull(p_mesh); @@ -2669,8 +2694,6 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P int array_size = stride * p_vertex_count; int index_array_size=0; - - print_line("desired size: "+itos(array_size)+" vcount "+itos(p_vertex_count)+" should be: "+itos(array.size()+p_vertex_count*2)+" but is "+itos(array.size())); if (array.size()!=array_size && array.size()+p_vertex_count*2 == array_size) { //old format, convert array = PoolVector<uint8_t>(); @@ -4267,6 +4290,7 @@ RID RasterizerStorageGLES3::light_create(VS::LightType p_type){ light->param[VS::LIGHT_PARAM_SPECULAR]=0.5; light->param[VS::LIGHT_PARAM_RANGE]=1.0; light->param[VS::LIGHT_PARAM_SPOT_ANGLE]=45; + light->param[VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE]=45; light->param[VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE]=0; light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET]=0.1; light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET]=0.3; @@ -4753,6 +4777,7 @@ RID RasterizerStorageGLES3::gi_probe_create() { gip->bounds=Rect3(Vector3(),Vector3(1,1,1)); gip->dynamic_range=1.0; gip->energy=1.0; + gip->propagation=1.0; gip->interior=false; gip->compress=false; gip->version=1; @@ -4858,6 +4883,15 @@ void RasterizerStorageGLES3::gi_probe_set_energy(RID p_probe,float p_range){ } +void RasterizerStorageGLES3::gi_probe_set_propagation(RID p_probe,float p_range){ + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->propagation=p_range; + +} + void RasterizerStorageGLES3::gi_probe_set_interior(RID p_probe,bool p_enable) { GIProbe *gip = gi_probe_owner.getornull(p_probe); @@ -4902,6 +4936,16 @@ float RasterizerStorageGLES3::gi_probe_get_energy(RID p_probe) const{ return gip->energy; } +float RasterizerStorageGLES3::gi_probe_get_propagation(RID p_probe) const{ + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,0); + + return gip->propagation; +} + + + uint32_t RasterizerStorageGLES3::gi_probe_get_version(RID p_probe) { @@ -5403,12 +5447,14 @@ void RasterizerStorageGLES3::instance_remove_dependency(RID p_base,RasterizerSce void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { + if (rt->fbo) { glDeleteFramebuffers(1,&rt->fbo); glDeleteTextures(1,&rt->color); rt->fbo=0; } + if (rt->buffers.fbo) { glDeleteFramebuffers(1,&rt->buffers.fbo); glDeleteRenderbuffers(1,&rt->buffers.depth); @@ -5422,11 +5468,13 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { rt->buffers.fbo=0; } + if (rt->depth) { glDeleteTextures(1,&rt->depth); rt->depth=0; } + if (rt->effects.ssao.blur_fbo[0]) { glDeleteFramebuffers(1,&rt->effects.ssao.blur_fbo[0]); glDeleteTextures(1,&rt->effects.ssao.blur_red[0]); @@ -5439,11 +5487,16 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { rt->effects.ssao.depth_mipmap_fbos.clear(); glDeleteTextures(1,&rt->effects.ssao.linear_depth); + + rt->effects.ssao.blur_fbo[0]=0; + rt->effects.ssao.blur_fbo[1]=0; } + if (rt->exposure.fbo) { glDeleteFramebuffers(1,&rt->exposure.fbo); glDeleteTextures(1,&rt->exposure.color); + rt->exposure.fbo=0; } Texture *tex = texture_owner.get(rt->texture); tex->alloc_height=0; @@ -5451,6 +5504,7 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { tex->width=0; tex->height=0; + for(int i=0;i<2;i++) { for(int j=0;j<rt->effects.mip_maps[i].sizes.size();j++) { glDeleteFramebuffers(1,&rt->effects.mip_maps[i].sizes[j].fbo); @@ -5460,6 +5514,8 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { rt->effects.mip_maps[i].sizes.clear(); rt->effects.mip_maps[i].levels=0; } + + /* if (rt->effects.screen_space_depth) { glDeleteTextures(1,&rt->effects.screen_space_depth); @@ -5474,7 +5530,6 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){ if (rt->width<=0 || rt->height<=0) return; - GLuint color_internal_format; GLuint color_format; GLuint color_type; @@ -6294,6 +6349,25 @@ bool RasterizerStorageGLES3::free(RID p_rid){ return true; } + +bool RasterizerStorageGLES3::has_os_feature(const String& p_feature) const { + + if (p_feature=="s3tc") + return config.s3tc_supported; + + if (p_feature=="etc") + return config.etc_supported; + + if (p_feature=="etc2") + return config.etc2_supported; + + if (p_feature=="pvrtc") + return config.pvrtc_supported; + + return false; + +} + //////////////////////////////////////////// diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index c8f04f72c1..07998886a8 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -228,6 +228,12 @@ public: Image images[6]; + VisualServer::TextureDetectCallback detect_3d; + void *detect_3d_ud; + + VisualServer::TextureDetectCallback detect_srgb; + void *detect_srgb_ud; + Texture() { using_srgb=false; @@ -243,6 +249,10 @@ public: total_data_size=0; target=GL_TEXTURE_2D; mipmaps=0; + detect_3d=NULL; + detect_3d_ud=NULL; + detect_srgb=NULL; + detect_srgb_ud=NULL; } @@ -281,6 +291,10 @@ public: virtual void textures_keep_original(bool p_enable); + virtual void texture_set_detect_3d_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata); + virtual void texture_set_detect_srgb_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata); + + /* SKYBOX API */ struct SkyBox : public RID_Data { @@ -907,6 +921,7 @@ public: int dynamic_range; float energy; + float propagation; bool interior; bool compress; @@ -939,6 +954,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range); virtual float gi_probe_get_energy(RID p_probe) const; + virtual void gi_probe_set_propagation(RID p_probe,float p_range); + virtual float gi_probe_get_propagation(RID p_probe) const; + virtual void gi_probe_set_interior(RID p_probe,bool p_enable); virtual bool gi_probe_is_interior(RID p_probe) const; @@ -1160,9 +1178,11 @@ public: height=0; depth=0; fbo=0; + exposure.fbo=0; buffers.fbo=0; used_in_frame=false; + flags[RENDER_TARGET_VFLIP]=false; flags[RENDER_TARGET_TRANSPARENT]=false; flags[RENDER_TARGET_NO_3D]=false; @@ -1237,6 +1257,7 @@ public: void initialize(); void finalize(); + virtual bool has_os_feature(const String& p_feature) const; RasterizerStorageGLES3(); diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 97872226a4..12aac79912 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -582,6 +582,7 @@ Error ShaderCompilerGLES3::compile(VS::ShaderMode p_mode, const String& p_code, used_name_defines.clear(); used_rmode_defines.clear(); + used_flag_pointers.clear(); _dump_node_code(parser.get_shader(),1,r_gen_code,*p_actions,actions[p_mode]); diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 66123193e6..200c0c0cac 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -71,6 +71,7 @@ layout(std140) uniform SceneData { //ubo:0 float shadow_dual_paraboloid_render_zfar; float shadow_dual_paraboloid_render_side; + highp vec2 screen_pixel_size; vec2 shadow_atlas_pixel_size; vec2 directional_shadow_pixel_size; @@ -91,7 +92,7 @@ layout(std140) uniform DirectionalLightData { //ubo:3 mediump vec4 light_color_energy; mediump vec4 light_params; //cone attenuation, angle, specular, shadow enabled, mediump vec4 light_clamp; - mediump vec4 shadow_color; + mediump vec4 shadow_color_contact; highp mat4 shadow_matrix1; highp mat4 shadow_matrix2; highp mat4 shadow_matrix3; @@ -126,13 +127,6 @@ out vec3 binormal_interp; #endif -#if !defined(USE_DEPTH_SHADOWS) && defined(USE_SHADOW_PASS) - -varying vec4 position_interp; - -#endif - - VERTEX_SHADER_GLOBALS @@ -161,6 +155,8 @@ layout(std140) uniform SkeletonData { //ubo:7 #endif +out highp vec4 position_interp; + void main() { highp vec4 vertex = vertex_attrib; // vec4(vertex_attrib.xyz * data_attrib.x,1.0); @@ -293,7 +289,7 @@ VERTEX_SHADER_CODE gl_Position = vertex; #endif - + position_interp=gl_Position; } @@ -375,6 +371,8 @@ layout(std140) uniform SceneData { highp vec4 ambient_light_color; highp vec4 bg_color; + + float ambient_energy; float bg_energy; @@ -383,6 +381,7 @@ layout(std140) uniform SceneData { float shadow_dual_paraboloid_render_zfar; float shadow_dual_paraboloid_render_side; + highp vec2 screen_pixel_size; vec2 shadow_atlas_pixel_size; vec2 directional_shadow_pixel_size; @@ -403,7 +402,7 @@ layout(std140) uniform DirectionalLightData { mediump vec4 light_color_energy; mediump vec4 light_params; //cone attenuation, angle, specular, shadow enabled, mediump vec4 light_clamp; - mediump vec4 shadow_color; + mediump vec4 shadow_color_contact; highp mat4 shadow_matrix1; highp mat4 shadow_matrix2; highp mat4 shadow_matrix3; @@ -425,7 +424,7 @@ struct LightData { mediump vec4 light_color_energy; mediump vec4 light_params; //cone attenuation, angle, specular, shadow enabled, mediump vec4 light_clamp; - mediump vec4 shadow_color; + mediump vec4 shadow_color_contact; highp mat4 shadow_matrix; }; @@ -493,6 +492,69 @@ layout(location=0) out vec4 frag_color; #endif +in highp vec4 position_interp; +uniform highp sampler2D depth_buffer; //texunit:-8 + +float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) { + + if (abs(dir.z)>0.99) + return 1.0; + + vec3 endpoint = pos+dir*max_distance; + vec4 source = position_interp; + vec4 dest = projection_matrix * vec4(endpoint, 1.0); + + vec2 from_screen = (source.xy / source.w) * 0.5 + 0.5; + vec2 to_screen = (dest.xy / dest.w) * 0.5 + 0.5; + + vec2 screen_rel = to_screen - from_screen; + + /*float pixel_size; //approximate pixel size + + if (screen_rel.x > screen_rel.y) { + + pixel_size = abs((pos.x-endpoint.x)/(screen_rel.x/screen_pixel_size.x)); + } else { + pixel_size = abs((pos.y-endpoint.y)/(screen_rel.y/screen_pixel_size.y)); + + }*/ + vec4 bias = projection_matrix * vec4(pos+vec3(0.0,0.0,0.04), 1.0); //todo un-harcode the 0.04 + + + + vec2 pixel_incr = normalize(screen_rel)*screen_pixel_size; + + float steps = length(screen_rel) / length(pixel_incr); + + //steps=10.0; + + vec4 incr = (dest - source)/steps; + float ratio=0.0; + float ratio_incr = 1.0/steps; + + do { + source += incr*2; + bias+=incr*2; + + vec3 uv_depth = (source.xyz / source.w) * 0.5 + 0.5; + float depth = texture(depth_buffer,uv_depth.xy).r; + + if (depth < uv_depth.z) { + if (depth > (bias.z/bias.w) * 0.5 + 0.5) { + return min(pow(ratio,4.0),1.0); + } else { + return 1.0; + } + } + + + ratio+=ratio_incr; + steps-=1.0; + } while (steps>0.0); + + return 1.0; +} + // GGX Specular // Source: http://www.filmicworlds.com/images/ggx-opt/optimized-ggx.hlsl @@ -517,6 +579,8 @@ float GTR1(float NdotH, float a) return (a2-1.0) / (M_PI*log(a2)*t); } + + void light_compute(vec3 N, vec3 L,vec3 V,vec3 B, vec3 T,vec3 light_color,vec3 diffuse_color, vec3 specular_color, float specular_blob_intensity, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,inout vec3 diffuse, inout vec3 specular) { float dotNL = max(dot(N,L), 0.0 ); @@ -660,7 +724,8 @@ vec3 light_transmittance(float translucency,vec3 light_vec, vec3 normal, vec3 po void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 binormal, vec3 tangent, vec3 albedo, vec3 specular, float roughness, float rim, float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,inout vec3 diffuse_light, inout vec3 specular_light) { vec3 light_rel_vec = omni_lights[idx].light_pos_inv_radius.xyz-vertex; - float normalized_distance = length( light_rel_vec )*omni_lights[idx].light_pos_inv_radius.w; + float light_length = length( light_rel_vec ); + float normalized_distance = light_length*omni_lights[idx].light_pos_inv_radius.w; vec3 light_attenuation = vec3(pow( max(1.0 - normalized_distance, 0.0), omni_lights[idx].light_direction_attenuation.w )); if (omni_lights[idx].light_params.w>0.5) { @@ -696,8 +761,15 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 bino splane.z = shadow_len * omni_lights[idx].light_pos_inv_radius.w; splane.xy = clamp_rect.xy+splane.xy*clamp_rect.zw; + float shadow = sample_shadow(shadow_atlas,shadow_atlas_pixel_size,splane.xy,splane.z,clamp_rect); + if (shadow>0.01 && omni_lights[idx].shadow_color_contact.a>0.0) { + + float contact_shadow = contact_shadow_compute(vertex,normalize(light_rel_vec),min(light_length,omni_lights[idx].shadow_color_contact.a)); + shadow=min(shadow,contact_shadow); - light_attenuation*=mix(omni_lights[idx].shadow_color.rgb,vec3(1.0),sample_shadow(shadow_atlas,shadow_atlas_pixel_size,splane.xy,splane.z,clamp_rect)); + + } + light_attenuation*=mix(omni_lights[idx].shadow_color_contact.rgb,vec3(1.0),shadow); } light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,omni_lights[idx].light_color_energy.rgb*light_attenuation,albedo,specular,omni_lights[idx].light_params.z,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); @@ -707,7 +779,8 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 bino void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 binormal, vec3 tangent,vec3 albedo, vec3 specular, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy, inout vec3 diffuse_light, inout vec3 specular_light) { vec3 light_rel_vec = spot_lights[idx].light_pos_inv_radius.xyz-vertex; - float normalized_distance = length( light_rel_vec )*spot_lights[idx].light_pos_inv_radius.w; + float light_length = length( light_rel_vec ); + float normalized_distance = light_length*spot_lights[idx].light_pos_inv_radius.w; vec3 light_attenuation = vec3(pow( max(1.0 - normalized_distance, 0.0), spot_lights[idx].light_direction_attenuation.w )); vec3 spot_dir = spot_lights[idx].light_direction_attenuation.xyz; float spot_cutoff=spot_lights[idx].light_params.y; @@ -719,7 +792,17 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi //there is a shadowmap highp vec4 splane=(spot_lights[idx].shadow_matrix * vec4(vertex,1.0)); splane.xyz/=splane.w; - light_attenuation*=mix(spot_lights[idx].shadow_color.rgb,vec3(1.0),sample_shadow(shadow_atlas,shadow_atlas_pixel_size,splane.xy,splane.z,spot_lights[idx].light_clamp)); + + float shadow = sample_shadow(shadow_atlas,shadow_atlas_pixel_size,splane.xy,splane.z,spot_lights[idx].light_clamp); + + if (shadow>0.01 && spot_lights[idx].shadow_color_contact.a>0.0) { + + float contact_shadow = contact_shadow_compute(vertex,normalize(light_rel_vec),min(light_length,spot_lights[idx].shadow_color_contact.a)); + shadow=min(shadow,contact_shadow); + + } + + light_attenuation*=mix(spot_lights[idx].shadow_color_contact.rgb,vec3(1.0),shadow); } light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,spot_lights[idx].light_color_energy.rgb*light_attenuation,albedo,specular,spot_lights[idx].light_params.z,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); @@ -1268,6 +1351,8 @@ FRAGMENT_SHADER_CODE } } + + #endif //LIGHT_USE_PSSM4 #ifdef LIGHT_USE_PSSM2 @@ -1306,16 +1391,26 @@ FRAGMENT_SHADER_CODE //one one sample - light_attenuation=mix(shadow_color.rgb,vec3(1.0),sample_shadow(directional_shadow,directional_shadow_pixel_size,pssm_coord.xy,pssm_coord.z,light_clamp)); + float shadow = sample_shadow(directional_shadow,directional_shadow_pixel_size,pssm_coord.xy,pssm_coord.z,light_clamp); #if defined(LIGHT_USE_PSSM_BLEND) + if (use_blend) { - vec3 light_attenuation2=mix(shadow_color.rgb,vec3(1.0),sample_shadow(directional_shadow,directional_shadow_pixel_size,pssm_coord2.xy,pssm_coord2.z,light_clamp)); - light_attenuation=mix(light_attenuation,light_attenuation2,pssm_blend); + shadow=mix(shadow, sample_shadow(directional_shadow,directional_shadow_pixel_size,pssm_coord2.xy,pssm_coord2.z,light_clamp)); } #endif + if (shadow>0.01 && shadow_color_contact.a>0.0) { + + float contact_shadow = contact_shadow_compute(vertex,-light_direction_attenuation.xyz,shadow_color_contact.a); + shadow=min(shadow,contact_shadow); + + } + + light_attenuation=mix(shadow_color_contact.rgb,vec3(1.0),shadow); + + } #endif //LIGHT_DIRECTIONAL_SHADOW diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 283cff0486..cc69283f97 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -30,6 +30,7 @@ #ifdef UNIX_ENABLED +#include "servers/visual_server.h" #include "thread_posix.h" #include "semaphore_posix.h" @@ -478,6 +479,13 @@ String OS_Unix::get_data_dir() const { } +bool OS_Unix::check_feature_support(const String& p_feature) { + + return VisualServer::get_singleton()->has_os_feature(p_feature); + +} + + String OS_Unix::get_installed_templates_path() const { String p=get_global_settings_path(); if (p!="") diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index b28adc2ee0..220f818ff6 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -117,6 +117,8 @@ public: virtual String get_executable_path() const; virtual String get_data_dir() const; + virtual bool check_feature_support(const String& p_feature); + //virtual void run( MainLoop * p_main_loop ); diff --git a/main/main.cpp b/main/main.cpp index 3707c93fc5..21a839a25f 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -54,18 +54,14 @@ #include "scene/main/viewport.h" #ifdef TOOLS_ENABLED +#include "tools/editor/doc/doc_data.h" #include "tools/editor/editor_node.h" #include "tools/editor/project_manager.h" - #endif #include "io/file_access_network.h" -#include "tools/doc/doc_data.h" - - #include "servers/physics_2d_server.h" - #include "core/io/stream_peer_tcp.h" #include "core/os/thread.h" #include "core/io/file_access_pack.h" diff --git a/tools/dist/docker/Dockerfile b/misc/dist/docker/Dockerfile index 428de9d1a7..428de9d1a7 100644 --- a/tools/dist/docker/Dockerfile +++ b/misc/dist/docker/Dockerfile diff --git a/tools/dist/docker/README.md b/misc/dist/docker/README.md index 7f10b46ad8..7f10b46ad8 100644 --- a/tools/dist/docker/README.md +++ b/misc/dist/docker/README.md diff --git a/tools/dist/docker/scripts/install-android-tools b/misc/dist/docker/scripts/install-android-tools index 8a617d9942..8a617d9942 100644 --- a/tools/dist/docker/scripts/install-android-tools +++ b/misc/dist/docker/scripts/install-android-tools diff --git a/tools/dist/html_fs/godotfs.js b/misc/dist/html_fs/godotfs.js index 2c59344cf5..2c59344cf5 100644 --- a/tools/dist/html_fs/godotfs.js +++ b/misc/dist/html_fs/godotfs.js diff --git a/tools/dist/ios_xcode/godot_xcode/data.pck b/misc/dist/ios_xcode/godot_xcode/data.pck index e69de29bb2..e69de29bb2 100644 --- a/tools/dist/ios_xcode/godot_xcode/data.pck +++ b/misc/dist/ios_xcode/godot_xcode/data.pck diff --git a/tools/dist/ios_xcode/godot_xcode/godot_debug.iphone b/misc/dist/ios_xcode/godot_xcode/godot_debug.iphone index e69de29bb2..e69de29bb2 100755 --- a/tools/dist/ios_xcode/godot_xcode/godot_debug.iphone +++ b/misc/dist/ios_xcode/godot_xcode/godot_debug.iphone diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.pbxproj index bdba8488c8..bdba8488c8 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.pbxproj +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.pbxproj diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 3c9ba38bbe..3c9ba38bbe 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-568h@2x~iphone.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-568h@2x~iphone.png Binary files differindex 1d5e472665..1d5e472665 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-568h@2x~iphone.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-568h@2x~iphone.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-667h.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h.png Binary files differindex b13a399c83..b13a399c83 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-667h.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-667h@2x.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h@2x.png Binary files differindex b51598fed0..b51598fed0 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-667h@2x.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-667h@2x.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-736h.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h.png Binary files differindex 8c44edbccd..8c44edbccd 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-736h.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-736h@3x.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h@3x.png Binary files differindex 33847ac136..33847ac136 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-736h@3x.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-736h@3x.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape-736h.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape-736h.png Binary files differindex 2a025b745b..2a025b745b 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape-736h.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape-736h.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape@2x~ipad.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape@2x~ipad.png Binary files differindex 7099f3e18d..7099f3e18d 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape@2x~ipad.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape@2x~ipad.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape~ipad.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape~ipad.png Binary files differindex 4a761c339a..4a761c339a 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape~ipad.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Landscape~ipad.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait@2x~ipad.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait@2x~ipad.png Binary files differindex b09cf21186..b09cf21186 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait@2x~ipad.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait@2x~ipad.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait~ipad.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait~ipad.png Binary files differindex fa698eb70c..fa698eb70c 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait~ipad.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default-Portrait~ipad.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default@2x~iphone.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default@2x~iphone.png Binary files differindex ddf2861f4d..ddf2861f4d 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default@2x~iphone.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default@2x~iphone.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default~iphone.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default~iphone.png Binary files differindex c485a33b03..c485a33b03 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Default~iphone.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Default~iphone.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json index a458b67873..a458b67873 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png Binary files differindex 165f4423b3..165f4423b3 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-100.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png Binary files differindex 2e205e920c..2e205e920c 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-114.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png Binary files differindex 6245f83f48..6245f83f48 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-120.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png Binary files differindex 7b24e01bc6..7b24e01bc6 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-144.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png Binary files differindex 344b470fa3..344b470fa3 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-152.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png Binary files differindex 0dcebbc3f2..0dcebbc3f2 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-180.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png Binary files differindex 9ae94e9aaf..9ae94e9aaf 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-29.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png Binary files differindex 569f24df91..569f24df91 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-40.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png Binary files differindex 9e69ed3121..9e69ed3121 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-50.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png Binary files differindex b970fa3067..b970fa3067 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-57.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png Binary files differindex 6097a6c73b..6097a6c73b 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-58.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png Binary files differindex 21b9622eb6..21b9622eb6 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-60.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png Binary files differindex 34dea8e6ad..34dea8e6ad 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-72.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png Binary files differindex f72eb0b345..f72eb0b345 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-76.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png Binary files differindex 793c9b1f5f..793c9b1f5f 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/Icon-80.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png Binary files differindex 7cd0e054ab..7cd0e054ab 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-167.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png Binary files differindex e9b2429754..e9b2429754 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/icon-87.png diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes index e328a62cb6..e328a62cb6 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/Images.xcassets/AppIcon.appiconset/sizes diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/en.lproj/InfoPlist.strings b/misc/dist/ios_xcode/godot_xcode/godot_ios/en.lproj/InfoPlist.strings index 477b28ff8f..477b28ff8f 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/en.lproj/InfoPlist.strings +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/en.lproj/InfoPlist.strings diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_xcode/godot_ios/godot_ios-Info.plist index f97b0fca36..f97b0fca36 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/godot_ios-Info.plist +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/godot_ios-Info.plist diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/main.m b/misc/dist/ios_xcode/godot_xcode/godot_ios/main.m index 88b8e60670..88b8e60670 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/main.m +++ b/misc/dist/ios_xcode/godot_xcode/godot_ios/main.m diff --git a/tools/dist/ios_xcode/godot_xcode/godot_opt.iphone b/misc/dist/ios_xcode/godot_xcode/godot_opt.iphone index e69de29bb2..e69de29bb2 100755 --- a/tools/dist/ios_xcode/godot_xcode/godot_opt.iphone +++ b/misc/dist/ios_xcode/godot_xcode/godot_opt.iphone diff --git a/tools/dist/osx_template.app/Contents/Info.plist b/misc/dist/osx_template.app/Contents/Info.plist index eee787bdaf..eee787bdaf 100755 --- a/tools/dist/osx_template.app/Contents/Info.plist +++ b/misc/dist/osx_template.app/Contents/Info.plist diff --git a/tools/dist/osx_template.app/Contents/PkgInfo b/misc/dist/osx_template.app/Contents/PkgInfo index 6f749b0f37..6f749b0f37 100644 --- a/tools/dist/osx_template.app/Contents/PkgInfo +++ b/misc/dist/osx_template.app/Contents/PkgInfo diff --git a/tools/dist/osx_template.app/Contents/Resources/icon.icns b/misc/dist/osx_template.app/Contents/Resources/icon.icns Binary files differindex 375f61437d..375f61437d 100644 --- a/tools/dist/osx_template.app/Contents/Resources/icon.icns +++ b/misc/dist/osx_template.app/Contents/Resources/icon.icns diff --git a/tools/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist index 4d88e97503..4d88e97503 100755 --- a/tools/dist/osx_tools.app/Contents/Info.plist +++ b/misc/dist/osx_tools.app/Contents/Info.plist diff --git a/tools/dist/osx_tools.app/Contents/PkgInfo b/misc/dist/osx_tools.app/Contents/PkgInfo index 6f749b0f37..6f749b0f37 100644 --- a/tools/dist/osx_tools.app/Contents/PkgInfo +++ b/misc/dist/osx_tools.app/Contents/PkgInfo diff --git a/tools/dist/osx_tools.app/Contents/Resources/Godot.icns b/misc/dist/osx_tools.app/Contents/Resources/Godot.icns Binary files differindex 375f61437d..375f61437d 100644 --- a/tools/dist/osx_tools.app/Contents/Resources/Godot.icns +++ b/misc/dist/osx_tools.app/Contents/Resources/Godot.icns diff --git a/tools/dist/uwp_template/AppxManifest.xml b/misc/dist/uwp_template/AppxManifest.xml index d5e653708c..d5e653708c 100644 --- a/tools/dist/uwp_template/AppxManifest.xml +++ b/misc/dist/uwp_template/AppxManifest.xml diff --git a/tools/dist/uwp_template/Assets/SplashScreen.scale-100.png b/misc/dist/uwp_template/Assets/SplashScreen.scale-100.png Binary files differindex 540bfb1c01..540bfb1c01 100644 --- a/tools/dist/uwp_template/Assets/SplashScreen.scale-100.png +++ b/misc/dist/uwp_template/Assets/SplashScreen.scale-100.png diff --git a/tools/dist/uwp_template/Assets/Square150x150Logo.scale-100.png b/misc/dist/uwp_template/Assets/Square150x150Logo.scale-100.png Binary files differindex 6cff663eb5..6cff663eb5 100644 --- a/tools/dist/uwp_template/Assets/Square150x150Logo.scale-100.png +++ b/misc/dist/uwp_template/Assets/Square150x150Logo.scale-100.png diff --git a/tools/dist/uwp_template/Assets/Square310x310Logo.scale-100.png b/misc/dist/uwp_template/Assets/Square310x310Logo.scale-100.png Binary files differindex 12ec232c87..12ec232c87 100644 --- a/tools/dist/uwp_template/Assets/Square310x310Logo.scale-100.png +++ b/misc/dist/uwp_template/Assets/Square310x310Logo.scale-100.png diff --git a/tools/dist/uwp_template/Assets/Square44x44Logo.scale-100.png b/misc/dist/uwp_template/Assets/Square44x44Logo.scale-100.png Binary files differindex ad059994ed..ad059994ed 100644 --- a/tools/dist/uwp_template/Assets/Square44x44Logo.scale-100.png +++ b/misc/dist/uwp_template/Assets/Square44x44Logo.scale-100.png diff --git a/tools/dist/uwp_template/Assets/Square71x71Logo.scale-100.png b/misc/dist/uwp_template/Assets/Square71x71Logo.scale-100.png Binary files differindex b1bf331365..b1bf331365 100644 --- a/tools/dist/uwp_template/Assets/Square71x71Logo.scale-100.png +++ b/misc/dist/uwp_template/Assets/Square71x71Logo.scale-100.png diff --git a/tools/dist/uwp_template/Assets/StoreLogo.scale-100.png b/misc/dist/uwp_template/Assets/StoreLogo.scale-100.png Binary files differindex 8d7a625c82..8d7a625c82 100644 --- a/tools/dist/uwp_template/Assets/StoreLogo.scale-100.png +++ b/misc/dist/uwp_template/Assets/StoreLogo.scale-100.png diff --git a/tools/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png b/misc/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png Binary files differindex b06f1ad50f..b06f1ad50f 100644 --- a/tools/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png +++ b/misc/dist/uwp_template/Assets/Wide310x150Logo.scale-100.png diff --git a/tools/scripts/addheader.py b/misc/scripts/addheader.py index 056e807c81..056e807c81 100644 --- a/tools/scripts/addheader.py +++ b/misc/scripts/addheader.py diff --git a/tools/scripts/file-hex-array.py b/misc/scripts/file-hex-array.py index a6cdfe541f..a6cdfe541f 100755 --- a/tools/scripts/file-hex-array.py +++ b/misc/scripts/file-hex-array.py diff --git a/tools/scripts/make_bmfhdr.py b/misc/scripts/make_bmfhdr.py index 1d3c40f9c6..1d3c40f9c6 100644 --- a/tools/scripts/make_bmfhdr.py +++ b/misc/scripts/make_bmfhdr.py diff --git a/tools/scripts/make_glwrapper.py b/misc/scripts/make_glwrapper.py index 5694d2327e..5694d2327e 100644 --- a/tools/scripts/make_glwrapper.py +++ b/misc/scripts/make_glwrapper.py diff --git a/tools/scripts/make_icons.sh b/misc/scripts/make_icons.sh index 71037cd1c3..71037cd1c3 100644 --- a/tools/scripts/make_icons.sh +++ b/misc/scripts/make_icons.sh diff --git a/tools/scripts/makeargs.py b/misc/scripts/makeargs.py index 2cd47ae087..2cd47ae087 100644 --- a/tools/scripts/makeargs.py +++ b/misc/scripts/makeargs.py diff --git a/tools/scripts/memsort.py b/misc/scripts/memsort.py index fb636b0f78..fb636b0f78 100644 --- a/tools/scripts/memsort.py +++ b/misc/scripts/memsort.py diff --git a/tools/scripts/sort-demos.sh b/misc/scripts/sort-demos.sh index 2121d78c15..2121d78c15 100644 --- a/tools/scripts/sort-demos.sh +++ b/misc/scripts/sort-demos.sh diff --git a/tools/scripts/svgs_2_pngs.py b/misc/scripts/svgs_2_pngs.py index b24324dcd7..b24324dcd7 100644 --- a/tools/scripts/svgs_2_pngs.py +++ b/misc/scripts/svgs_2_pngs.py diff --git a/modules/etc1/image_etc.cpp b/modules/etc1/image_etc.cpp index 36ff1b86df..2d883bff0f 100644 --- a/modules/etc1/image_etc.cpp +++ b/modules/etc1/image_etc.cpp @@ -95,7 +95,7 @@ static void _decompress_etc(Image *p_img) { //print_line("Re Creating ETC into regular image: w "+itos(p_img->get_width())+" h "+itos(p_img->get_height())+" mm "+itos(p_img->get_mipmaps())); *p_img=Image(p_img->get_width(),p_img->get_height(),p_img->has_mipmaps(),Image::FORMAT_RGB8,dst); if (p_img->has_mipmaps()) - p_img->generate_mipmaps(true); + p_img->generate_mipmaps(); } @@ -112,16 +112,17 @@ static void _compress_etc(Image *p_img) { img.convert(Image::FORMAT_RGB8); - int mmc=img.get_mipmap_count(); - if (mmc==0) - img.generate_mipmaps(); // force mipmaps, so it works on most hardware - - PoolVector<uint8_t> res_data; PoolVector<uint8_t> dst_data; PoolVector<uint8_t>::Read r = img.get_data().read(); + int target_size = Image::get_image_data_size(p_img->get_width(),p_img->get_height(),Image::FORMAT_ETC,p_img->has_mipmaps()?-1:0); + int mmc = p_img->has_mipmaps() ? Image::get_image_required_mipmaps(p_img->get_width(),p_img->get_height(),Image::FORMAT_ETC) : 0; + + dst_data.resize(target_size); int mc=0; + int ofs=0; + PoolVector<uint8_t>::Write w=dst_data.write(); rg_etc1::etc1_pack_params pp; @@ -133,9 +134,9 @@ static void _compress_etc(Image *p_img) { int bh=MAX(imgh/4,1); const uint8_t *src = &r[img.get_mipmap_offset(i)]; int mmsize = MAX(bw,1)*MAX(bh,1)*8; - dst_data.resize(dst_data.size()+mmsize); - PoolVector<uint8_t>::Write w=dst_data.write(); - uint8_t *dst = &w[dst_data.size()-mmsize]; + + uint8_t *dst = &w[ofs]; + ofs+=mmsize; //print_line("bh: "+itos(bh)+" bw: "+itos(bw)); diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 34c39c8024..c1c1f5d5a9 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -2577,7 +2577,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { Vector<Node*> args; Vector<double> constants; - bool constant=true; + bool constant=false; for(int i=1;i<op->arguments.size();i++) { args.push_back(op->arguments[i]); @@ -2585,13 +2585,12 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { ConstantNode *c = static_cast<ConstantNode*>(op->arguments[i]); if (c->value.get_type()==Variant::REAL || c->value.get_type()==Variant::INT) { constants.push_back(c->value); - } else { - constant=false; + constant=true; } } } - if (args.size()>0 || args.size()<4) { + if (args.size()>0 && args.size()<4) { if (constant) { diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index a48c1f3485..28c200596b 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -64,10 +64,9 @@ void image_compress_squish(Image *p_image) { p_image->convert(Image::FORMAT_RGBA8); //always expects rgba - int mm_count = p_image->get_mipmap_count(); - PoolVector<uint8_t> data; - int target_size = Image::get_image_data_size(w,h,target_format,mm_count); + int target_size = Image::get_image_data_size(w,h,target_format,p_image->has_mipmaps()?-1:0); + int mm_count = p_image->has_mipmaps() ? Image::get_image_required_mipmaps(w,h,target_format) : 0; data.resize(target_size); PoolVector<uint8_t>::Read rb = p_image->get_data().read(); diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 20db63b66f..94678e5e94 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -63,6 +63,38 @@ Ref<BitMap> TouchScreenButton::get_bitmask() const{ return bitmask; } +void TouchScreenButton::set_shape(const Ref<Shape2D>& p_shape){ + + shape=p_shape; + + if (!is_inside_tree()) + return; + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) + return; + update(); +} + +Ref<Shape2D> TouchScreenButton::get_shape() const{ + + return shape; +} + +void TouchScreenButton::set_shape_centered(bool p_shape_centered) { + + shape_centered=p_shape_centered; + + if (!is_inside_tree()) + return; + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) + return; + update(); +} + +bool TouchScreenButton::is_shape_centered() const { + + return shape_centered; +} + void TouchScreenButton::_notification(int p_what) { switch(p_what) { @@ -86,6 +118,15 @@ void TouchScreenButton::_notification(int p_what) { draw_texture(texture,Point2()); } + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) + return; + if (shape.is_valid()) { + Color draw_col=get_tree()->get_debug_collisions_color(); + Vector2 pos=shape_centered ? get_item_rect().size*0.5f : Vector2(); + draw_set_transform_matrix(get_canvas_transform().translated(pos)); + shape->draw(get_canvas_item(),draw_col); + } + } break; case NOTIFICATION_ENTER_TREE: { @@ -104,8 +145,12 @@ void TouchScreenButton::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { if (is_pressed()) - Input::get_singleton()->action_release(action); + _release(true); } break; + case NOTIFICATION_PAUSED: { + // So the button can be pressed again even though the release gets unhandled because of coming during pause + allow_repress=true; + } } } @@ -143,22 +188,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (p_event.type==InputEvent::SCREEN_TOUCH && !p_event.screen_touch.pressed && finger_pressed==p_event.screen_touch.index) { - emit_signal("released"); - - if (action_id!=-1) { - - Input::get_singleton()->action_release(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=false; - get_tree()->input_event(ie); - } - finger_pressed=-1; - - update(); - + _release(); } if ((p_event.type==InputEvent::SCREEN_TOUCH && p_event.screen_touch.pressed)|| p_event.type==InputEvent::SCREEN_DRAG) { @@ -184,44 +214,12 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (touched) { - if (finger_pressed==-1) { - finger_pressed=p_event.screen_touch.index; - //emit change stuff - emit_signal("pressed"); - if (action_id!=-1) { - - Input::get_singleton()->action_press(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=true; - get_tree()->input_event(ie); - } - - update(); + _press(p_event.screen_touch.index); } - } else { - if (finger_pressed!=-1) { - - emit_signal("released"); - - if (action_id!=-1) { - - Input::get_singleton()->action_release(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=false; - get_tree()->input_event(ie); - } - finger_pressed=-1; - - update(); + _release(); } } @@ -239,67 +237,88 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (!is_visible_in_tree()) return; - if (finger_pressed!=-1) + const bool can_press=finger_pressed==-1 || allow_repress; + if (!can_press) return; //already fingering Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); + Rect2 item_rect = get_item_rect(); bool touched=false; + bool check_rect=true; + if (shape.is_valid()) { + + check_rect=false; + Transform2D xform=shape_centered ? Transform2D().translated(get_item_rect().size*0.5f) : Transform2D(); + touched=shape->collide(xform, unit_rect, Transform2D(0, coord + Vector2(0.5,0.5))); + } + if (bitmask.is_valid()) { - if (Rect2(Point2(),bitmask->get_size()).has_point(coord)) { + check_rect=false; + if (!touched && Rect2(Point2(),bitmask->get_size()).has_point(coord)) { if (bitmask->get_bit(coord)) touched=true; } - } else { - if (!texture.is_null()) - touched=Rect2(Point2(),texture->get_size()).has_point(coord); } + if (!touched && check_rect) { + if (!texture.is_null()) + touched=item_rect.has_point(coord); + } if (touched) { - - finger_pressed=p_event.screen_touch.index; - //emit change stuff - emit_signal("pressed"); - if (action_id!=-1) { - - Input::get_singleton()->action_press(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=true; - get_tree()->input_event(ie); - } - update(); - + _press(p_event.screen_touch.index); } } else { + if (p_event.screen_touch.index==finger_pressed) { + _release(); + } + } + } + } +} +void TouchScreenButton::_press(int p_finger_pressed) { - if (p_event.screen_touch.index==finger_pressed) { - //untouch + finger_pressed=p_finger_pressed; + allow_repress=false; - emit_signal("released"); + if (action_id!=-1) { - if (action_id!=-1) { + Input::get_singleton()->action_press(action); + InputEvent ie; + ie.type=InputEvent::ACTION; + ie.ID=0; + ie.action.action=action_id; + ie.action.pressed=true; + get_tree()->input_event(ie); + } - Input::get_singleton()->action_release(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=false; - get_tree()->input_event(ie); - } - finger_pressed=-1; - update(); - } - } - } + emit_signal("pressed"); + update(); +} + +void TouchScreenButton::_release(bool p_exiting_tree) { + + finger_pressed=-1; + + if (action_id!=-1) { + + Input::get_singleton()->action_release(action); + InputEvent ie; + ie.type=InputEvent::ACTION; + ie.ID=0; + ie.action.action=action_id; + ie.action.pressed=false; + get_tree()->input_event(ie); + } + + if (!p_exiting_tree) { + emit_signal("released"); + update(); } } @@ -349,6 +368,12 @@ void TouchScreenButton::_bind_methods() { ClassDB::bind_method(_MD("set_bitmask","bitmask"),&TouchScreenButton::set_bitmask); ClassDB::bind_method(_MD("get_bitmask"),&TouchScreenButton::get_bitmask); + ClassDB::bind_method(_MD("set_shape","shape"),&TouchScreenButton::set_shape); + ClassDB::bind_method(_MD("get_shape"),&TouchScreenButton::get_shape); + + ClassDB::bind_method(_MD("set_shape_centered","bool"),&TouchScreenButton::set_shape_centered); + ClassDB::bind_method(_MD("is_shape_centered"),&TouchScreenButton::is_shape_centered); + ClassDB::bind_method(_MD("set_action","action"),&TouchScreenButton::set_action); ClassDB::bind_method(_MD("get_action"),&TouchScreenButton::get_action); @@ -365,6 +390,8 @@ void TouchScreenButton::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture")); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"pressed",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture_pressed"),_SCS("get_texture_pressed")); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"bitmask",PROPERTY_HINT_RESOURCE_TYPE,"BitMap"),_SCS("set_bitmask"),_SCS("get_bitmask")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"shape",PROPERTY_HINT_RESOURCE_TYPE,"Shape2D"),_SCS("set_shape"),_SCS("get_shape")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"shape_centered"),_SCS("set_shape_centered"),_SCS("is_shape_centered")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"passby_press"),_SCS("set_passby_press"),_SCS("is_passby_press_enabled")); ADD_PROPERTY( PropertyInfo(Variant::STRING,"action"),_SCS("set_action"),_SCS("get_action")); ADD_PROPERTY( PropertyInfo(Variant::INT,"visibility_mode",PROPERTY_HINT_ENUM,"Always,TouchScreen Only"),_SCS("set_visibility_mode"),_SCS("get_visibility_mode")); @@ -379,7 +406,11 @@ void TouchScreenButton::_bind_methods() { TouchScreenButton::TouchScreenButton() { finger_pressed=-1; + allow_repress=false; action_id=-1; passby_press=false; visibility=VISIBILITY_ALWAYS; + shape_centered=true; + unit_rect=Ref<RectangleShape2D>(memnew(RectangleShape2D)); + unit_rect->set_extents(Vector2(0.5,0.5)); } diff --git a/scene/2d/screen_button.h b/scene/2d/screen_button.h index 34e02d644b..8ce378c660 100644 --- a/scene/2d/screen_button.h +++ b/scene/2d/screen_button.h @@ -32,6 +32,7 @@ #include "scene/2d/node_2d.h" #include "scene/resources/texture.h" #include "scene/resources/bit_mask.h" +#include "scene/resources/rectangle_shape_2d.h" class TouchScreenButton : public Node2D { @@ -47,16 +48,24 @@ private: Ref<Texture> texture; Ref<Texture> texture_pressed; Ref<BitMap> bitmask; + Ref<Shape2D> shape; + bool shape_centered; + + Ref<RectangleShape2D> unit_rect; StringName action; bool passby_press; int finger_pressed; + bool allow_repress; int action_id; VisibilityMode visibility; void _input(const InputEvent& p_Event); + void _press(int p_finger_pressed); + void _release(bool p_exiting_tree=false); + protected: void _notification(int p_what); @@ -73,6 +82,12 @@ public: void set_bitmask(const Ref<BitMap>& p_bitmask); Ref<BitMap> get_bitmask() const; + void set_shape(const Ref<Shape2D>& p_shape); + Ref<Shape2D> get_shape() const; + + void set_shape_centered(bool p_shape_centered); + bool is_shape_centered() const; + void set_action(const String& p_action); String get_action() const; diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index b29ae211de..4c33590568 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -64,6 +64,18 @@ float GIProbeData::get_energy() const{ } +void GIProbeData::set_propagation(float p_range) { + + VS::get_singleton()->gi_probe_set_propagation(probe,p_range); +} + +float GIProbeData::get_propagation() const{ + + return VS::get_singleton()->gi_probe_get_propagation(probe); + +} + + void GIProbeData::set_interior(bool p_enable) { VS::get_singleton()->gi_probe_set_interior(probe,p_enable); @@ -121,6 +133,9 @@ void GIProbeData::_bind_methods() { ClassDB::bind_method(_MD("set_energy","energy"),&GIProbeData::set_energy); ClassDB::bind_method(_MD("get_energy"),&GIProbeData::get_energy); + ClassDB::bind_method(_MD("set_propagation","propagation"),&GIProbeData::set_propagation); + ClassDB::bind_method(_MD("get_propagation"),&GIProbeData::get_propagation); + ClassDB::bind_method(_MD("set_interior","interior"),&GIProbeData::set_interior); ClassDB::bind_method(_MD("is_interior"),&GIProbeData::is_interior); @@ -134,6 +149,7 @@ void GIProbeData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_data"),_SCS("get_dynamic_data")); ADD_PROPERTY(PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_energy"),_SCS("get_energy")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"propagation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_propagation"),_SCS("get_propagation")); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"interior",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_interior"),_SCS("is_interior")); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"compress",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_compress"),_SCS("is_compressed")); @@ -214,6 +230,18 @@ float GIProbe::get_energy() const { return energy; } +void GIProbe::set_propagation(float p_propagation) { + + propagation=p_propagation; + if (probe_data.is_valid()) { + probe_data->set_propagation(propagation); + } +} +float GIProbe::get_propagation() const { + + return propagation; +} + void GIProbe::set_interior(bool p_enable) { interior=p_enable; @@ -906,7 +934,7 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater } -void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker) { +void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker, const Vector<Ref<Material> > &p_materials, const Ref<Material> &p_override_material) { for(int i=0;i<p_mesh->get_surface_count();i++) { @@ -914,7 +942,16 @@ void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_b if (p_mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES) continue; //only triangles - Baker::MaterialCache material = _get_material_cache(p_mesh->surface_get_material(i),p_baker); + Ref<Material> src_material; + + if (p_override_material.is_valid()) { + src_material=p_override_material; + } else if (i<p_materials.size() && p_materials[i].is_valid()) { + src_material=p_materials[i]; + } else { + src_material=p_mesh->surface_get_material(i); + } + Baker::MaterialCache material = _get_material_cache(src_material,p_baker); Array a = p_mesh->surface_get_arrays(i); @@ -1009,6 +1046,10 @@ void GIProbe::_find_meshes(Node *p_at_node,Baker *p_baker){ Baker::PlotMesh pm; pm.local_xform=xf; pm.mesh=mesh; + for(int i=0;i<mesh->get_surface_count();i++) { + pm.instance_materials.push_back(mi->get_surface_material(i)); + } + pm.override_material=mi->get_material_override(); p_baker->mesh_list.push_back(pm); } @@ -1083,7 +1124,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ print_line("plotting mesh "+itos(pmc++)+"/"+itos(baker.mesh_list.size())); - _plot_mesh(E->get().local_xform,E->get().mesh,&baker); + _plot_mesh(E->get().local_xform,E->get().mesh,&baker,E->get().instance_materials,E->get().override_material); } _fixup_plot(0,0,0,0,0,&baker); @@ -1358,6 +1399,9 @@ void GIProbe::_bind_methods() { ClassDB::bind_method(_MD("set_energy","max"),&GIProbe::set_energy); ClassDB::bind_method(_MD("get_energy"),&GIProbe::get_energy); + ClassDB::bind_method(_MD("set_propagation","max"),&GIProbe::set_propagation); + ClassDB::bind_method(_MD("get_propagation"),&GIProbe::get_propagation); + ClassDB::bind_method(_MD("set_interior","enable"),&GIProbe::set_interior); ClassDB::bind_method(_MD("is_interior"),&GIProbe::is_interior); @@ -1372,6 +1416,7 @@ void GIProbe::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"extents"),_SCS("set_extents"),_SCS("get_extents")); ADD_PROPERTY( PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_RANGE,"1,16,1"),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_energy"),_SCS("get_energy")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"propagation",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_propagation"),_SCS("get_propagation")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"interior"),_SCS("set_interior"),_SCS("is_interior")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"compress"),_SCS("set_compress"),_SCS("is_compressed")); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"data",PROPERTY_HINT_RESOURCE_TYPE,"GIProbeData"),_SCS("set_probe_data"),_SCS("get_probe_data")); @@ -1389,6 +1434,7 @@ GIProbe::GIProbe() { subdiv=SUBDIV_128; dynamic_range=4; energy=1.0; + propagation=1.0; extents=Vector3(10,10,10); color_scan_cell_width=4; bake_texture_size=128; diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index e416b28791..f03a558908 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -32,6 +32,9 @@ public: void set_dynamic_range(int p_range); int get_dynamic_range() const; + void set_propagation(float p_range); + float get_propagation() const; + void set_energy(float p_range); float get_energy() const; @@ -114,6 +117,8 @@ private: int axis_cell_size[3]; struct PlotMesh { + Ref<Material> override_material; + Vector<Ref<Material> > instance_materials; Ref<Mesh> mesh; Transform local_xform; }; @@ -132,6 +137,7 @@ private: Vector3 extents; int dynamic_range; float energy; + float propagation; bool interior; bool compress; @@ -141,7 +147,7 @@ private: Vector<Color> _get_bake_texture(Image &p_image,const Color& p_color); Baker::MaterialCache _get_material_cache(Ref<Material> p_material,Baker *p_baker); void _plot_face(int p_idx, int p_level, int p_x,int p_y,int p_z,const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const Rect3 &p_aabb,Baker *p_baker); - void _plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker); + void _plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker,const Vector<Ref<Material> >& p_materials,const Ref<Material>& p_override_material); void _find_meshes(Node *p_at_node,Baker *p_baker); void _fixup_plot(int p_idx, int p_level,int p_x,int p_y, int p_z,Baker *p_baker); @@ -170,6 +176,9 @@ public: void set_energy(float p_energy); float get_energy() const; + void set_propagation(float p_propagation); + float get_propagation() const; + void set_interior(bool p_enable); bool is_interior() const; diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 0c6c113dd2..799c00d266 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -253,6 +253,7 @@ void Light::_bind_methods() { ADD_PROPERTY( PropertyInfo( Variant::BOOL, "shadow_enabled"), _SCS("set_shadow"), _SCS("has_shadow")); ADD_PROPERTY( PropertyInfo( Variant::COLOR, "shadow_color",PROPERTY_HINT_COLOR_NO_ALPHA), _SCS("set_shadow_color"), _SCS("get_shadow_color")); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_bias",PROPERTY_HINT_RANGE,"-16,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_BIAS); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_contact",PROPERTY_HINT_RANGE,"0,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_CONTACT_SHADOW_SIZE); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_max_distance",PROPERTY_HINT_RANGE,"0,65536,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_MAX_DISTANCE); ADD_GROUP("Editor",""); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "editor_only"), _SCS("set_editor_only"), _SCS("is_editor_only")); @@ -264,6 +265,7 @@ void Light::_bind_methods() { BIND_CONSTANT( PARAM_ATTENUATION ); BIND_CONSTANT( PARAM_SPOT_ANGLE ); BIND_CONSTANT( PARAM_SPOT_ATTENUATION ); + BIND_CONSTANT( PARAM_CONTACT_SHADOW_SIZE ); BIND_CONSTANT( PARAM_SHADOW_MAX_DISTANCE ); BIND_CONSTANT( PARAM_SHADOW_SPLIT_1_OFFSET ); BIND_CONSTANT( PARAM_SHADOW_SPLIT_2_OFFSET ); @@ -297,6 +299,7 @@ Light::Light(VisualServer::LightType p_type) { set_param(PARAM_ATTENUATION,1); set_param(PARAM_SPOT_ANGLE,45); set_param(PARAM_SPOT_ATTENUATION,1); + set_param(PARAM_CONTACT_SHADOW_SIZE,0); set_param(PARAM_SHADOW_MAX_DISTANCE,0); set_param(PARAM_SHADOW_SPLIT_1_OFFSET,0.1); set_param(PARAM_SHADOW_SPLIT_2_OFFSET,0.2); diff --git a/scene/3d/light.h b/scene/3d/light.h index d27b9fed12..4cf0156d5c 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -55,6 +55,7 @@ public: PARAM_ATTENUATION = VS::LIGHT_PARAM_ATTENUATION, PARAM_SPOT_ANGLE = VS::LIGHT_PARAM_SPOT_ANGLE, PARAM_SPOT_ATTENUATION = VS::LIGHT_PARAM_SPOT_ATTENUATION, + PARAM_CONTACT_SHADOW_SIZE= VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE, PARAM_SHADOW_MAX_DISTANCE = VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE, PARAM_SHADOW_SPLIT_1_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET, PARAM_SHADOW_SPLIT_2_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET, diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 6036b3f9df..4ca95294ca 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2431,6 +2431,8 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) { if (k.mod.shift) _post_shift_selection(); + else if(k.mod.command || k.mod.control) + deselect(); } break; #else @@ -2440,25 +2442,30 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) { if (k.mod.shift) _pre_shift_selection(); - // compute whitespace symbols seq length - int current_line_whitespace_len = 0; - while(current_line_whitespace_len < text[cursor.line].length()) { - CharType c = text[cursor.line][current_line_whitespace_len]; - if(c != '\t' && c != ' ') - break; - current_line_whitespace_len++; - } - - if(cursor_get_column() == current_line_whitespace_len) + if (k.mod.command) { + cursor_set_line(0); cursor_set_column(0); - else - cursor_set_column(current_line_whitespace_len); + } + else { + // compute whitespace symbols seq length + int current_line_whitespace_len = 0; + while( current_line_whitespace_len < text[cursor.line].length() ) { + CharType c = text[cursor.line][current_line_whitespace_len]; + if( c != '\t' && c != ' ' ) + break; + current_line_whitespace_len++; + } - if (k.mod.command) - cursor_set_line(0); + if( cursor_get_column() == current_line_whitespace_len ) + cursor_set_column(0); + else + cursor_set_column(current_line_whitespace_len); + } if (k.mod.shift) _post_shift_selection(); + else if(k.mod.command || k.mod.control) + deselect(); _cancel_completion(); completion_hint=""; @@ -2481,6 +2488,8 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) { if (k.mod.shift) _post_shift_selection(); + else if(k.mod.command || k.mod.control) + deselect(); } break; #else @@ -2495,6 +2504,8 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) { if (k.mod.shift) _post_shift_selection(); + else if(k.mod.command || k.mod.control) + deselect(); _cancel_completion(); completion_hint=""; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index a853b62254..fa89b7ba00 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -456,6 +456,26 @@ ImageTexture::~ImageTexture() { ////////////////////////////////////////// +void StreamTexture::_requested_3d(void* p_ud) { + + StreamTexture *st = (StreamTexture *)p_ud; + Ref<StreamTexture> stex(st); + ERR_FAIL_COND(!request_3d_callback); + request_3d_callback(stex); +} + +void StreamTexture::_requested_srgb(void* p_ud) { + + StreamTexture *st = (StreamTexture *)p_ud; + Ref<StreamTexture> stex(st); + ERR_FAIL_COND(!request_srgb_callback); + request_srgb_callback(stex); + +} + +StreamTexture::TextureFormatRequestCallback StreamTexture::request_3d_callback=NULL; +StreamTexture::TextureFormatRequestCallback StreamTexture::request_srgb_callback=NULL; + uint32_t StreamTexture::get_flags() const { @@ -490,6 +510,23 @@ Error StreamTexture::_load_data(const String& p_path,int &tw,int &th,int& flags, print_line("flags: "+itos(flags)); print_line("df: "+itos(df)); + + if (request_3d_callback && df&FORMAT_BIT_DETECT_3D) { + print_line("request detect 3D at "+p_path); + VS::get_singleton()->texture_set_detect_3d_callback(texture,_requested_3d,this); + } else { + print_line("not requesting detect 3D at "+p_path); + VS::get_singleton()->texture_set_detect_3d_callback(texture,NULL,NULL); + } + + if (request_srgb_callback && df&FORMAT_BIT_DETECT_SRGB) { + print_line("request detect srgb at "+p_path); + VS::get_singleton()->texture_set_detect_srgb_callback(texture,_requested_srgb,this); + } else { + VS::get_singleton()->texture_set_detect_srgb_callback(texture,NULL,NULL); + print_line("not requesting detect srgb at "+p_path); + } + if (!(df&FORMAT_BIT_STREAM)) { p_size_limit=0; } @@ -635,6 +672,7 @@ Error StreamTexture::_load_data(const String& p_path,int &tw,int &th,int& flags, { PoolVector<uint8_t>::Write w=img_data.write(); int bytes = f->get_buffer(w.ptr(),total_size - ofs); + print_line("requested read: "+itos(total_size - ofs)+" but got: "+itos(bytes)); memdelete(f); @@ -722,6 +760,12 @@ void StreamTexture::set_flags(uint32_t p_flags){ void StreamTexture::reload_from_file() { +#ifdef TOOLS_ENABLED + String ipath = get_import_path(); + if (ipath.is_resource_file() && ipath!=path_to_file) { + path_to_file=ipath; + } +#endif load(path_to_file); } diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 919c588894..f684aeb658 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -178,6 +178,8 @@ public: FORMAT_BIT_LOSSY=1<<21, FORMAT_BIT_STREAM=1<<22, FORMAT_BIT_HAS_MIPMAPS=1<<23, + FORMAT_BIT_DETECT_3D=1<<24, + FORMAT_BIT_DETECT_SRGB=1<<25, }; private: @@ -191,6 +193,9 @@ private: virtual void reload_from_file(); + static void _requested_3d(void* p_ud); + static void _requested_srgb(void* p_ud); + protected: static void _bind_methods(); @@ -198,6 +203,11 @@ protected: public: + typedef void (*TextureFormatRequestCallback)(const Ref<StreamTexture>&); + + static TextureFormatRequestCallback request_3d_callback; + static TextureFormatRequestCallback request_srgb_callback; + uint32_t get_flags() const; Image::Format get_format() const; Error load(const String& p_path); diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp index 48f70d9077..8d3fc4721a 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.cpp +++ b/servers/physics/joints/generic_6dof_joint_sw.cpp @@ -676,7 +676,7 @@ float Generic6DOFJointSW::get_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJoi } break; case PhysicsServer::G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT: { - return m_angularLimits[p_axis].m_maxLimitForce; + return m_angularLimits[p_axis].m_maxMotorForce; } break; } diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 44bc9bfef5..21f7f0769f 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -196,6 +196,8 @@ public: virtual RID texture_create_radiance_cubemap(RID p_source,int p_resolution=-1) const=0; + virtual void texture_set_detect_3d_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata)=0; + virtual void texture_set_detect_srgb_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata)=0; virtual void textures_keep_original(bool p_enable)=0; @@ -430,6 +432,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; virtual float gi_probe_get_energy(RID p_probe) const=0; + virtual void gi_probe_set_propagation(RID p_probe,float p_range)=0; + virtual float gi_probe_get_propagation(RID p_probe) const=0; + virtual void gi_probe_set_interior(RID p_probe,bool p_enable)=0; virtual bool gi_probe_is_interior(RID p_probe) const=0; @@ -512,6 +517,7 @@ public: virtual VS::InstanceType get_base_type(RID p_rid) const=0; virtual bool free(RID p_rid)=0; + virtual bool has_os_feature(const String& p_feature) const=0; static RasterizerStorage*base_signleton; RasterizerStorage(); diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 279da9149e..8f87425212 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -157,6 +157,12 @@ RID VisualServerRaster::get_test_cube() { return test_cube; } + +bool VisualServerRaster::has_os_feature(const String& p_feature) const { + + return VSG::storage->has_os_feature(p_feature); +} + VisualServerRaster::VisualServerRaster() { VSG::canvas = memnew( VisualServerCanvas); diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 5c8105681a..ad0cb664c5 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -622,7 +622,8 @@ public: BIND3(texture_set_size_override,RID,int,int) BIND2RC(RID,texture_create_radiance_cubemap,RID,int) - + BIND3(texture_set_detect_3d_callback,RID,TextureDetectCallback,void*) + BIND3(texture_set_detect_srgb_callback,RID,TextureDetectCallback,void*) BIND2(texture_set_path,RID,const String&) BIND1RC(String,texture_get_path,RID) @@ -824,6 +825,9 @@ public: BIND2(gi_probe_set_energy,RID,float) BIND1RC(float,gi_probe_get_energy,RID) + BIND2(gi_probe_set_propagation,RID,float) + BIND1RC(float,gi_probe_get_propagation,RID) + BIND2(gi_probe_set_interior,RID,bool) BIND1RC(bool,gi_probe_is_interior,RID) @@ -1135,6 +1139,8 @@ public: virtual bool has_feature(Features p_feature) const; + virtual bool has_os_feature(const String& p_feature) const; + VisualServerRaster(); ~VisualServerRaster(); diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 157a85be98..297413effd 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -2239,7 +2239,6 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform,const Came bool redraw = VSG::scene_render->shadow_atlas_update_light(p_shadow_atlas,light->instance,coverage,light->last_version); if (redraw) { - print_line("redraw shadow"); //must redraw! _light_instance_update_shadow(ins,p_cam_transform,p_cam_projection,p_cam_orthogonal,p_shadow_atlas,scenario); } @@ -2448,6 +2447,7 @@ void VisualServerScene::_setup_gi_probe(Instance *p_instance) { probe->dynamic.bake_dynamic_range=VSG::storage->gi_probe_get_dynamic_range(p_instance->base); probe->dynamic.mipmaps_3d.clear(); + probe->dynamic.propagate=VSG::storage->gi_probe_get_propagation(p_instance->base); probe->dynamic.grid_size[0]=header->width; probe->dynamic.grid_size[1]=header->height; @@ -2942,14 +2942,12 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header,con } -void VisualServerScene::_bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data) { +void VisualServerScene::_bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data,float p_propagate) { //average light to upper level - p_local_data[p_idx].energy[0]=0; - p_local_data[p_idx].energy[1]=0; - p_local_data[p_idx].energy[2]=0; - int divisor=0; + float divisor=0; + float sum[3]={0.0,0.0,0.0}; for(int i=0;i<8;i++) { @@ -2959,20 +2957,25 @@ void VisualServerScene::_bake_gi_downscale_light(int p_idx, int p_level, const G continue; if (p_level+1 < (int)p_header->cell_subdiv-1) { - _bake_gi_downscale_light(child,p_level+1,p_cells,p_header,p_local_data); + _bake_gi_downscale_light(child,p_level+1,p_cells,p_header,p_local_data,p_propagate); } - p_local_data[p_idx].energy[0]+=p_local_data[child].energy[0]; - p_local_data[p_idx].energy[1]+=p_local_data[child].energy[1]; - p_local_data[p_idx].energy[2]+=p_local_data[child].energy[2]; - divisor++; + sum[0]+=p_local_data[child].energy[0]; + sum[1]+=p_local_data[child].energy[1]; + sum[2]+=p_local_data[child].energy[2]; + divisor+=1.0; } + divisor=Math::lerp(8.0,divisor,p_propagate); + sum[0]/=divisor; + sum[1]/=divisor; + sum[2]/=divisor; + //divide by eight for average - p_local_data[p_idx].energy[0]/=divisor; - p_local_data[p_idx].energy[1]/=divisor; - p_local_data[p_idx].energy[2]/=divisor; + p_local_data[p_idx].energy[0]=Math::fast_ftoi(sum[0]); + p_local_data[p_idx].energy[1]=Math::fast_ftoi(sum[1]); + p_local_data[p_idx].energy[2]=Math::fast_ftoi(sum[2]); } @@ -3024,7 +3027,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { SWAP(probe_data->dynamic.light_cache_changes,probe_data->dynamic.light_cache); //downscale to lower res levels - _bake_gi_downscale_light(0,0,cells,header,local_data); + _bake_gi_downscale_light(0,0,cells,header,local_data,probe_data->dynamic.propagate); //plot result to 3D texture! @@ -3337,6 +3340,14 @@ void VisualServerScene::render_probes() { force_lighting=true; } + float propagate = VSG::storage->gi_probe_get_propagation(instance_probe->base); + + if (probe->dynamic.propagate!=propagate) { + probe->dynamic.propagate=propagate; + force_lighting=true; + } + + if (probe->invalid==false && probe->dynamic.enabled) { switch(probe->dynamic.updating_stage) { diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h index 1f7de3d005..f9a5dde1ac 100644 --- a/servers/visual/visual_server_scene.h +++ b/servers/visual/visual_server_scene.h @@ -445,6 +445,7 @@ public: Vector< PoolVector<CompBlockS3TC> > mipmaps_s3tc; //for s3tc int updating_stage; + float propagate; int grid_size[3]; @@ -570,7 +571,7 @@ public: void _gi_probe_fill_local_data(int p_idx,int p_level,int p_x,int p_y,int p_z,const GIProbeDataCell* p_cell,const GIProbeDataHeader *p_header,InstanceGIProbeData::LocalData *p_local_data,Vector<uint32_t> *prev_cell); _FORCE_INLINE_ uint32_t _gi_bake_find_cell(const GIProbeDataCell *cells,int x,int y, int z,int p_cell_subdiv); - void _bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data); + void _bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data, float p_propagate); void _bake_gi_probe_light(const GIProbeDataHeader *header,const GIProbeDataCell *cells,InstanceGIProbeData::LocalData *local_data,const uint32_t *leaves,int p_leaf_count, const InstanceGIProbeData::LightCache& light_cache,int p_sign); void _bake_gi_probe(Instance *p_probe); bool _check_gi_probe(Instance *p_gi_probe); diff --git a/servers/visual_server.h b/servers/visual_server.h index f75223e378..5c835c2287 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -129,6 +129,11 @@ public: virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable)=0; + typedef void (*TextureDetectCallback)(void*); + + virtual void texture_set_detect_3d_callback(RID p_texture,TextureDetectCallback p_callback,void* p_userdata)=0; + virtual void texture_set_detect_srgb_callback(RID p_texture,TextureDetectCallback p_callback,void* p_userdata)=0; + struct TextureInfo { RID texture; Size2 size; @@ -360,6 +365,7 @@ public: LIGHT_PARAM_ATTENUATION, LIGHT_PARAM_SPOT_ANGLE, LIGHT_PARAM_SPOT_ATTENUATION, + LIGHT_PARAM_CONTACT_SHADOW_SIZE, LIGHT_PARAM_SHADOW_MAX_DISTANCE, LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET, LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET, @@ -469,6 +475,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; virtual float gi_probe_get_energy(RID p_probe) const=0; + virtual void gi_probe_set_propagation(RID p_probe,float p_range)=0; + virtual float gi_probe_get_propagation(RID p_probe) const=0; + virtual void gi_probe_set_interior(RID p_probe,bool p_enable)=0; virtual bool gi_probe_is_interior(RID p_probe) const=0; @@ -938,6 +947,8 @@ public: virtual bool has_feature(Features p_feature) const=0; + virtual bool has_os_feature(const String& p_feature) const=0; + VisualServer(); virtual ~VisualServer(); diff --git a/thirdparty/README.md b/thirdparty/README.md index d0e8c05183..54930c1ebe 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -1,6 +1,13 @@ # Third party libraries +## certs + +- Upstream: ? + +TODO. + + ## enet - Upstream: http://enet.bespin.org @@ -18,6 +25,13 @@ for all platforms (especially UWP). Check the diff with the 1.3.13 tarball before the next update. +## fonts + +- Upstream: ? + +TODO. + + ## freetype - Upstream: https://www.freetype.org diff --git a/tools/certs/ca-certificates.crt b/thirdparty/certs/ca-certificates.crt index 862096d85a..862096d85a 100644 --- a/tools/certs/ca-certificates.crt +++ b/thirdparty/certs/ca-certificates.crt diff --git a/tools/editor_fonts/DroidSans.ttf b/thirdparty/fonts/DroidSans.ttf Binary files differindex 767c63ad00..767c63ad00 100644 --- a/tools/editor_fonts/DroidSans.ttf +++ b/thirdparty/fonts/DroidSans.ttf diff --git a/tools/editor_fonts/DroidSansArabic.ttf b/thirdparty/fonts/DroidSansArabic.ttf Binary files differindex 660e2a9916..660e2a9916 100644 --- a/tools/editor_fonts/DroidSansArabic.ttf +++ b/thirdparty/fonts/DroidSansArabic.ttf diff --git a/tools/editor_fonts/DroidSansFallback.ttf b/thirdparty/fonts/DroidSansFallback.ttf Binary files differindex 206621fc6c..206621fc6c 100644 --- a/tools/editor_fonts/DroidSansFallback.ttf +++ b/thirdparty/fonts/DroidSansFallback.ttf diff --git a/tools/editor_fonts/DroidSansHebrew.ttf b/thirdparty/fonts/DroidSansHebrew.ttf Binary files differindex 8d77e3e4cf..8d77e3e4cf 100644 --- a/tools/editor_fonts/DroidSansHebrew.ttf +++ b/thirdparty/fonts/DroidSansHebrew.ttf diff --git a/tools/editor_fonts/DroidSansJapanese.ttf b/thirdparty/fonts/DroidSansJapanese.ttf Binary files differindex 412fa3de05..412fa3de05 100644 --- a/tools/editor_fonts/DroidSansJapanese.ttf +++ b/thirdparty/fonts/DroidSansJapanese.ttf diff --git a/tools/editor_fonts/DroidSansThai.ttf b/thirdparty/fonts/DroidSansThai.ttf Binary files differindex f849baeff9..f849baeff9 100644 --- a/tools/editor_fonts/DroidSansThai.ttf +++ b/thirdparty/fonts/DroidSansThai.ttf diff --git a/tools/editor_fonts/LICENSE.DroidSans.txt b/thirdparty/fonts/LICENSE.DroidSans.txt index 636f1e2975..636f1e2975 100644 --- a/tools/editor_fonts/LICENSE.DroidSans.txt +++ b/thirdparty/fonts/LICENSE.DroidSans.txt diff --git a/tools/editor_fonts/LICENSE.SourceCodePro.txt b/thirdparty/fonts/LICENSE.SourceCodePro.txt index f430ee5dbe..f430ee5dbe 100644 --- a/tools/editor_fonts/LICENSE.SourceCodePro.txt +++ b/thirdparty/fonts/LICENSE.SourceCodePro.txt diff --git a/tools/editor_fonts/source_code_pro.otf b/thirdparty/fonts/source_code_pro.otf Binary files differindex 4e3b9d0bcd..4e3b9d0bcd 100644 --- a/tools/editor_fonts/source_code_pro.otf +++ b/thirdparty/fonts/source_code_pro.otf diff --git a/tools/SCsub b/tools/SCsub deleted file mode 100644 index 43cad794d4..0000000000 --- a/tools/SCsub +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env python - -Import('env') - -env.tool_sources = [] -env.add_source_files(env.tool_sources, "*.cpp") - -Export('env') - - -def make_translations_header(target, source, env): - - dst = target[0].srcnode().abspath - - g = open(dst, "wb") - - """" - """ - - g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") - g.write("#ifndef _EDITOR_TRANSLATIONS_H\n") - g.write("#define _EDITOR_TRANSLATIONS_H\n") - - import zlib - import os.path - - paths = [node.srcnode().abspath for node in source] - sorted_paths = sorted(paths, key=lambda path: os.path.splitext(os.path.basename(path))[0]) - - xl_names = [] - for i in range(len(sorted_paths)): - print("Appending translation: " + sorted_paths[i]) - f = open(sorted_paths[i], "rb") - buf = f.read() - decomp_size = len(buf) - buf = zlib.compress(buf) - name = os.path.splitext(os.path.basename(sorted_paths[i]))[0] - - #g.write("static const int _translation_"+name+"_compressed_size="+str(len(buf))+";\n") - #g.write("static const int _translation_"+name+"_uncompressed_size="+str(decomp_size)+";\n") - g.write("static const unsigned char _translation_" + name + "_compressed[]={\n") - for i in range(len(buf)): - g.write(str(ord(buf[i])) + ",\n") - - g.write("};\n") - - xl_names.append([name, len(buf), str(decomp_size)]) - - g.write("struct EditorTranslationList {\n") - g.write("\tconst char* lang;\n") - g.write("\tint comp_size;\n") - g.write("\tint uncomp_size;\n") - g.write("\tconst unsigned char* data;\n") - g.write("};\n\n") - g.write("static EditorTranslationList _editor_translations[]={\n") - for x in xl_names: - g.write("\t{ \"" + x[0] + "\", " + str(x[1]) + ", " + str(x[2]) + ",_translation_" + x[0] + "_compressed},\n") - g.write("\t{NULL,0,0,NULL}\n") - g.write("};\n") - - g.write("#endif") - - -def make_fonts_header(target, source, env): - - dst = target[0].srcnode().abspath - - g = open(dst, "wb") - - """" - """ - - g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") - g.write("#ifndef _EDITOR_FONTS_H\n") - g.write("#define _EDITOR_FONTS_H\n") - - # saving uncompressed, since freetype will reference from memory pointer - xl_names = [] - for i in range(len(source)): - print("Appending font: " + source[i].srcnode().abspath) - f = open(source[i].srcnode().abspath, "rb") - buf = f.read() - import os.path - - name = os.path.splitext(os.path.basename(source[i].srcnode().abspath))[0] - - g.write("static const int _font_" + name + "_size=" + str(len(buf)) + ";\n") - g.write("static const unsigned char _font_" + name + "[]={\n") - for i in range(len(buf)): - g.write(str(ord(buf[i])) + ",\n") - - g.write("};\n") - - g.write("#endif") - - -if (env["tools"] != "no"): - - import glob - - dir = env.Dir('.').abspath - tlist = glob.glob(dir + "/translations/*.po") - - print("translations: ", tlist) - env.Depends('#tools/editor/translations.h', tlist) - env.Command('#tools/editor/translations.h', tlist, make_translations_header) - - flist = glob.glob(dir + "/editor_fonts/*.ttf") - flist.append(glob.glob(dir + "/editor_fonts/*.otf")) - - print("fonts: ", flist) - env.Depends('#tools/editor/builtin_fonts.h', flist) - env.Command('#tools/editor/builtin_fonts.h', flist, make_fonts_header) - - SConscript('editor/SCsub') - SConscript('collada/SCsub') - SConscript('doc/SCsub') - - lib = env.Library("tool", env.tool_sources) - - env.Prepend(LIBS=[lib]) diff --git a/tools/editor/SCsub b/tools/editor/SCsub index a0e6802348..710dac3ea7 100644 --- a/tools/editor/SCsub +++ b/tools/editor/SCsub @@ -1,9 +1,10 @@ #!/usr/bin/env python Import('env') +env.editor_sources = [] -def make_doc_header(target, source, env): +def make_certs_header(target, source, env): src = source[0].srcnode().abspath dst = target[0].srcnode().abspath @@ -15,18 +16,18 @@ def make_doc_header(target, source, env): buf = zlib.compress(buf) g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") - g.write("#ifndef _DOC_DATA_RAW_H\n") - g.write("#define _DOC_DATA_RAW_H\n") - g.write("static const int _doc_data_compressed_size=" + str(len(buf)) + ";\n") - g.write("static const int _doc_data_uncompressed_size=" + str(decomp_size) + ";\n") - g.write("static const unsigned char _doc_data_compressed[]={\n") + g.write("#ifndef _CERTS_RAW_H\n") + g.write("#define _CERTS_RAW_H\n") + g.write("static const int _certs_compressed_size=" + str(len(buf)) + ";\n") + g.write("static const int _certs_uncompressed_size=" + str(decomp_size) + ";\n") + g.write("static const unsigned char _certs_compressed[]={\n") for i in range(len(buf)): g.write(str(ord(buf[i])) + ",\n") g.write("};\n") g.write("#endif") -def make_certs_header(target, source, env): +def make_doc_header(target, source, env): src = source[0].srcnode().abspath dst = target[0].srcnode().abspath @@ -38,23 +39,104 @@ def make_certs_header(target, source, env): buf = zlib.compress(buf) g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") - g.write("#ifndef _CERTS_RAW_H\n") - g.write("#define _CERTS_RAW_H\n") - g.write("static const int _certs_compressed_size=" + str(len(buf)) + ";\n") - g.write("static const int _certs_uncompressed_size=" + str(decomp_size) + ";\n") - g.write("static const unsigned char _certs_compressed[]={\n") + g.write("#ifndef _DOC_DATA_RAW_H\n") + g.write("#define _DOC_DATA_RAW_H\n") + g.write("static const int _doc_data_compressed_size=" + str(len(buf)) + ";\n") + g.write("static const int _doc_data_uncompressed_size=" + str(decomp_size) + ";\n") + g.write("static const unsigned char _doc_data_compressed[]={\n") for i in range(len(buf)): g.write(str(ord(buf[i])) + ",\n") g.write("};\n") g.write("#endif") +def make_fonts_header(target, source, env): + + dst = target[0].srcnode().abspath + + g = open(dst, "wb") + + g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") + g.write("#ifndef _EDITOR_FONTS_H\n") + g.write("#define _EDITOR_FONTS_H\n") + + # saving uncompressed, since freetype will reference from memory pointer + xl_names = [] + for i in range(len(source)): + print("Appending font: " + source[i].srcnode().abspath) + f = open(source[i].srcnode().abspath, "rb") + buf = f.read() + import os.path + + name = os.path.splitext(os.path.basename(source[i].srcnode().abspath))[0] + + g.write("static const int _font_" + name + "_size=" + str(len(buf)) + ";\n") + g.write("static const unsigned char _font_" + name + "[]={\n") + for i in range(len(buf)): + g.write(str(ord(buf[i])) + ",\n") + + g.write("};\n") + + g.write("#endif") + + +def make_translations_header(target, source, env): + + dst = target[0].srcnode().abspath + + g = open(dst, "wb") + + g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") + g.write("#ifndef _EDITOR_TRANSLATIONS_H\n") + g.write("#define _EDITOR_TRANSLATIONS_H\n") + + import zlib + import os.path + + paths = [node.srcnode().abspath for node in source] + sorted_paths = sorted(paths, key=lambda path: os.path.splitext(os.path.basename(path))[0]) + + xl_names = [] + for i in range(len(sorted_paths)): + print("Appending translation: " + sorted_paths[i]) + f = open(sorted_paths[i], "rb") + buf = f.read() + decomp_size = len(buf) + buf = zlib.compress(buf) + name = os.path.splitext(os.path.basename(sorted_paths[i]))[0] + + #g.write("static const int _translation_"+name+"_compressed_size="+str(len(buf))+";\n") + #g.write("static const int _translation_"+name+"_uncompressed_size="+str(decomp_size)+";\n") + g.write("static const unsigned char _translation_" + name + "_compressed[]={\n") + for i in range(len(buf)): + g.write(str(ord(buf[i])) + ",\n") + + g.write("};\n") + + xl_names.append([name, len(buf), str(decomp_size)]) + + g.write("struct EditorTranslationList {\n") + g.write("\tconst char* lang;\n") + g.write("\tint comp_size;\n") + g.write("\tint uncomp_size;\n") + g.write("\tconst unsigned char* data;\n") + g.write("};\n\n") + g.write("static EditorTranslationList _editor_translations[]={\n") + for x in xl_names: + g.write("\t{ \"" + x[0] + "\", " + str(x[1]) + ", " + str(x[2]) + ",_translation_" + x[0] + "_compressed},\n") + g.write("\t{NULL,0,0,NULL}\n") + g.write("};\n") + + g.write("#endif") + + if (env["tools"] == "yes"): + # Register exporters reg_exporters_inc = '#include "register_exporters.h"\n' reg_exporters = 'void register_exporters() {\n' for e in env.platform_exporters: - env.tool_sources.append("#platform/" + e + "/export/export.cpp") + env.editor_sources.append("#platform/" + e + "/export/export.cpp") reg_exporters += '\t//register_' + e + '_exporter();\n' reg_exporters_inc += '#include "platform/' + e + '/export/export.h"\n' reg_exporters += '}\n' @@ -63,19 +145,42 @@ if (env["tools"] == "yes"): f.write(reg_exporters) f.close() + # API documentation env.Depends("#tools/editor/doc_data_compressed.h", "#doc/base/classes.xml") env.Command("#tools/editor/doc_data_compressed.h", "#doc/base/classes.xml", make_doc_header) - env.Depends("#tools/editor/certs_compressed.h", "#tools/certs/ca-certificates.crt") - env.Command("#tools/editor/certs_compressed.h", "#tools/certs/ca-certificates.crt", make_certs_header) + # Certificates + env.Depends("#tools/editor/certs_compressed.h", "#thirdparty/certs/ca-certificates.crt") + env.Command("#tools/editor/certs_compressed.h", "#thirdparty/certs/ca-certificates.crt", make_certs_header) - # make_doc_header(env.File("#tools/editor/doc_data_raw.h").srcnode().abspath,env.File("#doc/base/classes.xml").srcnode().abspath,env) + import glob + path = env.Dir('.').abspath - env.add_source_files(env.tool_sources, "*.cpp") + # Translations + tlist = glob.glob(path + "/translations/*.po") + print("translations: ", tlist) + env.Depends('#tools/editor/translations.h', tlist) + env.Command('#tools/editor/translations.h', tlist, make_translations_header) - Export('env') - SConscript('icons/SCsub') - SConscript('plugins/SCsub') + # Fonts + flist = glob.glob(path + "/../../thirdparty/fonts/*.ttf") + flist.append(glob.glob(path + "/../../thirdparty/fonts/*.otf")) + print("fonts: ", flist) + env.Depends('#tools/editor/builtin_fonts.h', flist) + env.Command('#tools/editor/builtin_fonts.h', flist, make_fonts_header) + + + env.add_source_files(env.editor_sources, "*.cpp") + + SConscript('collada/SCsub') + SConscript('doc/SCsub') SConscript('fileserver/SCsub') - SConscript('io_plugins/SCsub') + SConscript('icons/SCsub') SConscript('import/SCsub') + SConscript('io_plugins/SCsub') + SConscript('plugins/SCsub') + + lib = env.Library("editor", env.editor_sources) + env.Prepend(LIBS=[lib]) + + Export('env') diff --git a/tools/doc/SCsub b/tools/editor/collada/SCsub index 4bc64ffdc2..04c9a827ef 100644 --- a/tools/doc/SCsub +++ b/tools/editor/collada/SCsub @@ -2,6 +2,6 @@ Import('env') -env.add_source_files(env.tool_sources, "*.cpp") +env.add_source_files(env.editor_sources, "*.cpp") Export('env') diff --git a/tools/collada/collada.cpp b/tools/editor/collada/collada.cpp index a23fd84aa0..a23fd84aa0 100644 --- a/tools/collada/collada.cpp +++ b/tools/editor/collada/collada.cpp diff --git a/tools/collada/collada.h b/tools/editor/collada/collada.h index fd7ad4920d..fd7ad4920d 100644 --- a/tools/collada/collada.h +++ b/tools/editor/collada/collada.h diff --git a/tools/collada/SCsub b/tools/editor/doc/SCsub index 4bc64ffdc2..04c9a827ef 100644 --- a/tools/collada/SCsub +++ b/tools/editor/doc/SCsub @@ -2,6 +2,6 @@ Import('env') -env.add_source_files(env.tool_sources, "*.cpp") +env.add_source_files(env.editor_sources, "*.cpp") Export('env') diff --git a/tools/doc/doc_data.cpp b/tools/editor/doc/doc_data.cpp index d51dc886b2..d51dc886b2 100644 --- a/tools/doc/doc_data.cpp +++ b/tools/editor/doc/doc_data.cpp diff --git a/tools/doc/doc_data.h b/tools/editor/doc/doc_data.h index fead1da510..fead1da510 100644 --- a/tools/doc/doc_data.h +++ b/tools/editor/doc/doc_data.h diff --git a/tools/doc/doc_dump.cpp b/tools/editor/doc/doc_dump.cpp index 5ebba596e9..5ebba596e9 100644 --- a/tools/doc/doc_dump.cpp +++ b/tools/editor/doc/doc_dump.cpp diff --git a/tools/doc/doc_dump.h b/tools/editor/doc/doc_dump.h index 84629b89c8..84629b89c8 100644 --- a/tools/doc/doc_dump.h +++ b/tools/editor/doc/doc_dump.h diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp index 077910de33..c7b50a3c09 100644 --- a/tools/editor/editor_file_system.cpp +++ b/tools/editor/editor_file_system.cpp @@ -1028,7 +1028,7 @@ void EditorFileSystem::_notification(int p_what) { bool EditorFileSystem::is_scanning() const { - return scanning; + return scanning || scanning_changes; } float EditorFileSystem::get_scanning_progress() const { @@ -1393,6 +1393,7 @@ void EditorFileSystem::_reimport_file(const String& p_file) { f->store_line("type=\""+importer->get_resource_type()+"\""); } + if (importer->get_save_extension()=="") { //no path } else if (import_variants.size()) { @@ -1400,7 +1401,10 @@ void EditorFileSystem::_reimport_file(const String& p_file) { for(List<String>::Element *E=import_variants.front();E;E=E->next()) { - f->store_line("path."+E->get()+"=\""+base_path.c_escape()+"."+E->get()+"."+importer->get_save_extension()+"\""); + String path = base_path.c_escape()+"."+E->get()+"."+importer->get_save_extension(); + + f->store_line("path."+E->get()+"=\""+path+"\""); + } } else { @@ -1426,6 +1430,8 @@ void EditorFileSystem::_reimport_file(const String& p_file) { f->store_line(""); //store options in provided order, to avoid file changing + + for (List<ResourceImporter::ImportOption>::Element *E=opts.front();E;E=E->next()) { String base = E->get().option.name; @@ -1442,11 +1448,25 @@ void EditorFileSystem::_reimport_file(const String& p_file) { //update modified times, to avoid reimport fs->files[cpos]->modified_time = FileAccess::get_modified_time(p_file); fs->files[cpos]->import_modified_time = FileAccess::get_modified_time(p_file+".import"); + + //if file is currently up, maybe the source it was loaded from changed, so import math must be updated for it + //to reload properly + if (ResourceCache::has(p_file)) { + + Resource *r = ResourceCache::get(p_file); + + if (r->get_import_path()!=String()) { + + String dst_path = ResourceFormatImporter::get_singleton()->get_internal_resource_path(p_file); + r->set_import_path(dst_path); + r->set_import_last_modified_time(0); + } + } } void EditorFileSystem::reimport_files(const Vector<String>& p_files) { - + importing=true; EditorProgress pr("reimport",TTR("(Re)Importing Assets"),p_files.size()); for(int i=0;i<p_files.size();i++) { pr.step(p_files[i].get_file(),i); @@ -1455,6 +1475,10 @@ void EditorFileSystem::reimport_files(const Vector<String>& p_files) { } _save_filesystem_cache(); + importing=false; + if (!is_scanning()) { + emit_signal("filesystem_changed"); + } } void EditorFileSystem::_bind_methods() { @@ -1503,6 +1527,7 @@ EditorFileSystem::EditorFileSystem() { thread = NULL; scanning=false; + importing=false; use_threads=true; thread_sources=NULL; new_filesystem=NULL; diff --git a/tools/editor/editor_file_system.h b/tools/editor/editor_file_system.h index 92169907a4..10d9b919fc 100644 --- a/tools/editor/editor_file_system.h +++ b/tools/editor/editor_file_system.h @@ -133,6 +133,7 @@ class EditorFileSystem : public Node { bool abort_scan; bool scanning; + bool importing; float scan_total; @@ -210,6 +211,7 @@ public: EditorFileSystemDirectory *get_filesystem(); bool is_scanning() const; + bool is_importing() const { return importing; } float get_scanning_progress() const; void scan(); void scan_changes(); diff --git a/tools/editor/editor_help.h b/tools/editor/editor_help.h index 85bac27705..3c4ba1f43e 100644 --- a/tools/editor/editor_help.h +++ b/tools/editor/editor_help.h @@ -40,7 +40,7 @@ #include "scene/main/timer.h" #include "tools/editor/code_editor.h" -#include "tools/doc/doc_data.h" +#include "tools/editor/doc/doc_data.h" class EditorNode; diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index a31d62372c..c70fbf05a0 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -308,6 +308,8 @@ void EditorNode::_notification(int p_what) { } + ResourceImporterTexture::get_singleton()->update_imports(); + } if (p_what==NOTIFICATION_ENTER_TREE) { @@ -411,8 +413,10 @@ void EditorNode::_fs_changed() { if (E->get()->get_import_path()!=String()) { //imported resource uint64_t mt = FileAccess::get_modified_time(E->get()->get_import_path()); + print_line("testing modified: "+E->get()->get_import_path()+" "+itos(mt)+" vs "+itos(E->get()->get_import_last_modified_time())); if (mt!=E->get()->get_import_last_modified_time()) { + print_line("success"); changed.push_back(E->get()); } diff --git a/tools/editor/fileserver/SCsub b/tools/editor/fileserver/SCsub index 4bf55189cc..f1fa50148f 100644 --- a/tools/editor/fileserver/SCsub +++ b/tools/editor/fileserver/SCsub @@ -2,4 +2,4 @@ Import('env') Export('env') -env.add_source_files(env.tool_sources, "*.cpp") +env.add_source_files(env.editor_sources, "*.cpp") diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub index f86ae2b10d..4af481d1f6 100644 --- a/tools/editor/icons/SCsub +++ b/tools/editor/icons/SCsub @@ -92,5 +92,5 @@ make_editor_icons_builder = Builder(action=make_editor_icons_action, env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#tools/editor/editor_icons.cpp', Glob("*.png"))]) -env.tool_sources.append("#tools/editor/editor_icons.cpp") +env.editor_sources.append("#tools/editor/editor_icons.cpp") Export('env') diff --git a/tools/editor/import/SCsub b/tools/editor/import/SCsub index 4bf55189cc..f1fa50148f 100644 --- a/tools/editor/import/SCsub +++ b/tools/editor/import/SCsub @@ -2,4 +2,4 @@ Import('env') Export('env') -env.add_source_files(env.tool_sources, "*.cpp") +env.add_source_files(env.editor_sources, "*.cpp") diff --git a/tools/editor/import/editor_import_collada.cpp b/tools/editor/import/editor_import_collada.cpp index 19608b4e94..a901de1faf 100644 --- a/tools/editor/import/editor_import_collada.cpp +++ b/tools/editor/import/editor_import_collada.cpp @@ -29,7 +29,6 @@ #include "editor_import_collada.h" -#include "collada/collada.h" #include "scene/3d/spatial.h" #include "scene/3d/skeleton.h" #include "scene/3d/path.h" @@ -40,6 +39,7 @@ #include "scene/resources/animation.h" #include "scene/resources/packed_scene.h" #include "os/os.h" +#include "tools/editor/collada/collada.h" #include "tools/editor/editor_node.h" #include <iostream> @@ -430,9 +430,10 @@ Error ColladaImport::_create_material(const String& p_target) { } } else { - //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,effect.specular.color); + material->set_metalness(effect.specular.color.get_v()); } + // EMISSION if (effect.emission.texture!="") { @@ -443,17 +444,21 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { + material->set_feature(FixedSpatialMaterial::FEATURE_EMISSION,true); material->set_texture(FixedSpatialMaterial::TEXTURE_EMISSION,texture); material->set_emission(Color(1,1,1,1)); //material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,Color(1,1,1,1)); }else { - //missing_textures.push_back(texfile.get_file()); + missing_textures.push_back(texfile.get_file()); } } } else { - //material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,effect.emission.color); + if (effect.emission.color!=Color()) { + material->set_feature(FixedSpatialMaterial::FEATURE_EMISSION,true); + material->set_emission(effect.emission.color); + } } // NORMAL @@ -465,6 +470,7 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { + material->set_feature(FixedSpatialMaterial::FEATURE_NORMAL_MAPPING,true); material->set_texture(FixedSpatialMaterial::TEXTURE_NORMAL,texture); //material->set_emission(Color(1,1,1,1)); @@ -477,7 +483,9 @@ Error ColladaImport::_create_material(const String& p_target) { } - //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,effect.shininess); + float roughness = Math::sqrt(1.0-((Math::log(effect.shininess)/Math::log(2.0))/8.0)); //not very right.. + material->set_roughness(roughness); + if (effect.double_sided) { material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); } diff --git a/tools/editor/import/resource_importer_texture.cpp b/tools/editor/import/resource_importer_texture.cpp index 3cbe034e4d..21e434fa11 100644 --- a/tools/editor/import/resource_importer_texture.cpp +++ b/tools/editor/import/resource_importer_texture.cpp @@ -1,6 +1,106 @@ #include "resource_importer_texture.h" #include "io/image_loader.h" #include "scene/resources/texture.h" +#include "tools/editor/editor_file_system.h" +#include "io/config_file.h" + + +void ResourceImporterTexture::_texture_reimport_srgb(const Ref<StreamTexture>& p_tex) { + + singleton->mutex->lock(); + StringName path = p_tex->get_path(); + + if (!singleton->make_flags.has(path)) { + singleton->make_flags[path]=0; + } + + singleton->make_flags[path]|=MAKE_SRGB_FLAG; + + print_line("requesting srgb for "+String(path)); + + singleton->mutex->unlock(); + +} + + + +void ResourceImporterTexture::_texture_reimport_3d(const Ref<StreamTexture>& p_tex) { + + + singleton->mutex->lock(); + StringName path = p_tex->get_path(); + + if (!singleton->make_flags.has(path)) { + singleton->make_flags[path]=0; + } + + singleton->make_flags[path]|=MAKE_3D_FLAG; + + print_line("requesting 3d for "+String(path)); + + singleton->mutex->unlock(); + + +} + +void ResourceImporterTexture::update_imports() { + + if (EditorFileSystem::get_singleton()->is_scanning() || EditorFileSystem::get_singleton()->is_importing()) { + return; // do nothing for noe + } + mutex->lock(); + + if (make_flags.empty()) { + mutex->unlock(); + return; + } + + Vector<String> to_reimport; + for (Map<StringName,int>::Element *E=make_flags.front();E;E=E->next()) { + + print_line("checking for reimport "+String(E->key())); + + + Ref<ConfigFile> cf; + cf.instance(); + String src_path = String(E->key())+".import"; + + Error err = cf->load(src_path); + ERR_CONTINUE(err!=OK); + + bool changed=false; + if (E->get()&MAKE_SRGB_FLAG && int(cf->get_value("params","flags/srgb"))==2) { + cf->set_value("params","flags/srgb",1); + changed=true; + } + + if (E->get()&MAKE_3D_FLAG && bool(cf->get_value("params","detect_3d"))) { + cf->set_value("params","detect_3d",false); + cf->set_value("params","compress/mode",2); + cf->set_value("params","flags/repeat",true); + cf->set_value("params","flags/filter",true); + cf->set_value("params","flags/mipmaps",true); + changed=true; + } + + if (changed) { + cf->save(src_path); + to_reimport.push_back(E->key()); + } + + } + + make_flags.clear(); + + mutex->unlock(); + + if (to_reimport.size()) { + EditorFileSystem::get_singleton()->reimport_files(to_reimport); + } + +} + + String ResourceImporterTexture::get_importer_name() const { @@ -57,7 +157,7 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options,i r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"flags/filter"),p_preset==PRESET_2D_PIXEL?false:true)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"flags/mipmaps"),p_preset==PRESET_3D?true:false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"flags/anisotropic"),false)); - r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"flags/srgb",PROPERTY_HINT_ENUM,"Disable,Enable,Detect"),2)); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"flags/srgb",PROPERTY_HINT_ENUM,"Disable,Enable,Detect"),2)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"process/fix_alpha_border"),p_preset!=PRESET_3D?true:false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"process/premult_alpha"),true)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"stream"),false)); @@ -67,7 +167,7 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options,i } -void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to_path,int p_compress_mode,float p_lossy_quality,Image::CompressMode p_vram_compression,bool p_mipmaps,int p_texture_flags,bool p_streamable) { +void ResourceImporterTexture::_save_stex(const Image& p_image, const String& p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable, bool p_detect_3d, bool p_detect_srgb) { FileAccess *f = FileAccess::open(p_to_path,FileAccess::WRITE); @@ -86,6 +186,11 @@ void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to format|=StreamTexture::FORMAT_BIT_STREAM; if (p_mipmaps || p_compress_mode==COMPRESS_VIDEO_RAM) //VRAM always uses mipmaps format|=StreamTexture::FORMAT_BIT_HAS_MIPMAPS; //mipmaps bit + if (p_detect_3d) + format|=StreamTexture::FORMAT_BIT_DETECT_3D; + if (p_detect_srgb) + format|=StreamTexture::FORMAT_BIT_DETECT_SRGB; + switch (p_compress_mode) { case COMPRESS_LOSSLESS: { @@ -99,7 +204,7 @@ void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to int mmc = image.get_mipmap_count() + 1; - format=StreamTexture::FORMAT_BIT_LOSSLESS; + format|=StreamTexture::FORMAT_BIT_LOSSLESS; f->store_32(format); f->store_32(mmc); @@ -130,7 +235,7 @@ void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to int mmc = image.get_mipmap_count() + 1; - format=StreamTexture::FORMAT_BIT_LOSSY; + format|=StreamTexture::FORMAT_BIT_LOSSY; f->store_32(format); f->store_32(mmc); @@ -162,7 +267,6 @@ void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to PoolVector<uint8_t> data=image.get_data(); int dl = data.size(); PoolVector<uint8_t>::Read r = data.read(); - f->store_buffer(r.ptr(),dl); } break; @@ -198,7 +302,7 @@ Error ResourceImporterTexture::import(const String& p_source_file, const String& bool filter= p_options["flags/filter"]; bool mipmaps= p_options["flags/mipmaps"]; bool anisotropic= p_options["flags/anisotropic"]; - bool srgb= p_options["flags/srgb"]; + int srgb= p_options["flags/srgb"]; bool fix_alpha_border= p_options["process/fix_alpha_border"]; bool premult_alpha= p_options["process/premult_alpha"]; bool stream = p_options["stream"]; @@ -222,7 +326,7 @@ Error ResourceImporterTexture::import(const String& p_source_file, const String& tex_flags|=Texture::FLAG_MIPMAPS; if (anisotropic) tex_flags|=Texture::FLAG_ANISOTROPIC_FILTER; - if (srgb) + if (srgb==1) tex_flags|=Texture::FLAG_CONVERT_TO_LINEAR; if (size_limit >0 && (image.get_width()>size_limit || image.get_height()>size_limit )) { @@ -249,26 +353,41 @@ Error ResourceImporterTexture::import(const String& p_source_file, const String& image.premultiply_alpha(); } + bool detect_3d = p_options["detect_3d"]; + bool detect_srgb = srgb==2; if (compress_mode==COMPRESS_VIDEO_RAM) { //must import in all formats //Android, GLES 2.x - _save_stex(image,p_save_path+".etc.stex",compress_mode,lossy,Image::COMPRESS_ETC,mipmaps,tex_flags,stream); + _save_stex(image,p_save_path+".etc.stex",compress_mode,lossy,Image::COMPRESS_ETC,mipmaps,tex_flags,stream,detect_3d,detect_srgb); r_platform_variants->push_back("etc"); //_save_stex(image,p_save_path+".etc2.stex",compress_mode,lossy,Image::COMPRESS_ETC2,mipmaps,tex_flags,stream); //r_platform_variants->push_back("etc2"); - _save_stex(image,p_save_path+".s3tc.stex",compress_mode,lossy,Image::COMPRESS_S3TC,mipmaps,tex_flags,stream); + _save_stex(image,p_save_path+".s3tc.stex",compress_mode,lossy,Image::COMPRESS_S3TC,mipmaps,tex_flags,stream,detect_3d,detect_srgb); r_platform_variants->push_back("s3tc"); } else { //import normally - _save_stex(image,p_save_path+".stex",compress_mode,lossy,Image::COMPRESS_16BIT /*this is ignored */,mipmaps,tex_flags,stream); + _save_stex(image,p_save_path+".stex",compress_mode,lossy,Image::COMPRESS_16BIT /*this is ignored */,mipmaps,tex_flags,stream,detect_3d,detect_srgb); } return OK; } +ResourceImporterTexture *ResourceImporterTexture::singleton=NULL; + ResourceImporterTexture::ResourceImporterTexture() { + singleton=this; + StreamTexture::request_3d_callback=_texture_reimport_3d; + StreamTexture::request_srgb_callback=_texture_reimport_srgb; + mutex = Mutex::create(); } + +ResourceImporterTexture::~ResourceImporterTexture() +{ + + memdelete(mutex); +} + diff --git a/tools/editor/import/resource_importer_texture.h b/tools/editor/import/resource_importer_texture.h index 84f7b77838..4c795e132c 100644 --- a/tools/editor/import/resource_importer_texture.h +++ b/tools/editor/import/resource_importer_texture.h @@ -2,10 +2,33 @@ #define RESOURCEIMPORTTEXTURE_H #include "io/resource_import.h" +class StreamTexture; class ResourceImporterTexture : public ResourceImporter { GDCLASS(ResourceImporterTexture,ResourceImporter) + + + +protected: + + enum { + MAKE_3D_FLAG=1, + MAKE_SRGB_FLAG=2 + }; + + Mutex *mutex; + Map<StringName,int> make_flags; + + static void _texture_reimport_srgb(const Ref<StreamTexture>& p_tex); + static void _texture_reimport_3d(const Ref<StreamTexture>& p_tex); + + + + + static ResourceImporterTexture *singleton; public: + + static ResourceImporterTexture *get_singleton() { return singleton; } virtual String get_importer_name() const; virtual String get_visible_name() const; virtual void get_recognized_extensions(List<String> *p_extensions) const; @@ -33,11 +56,15 @@ public: virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; - void _save_stex(const Image& p_image, const String& p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable); + void _save_stex(const Image& p_image, const String& p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable,bool p_detect_3d,bool p_detect_srgb); virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); + + void update_imports(); + ResourceImporterTexture(); + ~ResourceImporterTexture(); }; #endif // RESOURCEIMPORTTEXTURE_H diff --git a/tools/editor/io_plugins/SCsub b/tools/editor/io_plugins/SCsub index 4bf55189cc..f1fa50148f 100644 --- a/tools/editor/io_plugins/SCsub +++ b/tools/editor/io_plugins/SCsub @@ -2,4 +2,4 @@ Import('env') Export('env') -env.add_source_files(env.tool_sources, "*.cpp") +env.add_source_files(env.editor_sources, "*.cpp") diff --git a/tools/editor/plugins/SCsub b/tools/editor/plugins/SCsub index 4bf55189cc..f1fa50148f 100644 --- a/tools/editor/plugins/SCsub +++ b/tools/editor/plugins/SCsub @@ -2,4 +2,4 @@ Import('env') Export('env') -env.add_source_files(env.tool_sources, "*.cpp") +env.add_source_files(env.editor_sources, "*.cpp") diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 4738b348f4..5f97fce4e7 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -1334,6 +1334,7 @@ void ScriptEditor::_find_scripts(Node* p_base, Node* p_current, Set<Ref<Script> struct _ScriptEditorItemData { String name; + String sort_key; Ref<Texture> icon; int index; String tooltip; @@ -1343,7 +1344,7 @@ struct _ScriptEditorItemData { bool operator<(const _ScriptEditorItemData& id) const { - return category==id.category?name.nocasecmp_to(id.name)<0:category<id.category; + return category==id.category?sort_key<id.sort_key:category<id.category; } }; @@ -1404,6 +1405,8 @@ void ScriptEditor::_update_script_names() { script_list->clear(); bool split_script_help = EditorSettings::get_singleton()->get("text_editor/open_scripts/group_help_pages"); + ScriptSortBy sort_by = (ScriptSortBy) (int) EditorSettings::get_singleton()->get("text_editor/open_scripts/sort_scripts_by"); + ScriptListName display_as = (ScriptListName) (int) EditorSettings::get_singleton()->get("text_editor/open_scripts/list_script_names_as"); Vector<_ScriptEditorItemData> sedata; @@ -1415,15 +1418,41 @@ void ScriptEditor::_update_script_names() { String name = se->get_name(); Ref<Texture> icon = se->get_icon(); - String tooltip = se->get_edited_script()->get_path(); + String path = se->get_edited_script()->get_path(); _ScriptEditorItemData sd; sd.icon=icon; sd.name=name; - sd.tooltip=tooltip; + sd.tooltip=path; sd.index=i; sd.used=used.has(se->get_edited_script()); sd.category=0; + + switch (sort_by) { + case SORT_BY_NAME: { + sd.sort_key=name.to_lower(); + } break; + case SORT_BY_PATH: { + sd.sort_key=path; + } break; + } + + switch (display_as) { + case DISPLAY_NAME: { + sd.name=name; + } break; + case DISPLAY_DIR_AND_NAME: { + if (!path.get_base_dir().get_file().empty()) { + sd.name=path.get_base_dir().get_file() + "/" + name; + } else { + sd.name=name; + } + } break; + case DISPLAY_FULL_PATH: { + sd.name=path; + } break; + } + sedata.push_back(sd); } @@ -1438,6 +1467,7 @@ void ScriptEditor::_update_script_names() { _ScriptEditorItemData sd; sd.icon=icon; sd.name=name; + sd.sort_key=name; sd.tooltip=tooltip; sd.index=i; sd.used=false; @@ -1727,6 +1757,7 @@ void ScriptEditor::_editor_settings_changed() { se->update_settings(); } _update_script_colors(); + _update_script_names(); ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/files/auto_reload_and_parse_scripts_on_save",true)); @@ -2440,9 +2471,13 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { EDITOR_DEF("text_editor/open_scripts/script_temperature_cold_color",Color(0,0,1,0.3)); EDITOR_DEF("text_editor/open_scripts/current_script_background_color",Color(0.81,0.81,0.14,0.63)); EDITOR_DEF("text_editor/open_scripts/group_help_pages",true); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT,"text_editor/open_scripts/sort_scripts_by",PROPERTY_HINT_ENUM,"Name,Path")); + EDITOR_DEF("text_editor/open_scripts/sort_scripts_by",0); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT,"text_editor/open_scripts/list_script_names_as",PROPERTY_HINT_ENUM,"Name,Parent Directory And Name,Full Path")); + EDITOR_DEF("text_editor/open_scripts/list_script_names_as",0); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"text_editor/external/exec_path",PROPERTY_HINT_GLOBAL_FILE)); EDITOR_DEF("text_editor/external/exec_flags",""); - + } diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h index 887c2f7d68..75099fc5ec 100644 --- a/tools/editor/plugins/script_editor_plugin.h +++ b/tools/editor/plugins/script_editor_plugin.h @@ -154,6 +154,17 @@ class ScriptEditor : public VBoxContainer { WINDOW_PREV, WINDOW_SELECT_BASE=100 }; + + enum ScriptSortBy { + SORT_BY_NAME, + SORT_BY_PATH, + }; + + enum ScriptListName { + DISPLAY_NAME, + DISPLAY_DIR_AND_NAME, + DISPLAY_FULL_PATH, + }; HBoxContainer *menu_hb; MenuButton *file_menu; diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 9f8367ff1d..3ba1a2cbdc 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -277,12 +277,10 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() ); Set<Ref<SpatialEditorGizmo> > found_gizmos; - //uint32_t closest=0; - //float closest_dist=0; - - r_includes_current=false; - - List<_RayResult> results; + ObjectID closest=0; + Spatial *item=NULL; + float closest_dist=1e20; + int selected_handle=-1; for (int i=0;i<instances.size();i++) { @@ -318,84 +316,30 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b if (dist<0) continue; + if (dist < closest_dist) { + closest=instances[i]; + closest_dist=dist; + selected_handle=handle; + item=spat; + } + // if (editor_selection->is_selected(spat)) + // r_includes_current=true; - if (editor_selection->is_selected(spat)) - r_includes_current=true; - - _RayResult res; - res.item=spat; - res.depth=dist; - res.handle=handle; - results.push_back(res); } - if (results.empty()) + if (!item) return 0; - results.sort(); - Spatial *s=NULL; - + if (!editor_selection->is_selected(item) || (r_gizmo_handle && selected_handle>=0)) { - if (!r_includes_current || results.size()==1 || (r_gizmo_handle && results.front()->get().handle>=0)) { - - //return the nearest one - s = results.front()->get().item; if (r_gizmo_handle) - *r_gizmo_handle=results.front()->get().handle; - - } else { - - //returns the next one from a curent selection - List<_RayResult>::Element *E=results.front(); - List<_RayResult>::Element *S=NULL; - + *r_gizmo_handle=selected_handle; - while(true) { - - //very strange loop algorithm that complies with object selection standards (tm). - - if (S==E) { - //went all around and anothing was found - //since can't rotate the selection - //just return the first one - - s=results.front()->get().item; - break; - - } - - if (!S && editor_selection->is_selected(E->get().item)) { - //found an item currently in the selection, - //so start from this one - S=E; - } - - if (S && !editor_selection->is_selected(E->get().item)) { - // free item after a selected item, this one is desired. - s=E->get().item; - break; - } - - E=E->next(); - if (!E) { - - if (!S) { - //did a loop but nothing was selected, select first - s=results.front()->get().item; - break; - - } - E=results.front(); - } - } } - if (!s) - return 0; - - return s->get_instance_ID(); + return closest; } @@ -3143,7 +3087,7 @@ void SpatialEditor::_init_indicators() { indicator_mat.instance(); indicator_mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); - indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true); + //indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true); indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true); indicator_mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true); diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index c670245282..3ed101cdd6 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/tools/editor/spatial_editor_gizmos.cpp @@ -2484,7 +2484,7 @@ void GIProbeGizmo::redraw(){ } - add_lines(lines,SpatialEditorGizmos::singleton->reflection_probe_material_internal); + add_lines(lines,SpatialEditorGizmos::singleton->gi_probe_material_internal); Vector<Vector3> handles; @@ -3406,7 +3406,7 @@ SpatialEditorGizmos::SpatialEditorGizmos() { reflection_probe_material = create_line_material(Color(0.5,1.0,0.7)); reflection_probe_material_internal = create_line_material(Color(0.3,0.8,0.5,0.15)); gi_probe_material = create_line_material(Color(0.7,1.0,0.5)); - gi_probe_material_internal = create_line_material(Color(0.5,0.8,0.3,0.4)); + gi_probe_material_internal = create_line_material(Color(0.5,0.8,0.3,0.1)); joint_material = create_line_material(Color(0.6,0.8,1.0)); stream_player_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); diff --git a/tools/translations/Makefile b/tools/editor/translations/Makefile index bea20e877d..bea20e877d 100644 --- a/tools/translations/Makefile +++ b/tools/editor/translations/Makefile diff --git a/tools/translations/README.md b/tools/editor/translations/README.md index 351bc9e2d1..351bc9e2d1 100644 --- a/tools/translations/README.md +++ b/tools/editor/translations/README.md diff --git a/tools/translations/ar.po b/tools/editor/translations/ar.po index 539b94ab62..539b94ab62 100644 --- a/tools/translations/ar.po +++ b/tools/editor/translations/ar.po diff --git a/tools/translations/bg.po b/tools/editor/translations/bg.po index fe711e1b30..fe711e1b30 100644 --- a/tools/translations/bg.po +++ b/tools/editor/translations/bg.po diff --git a/tools/translations/bn.po b/tools/editor/translations/bn.po index 0b1993caa0..0b1993caa0 100644 --- a/tools/translations/bn.po +++ b/tools/editor/translations/bn.po diff --git a/tools/translations/ca.po b/tools/editor/translations/ca.po index c45cad964b..c45cad964b 100644 --- a/tools/translations/ca.po +++ b/tools/editor/translations/ca.po diff --git a/tools/translations/cs.po b/tools/editor/translations/cs.po index 3dc52fa536..3dc52fa536 100644 --- a/tools/translations/cs.po +++ b/tools/editor/translations/cs.po diff --git a/tools/translations/da.po b/tools/editor/translations/da.po index 6148d0b82d..6148d0b82d 100644 --- a/tools/translations/da.po +++ b/tools/editor/translations/da.po diff --git a/tools/translations/de.po b/tools/editor/translations/de.po index 0545ea2f21..0545ea2f21 100644 --- a/tools/translations/de.po +++ b/tools/editor/translations/de.po diff --git a/tools/translations/de_CH.po b/tools/editor/translations/de_CH.po index 0420d3fc97..0420d3fc97 100644 --- a/tools/translations/de_CH.po +++ b/tools/editor/translations/de_CH.po diff --git a/tools/translations/es.po b/tools/editor/translations/es.po index a1108822fa..a1108822fa 100644 --- a/tools/translations/es.po +++ b/tools/editor/translations/es.po diff --git a/tools/translations/es_AR.po b/tools/editor/translations/es_AR.po index d921254859..d921254859 100644 --- a/tools/translations/es_AR.po +++ b/tools/editor/translations/es_AR.po diff --git a/tools/translations/extract.py b/tools/editor/translations/extract.py index 1192c19011..1192c19011 100755 --- a/tools/translations/extract.py +++ b/tools/editor/translations/extract.py diff --git a/tools/translations/fa.po b/tools/editor/translations/fa.po index 41a686ba52..41a686ba52 100644 --- a/tools/translations/fa.po +++ b/tools/editor/translations/fa.po diff --git a/tools/translations/fr.po b/tools/editor/translations/fr.po index 2c4f7144fe..2c4f7144fe 100644 --- a/tools/translations/fr.po +++ b/tools/editor/translations/fr.po diff --git a/tools/translations/hu.po b/tools/editor/translations/hu.po index 335ab25c6a..335ab25c6a 100644 --- a/tools/translations/hu.po +++ b/tools/editor/translations/hu.po diff --git a/tools/translations/id.po b/tools/editor/translations/id.po index 30bd357a21..30bd357a21 100644 --- a/tools/translations/id.po +++ b/tools/editor/translations/id.po diff --git a/tools/translations/it.po b/tools/editor/translations/it.po index 8fefe67677..8fefe67677 100644 --- a/tools/translations/it.po +++ b/tools/editor/translations/it.po diff --git a/tools/translations/ja.po b/tools/editor/translations/ja.po index ea314db101..ea314db101 100644 --- a/tools/translations/ja.po +++ b/tools/editor/translations/ja.po diff --git a/tools/translations/ko.po b/tools/editor/translations/ko.po index a0ecb70bf5..a0ecb70bf5 100644 --- a/tools/translations/ko.po +++ b/tools/editor/translations/ko.po diff --git a/tools/translations/nb.po b/tools/editor/translations/nb.po index cbd2a09951..cbd2a09951 100644 --- a/tools/translations/nb.po +++ b/tools/editor/translations/nb.po diff --git a/tools/translations/pl.po b/tools/editor/translations/pl.po index 50afecad1b..50afecad1b 100644 --- a/tools/translations/pl.po +++ b/tools/editor/translations/pl.po diff --git a/tools/translations/pr.po b/tools/editor/translations/pr.po index 8ea2967a22..8ea2967a22 100644 --- a/tools/translations/pr.po +++ b/tools/editor/translations/pr.po diff --git a/tools/translations/pt_BR.po b/tools/editor/translations/pt_BR.po index 9ab81786b1..9ab81786b1 100644 --- a/tools/translations/pt_BR.po +++ b/tools/editor/translations/pt_BR.po diff --git a/tools/translations/pt_PT.po b/tools/editor/translations/pt_PT.po index da9d971347..da9d971347 100644 --- a/tools/translations/pt_PT.po +++ b/tools/editor/translations/pt_PT.po diff --git a/tools/translations/ru.po b/tools/editor/translations/ru.po index 0595a675b3..0595a675b3 100644 --- a/tools/translations/ru.po +++ b/tools/editor/translations/ru.po diff --git a/tools/translations/sk.po b/tools/editor/translations/sk.po index 6aa2e16664..6aa2e16664 100644 --- a/tools/translations/sk.po +++ b/tools/editor/translations/sk.po diff --git a/tools/translations/sl.po b/tools/editor/translations/sl.po index 4934be97d7..4934be97d7 100644 --- a/tools/translations/sl.po +++ b/tools/editor/translations/sl.po diff --git a/tools/translations/tools.pot b/tools/editor/translations/tools.pot index 8e54d88989..8e54d88989 100644 --- a/tools/translations/tools.pot +++ b/tools/editor/translations/tools.pot diff --git a/tools/translations/tr.po b/tools/editor/translations/tr.po index 5c0b6ebca8..5c0b6ebca8 100644 --- a/tools/translations/tr.po +++ b/tools/editor/translations/tr.po diff --git a/tools/translations/ur_PK.po b/tools/editor/translations/ur_PK.po index b898301d0c..b898301d0c 100644 --- a/tools/translations/ur_PK.po +++ b/tools/editor/translations/ur_PK.po diff --git a/tools/translations/zh_CN.po b/tools/editor/translations/zh_CN.po index 47c77f6170..47c77f6170 100644 --- a/tools/translations/zh_CN.po +++ b/tools/editor/translations/zh_CN.po diff --git a/tools/translations/zh_HK.po b/tools/editor/translations/zh_HK.po index b0bb11d527..b0bb11d527 100644 --- a/tools/translations/zh_HK.po +++ b/tools/editor/translations/zh_HK.po diff --git a/tools/translations/zh_TW.po b/tools/editor/translations/zh_TW.po index 3e9b61ec0f..3e9b61ec0f 100644 --- a/tools/translations/zh_TW.po +++ b/tools/editor/translations/zh_TW.po |