Vulkan: Move thirdparty code out of drivers, style fixes
- `vk_enum_string_helper.h` is a generated file taken from the SDK (Vulkan-ValidationLayers). - `vk_mem_alloc.h` is a library from GPUOpen: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
This commit is contained in:
parent
eb2b1a6022
commit
db81928e08
|
@ -367,11 +367,17 @@ License: BSD-3-clause
|
|||
|
||||
Files: ./thirdparty/vulkan/
|
||||
Comment: Vulkan Ecosystem Components (Vulkan ICD loader and headers)
|
||||
Copyright: 2015-2016, The Khronos Group Inc.
|
||||
2015-2016, Valve Corporation
|
||||
2015-2016, LunarG, Inc.
|
||||
Copyright: 2014-2019, The Khronos Group Inc.
|
||||
2014-2019, Valve Corporation
|
||||
2014-2019, LunarG, Inc.
|
||||
2015-2019, Google Inc.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: ./thirdparty/vulkan/vk_mem_alloc.h
|
||||
Comment: Vulkan Memory Allocator
|
||||
Copyright: 2017-2019, Advanced Micro Devices, Inc.
|
||||
License: Expat
|
||||
|
||||
Files: ./thirdparty/wslay/
|
||||
Comment: Wslay
|
||||
Copyright: 2011-2015, Tatsuhiro Tsujikawa
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -7,7 +7,7 @@ env.add_source_files(env.drivers_sources, "*.cpp")
|
|||
if env['builtin_vulkan']:
|
||||
# Use bundled Vulkan headers
|
||||
thirdparty_dir = "#thirdparty/vulkan"
|
||||
env.Prepend(CPPPATH=[thirdparty_dir + "/include", thirdparty_dir + "/loader"])
|
||||
env.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "/include", thirdparty_dir + "/loader"])
|
||||
|
||||
# Build Vulkan loader library
|
||||
env_thirdparty = env.Clone()
|
||||
|
@ -25,6 +25,7 @@ if env['builtin_vulkan']:
|
|||
"wsi.c",
|
||||
"extension_manual.c",
|
||||
]
|
||||
vma_sources = [thirdparty_dir + "/vk_mem_alloc.cpp"]
|
||||
|
||||
if env['platform'] == "windows":
|
||||
loader_sources.append("dirent_on_windows.c")
|
||||
|
@ -59,3 +60,4 @@ if env['builtin_vulkan']:
|
|||
|
||||
loader_sources = [thirdparty_dir + "/loader/" + file for file in loader_sources]
|
||||
env_thirdparty.add_source_files(env.drivers_sources, loader_sources)
|
||||
env_thirdparty.add_source_files(env.drivers_sources, vma_sources)
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
/*************************************************************************/
|
||||
/* vk_mem_alloc.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#define VMA_IMPLEMENTATION
|
||||
#ifdef DEBUG_ENABLED
|
||||
#ifndef _MSC_VER
|
||||
#define _DEBUG
|
||||
#endif
|
||||
#endif
|
||||
#include "vk_mem_alloc.h"
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -33,11 +33,11 @@
|
|||
#include "core/io/marshalls.h"
|
||||
#include "core/project_settings.h"
|
||||
#include "core/ustring.h"
|
||||
#include "editor/plugins/canvas_item_editor_plugin.h"
|
||||
#include "editor/plugins/spatial_editor_plugin.h"
|
||||
#include "editor/editor_log.h"
|
||||
#include "editor/editor_network_profiler.h"
|
||||
#include "editor/editor_visual_profiler.h"
|
||||
#include "editor/plugins/canvas_item_editor_plugin.h"
|
||||
#include "editor/plugins/spatial_editor_plugin.h"
|
||||
#include "editor_node.h"
|
||||
#include "editor_profiler.h"
|
||||
#include "editor_scale.h"
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* rvo_space.cpp */
|
||||
/* nav_map.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* rvo_space.h */
|
||||
/* nav_map.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* nav_region.h */
|
||||
/* nav_region.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* nav_region.cpp */
|
||||
/* nav_region.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* rvo_rid.h */
|
||||
/* nav_rid.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* utils.h */
|
||||
/* nav_utils.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* navigation_obstacle.cpp */
|
||||
/* navigation_obstacle_2d.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* navigation_obstacle.h */
|
||||
/* navigation_obstacle_2d.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* navigation_mesh.cpp */
|
||||
/* navigation_mesh_instance.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*************************************************************************/
|
||||
/* navigation_mesh.h */
|
||||
/* navigation_mesh_instance.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/*************************************************************************/
|
||||
/* light_cluster_builder.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#include "light_cluster_builder.h"
|
||||
|
||||
void LightClusterBuilder::begin(const Transform &p_view_transform, const CameraMatrix &p_cam_projection) {
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/*************************************************************************/
|
||||
/* light_cluster_builder.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef LIGHT_CLUSTER_BUILDER_H
|
||||
#define LIGHT_CLUSTER_BUILDER_H
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* rasterizer_scene_forward_rd.cpp */
|
||||
/* rasterizer_scene_high_end_rd.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*************************************************************************/
|
||||
/* rasterizer_scene_forward_rd.h */
|
||||
/* rasterizer_scene_high_end_rd.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -125,14 +125,14 @@ void main() {
|
|||
|
||||
//Glow uses larger sigma 1 for a more rounded blur effect
|
||||
|
||||
#define GLOW_ADD( m_ofs, m_mult )\
|
||||
{\
|
||||
vec2 ofs = uv_interp + m_ofs * pix_size;\
|
||||
vec4 c = texture(source_color, ofs ) * m_mult; \
|
||||
if (any(lessThan(ofs,vec2(0.0))) || any(greaterThan(ofs,vec2(1.0)))) {\
|
||||
c*=0.0;\
|
||||
}\
|
||||
color+=c;\
|
||||
#define GLOW_ADD(m_ofs, m_mult) \
|
||||
{ \
|
||||
vec2 ofs = uv_interp + m_ofs * pix_size; \
|
||||
vec4 c = texture(source_color, ofs) * m_mult; \
|
||||
if (any(lessThan(ofs, vec2(0.0))) || any(greaterThan(ofs, vec2(1.0)))) { \
|
||||
c *= 0.0; \
|
||||
} \
|
||||
color += c; \
|
||||
}
|
||||
|
||||
if (bool(blur.flags & FLAG_HORIZONTAL)) {
|
||||
|
@ -140,22 +140,22 @@ void main() {
|
|||
vec2 pix_size = blur.pixel_size;
|
||||
pix_size *= 0.5; //reading from larger buffer, so use more samples
|
||||
vec4 color = texture(source_color, uv_interp + vec2(0.0, 0.0) * pix_size) * 0.174938;
|
||||
GLOW_ADD(vec2(1.0, 0.0),0.165569);
|
||||
GLOW_ADD(vec2(2.0, 0.0),0.140367);
|
||||
GLOW_ADD(vec2(1.0, 0.0), 0.165569);
|
||||
GLOW_ADD(vec2(2.0, 0.0), 0.140367);
|
||||
GLOW_ADD(vec2(3.0, 0.0), 0.106595);
|
||||
GLOW_ADD(vec2(-1.0, 0.0),0.165569);
|
||||
GLOW_ADD(vec2(-2.0, 0.0),0.140367);
|
||||
GLOW_ADD(vec2(-3.0, 0.0),0.106595);
|
||||
GLOW_ADD(vec2(-1.0, 0.0), 0.165569);
|
||||
GLOW_ADD(vec2(-2.0, 0.0), 0.140367);
|
||||
GLOW_ADD(vec2(-3.0, 0.0), 0.106595);
|
||||
color *= blur.glow_strength;
|
||||
frag_color = color;
|
||||
} else {
|
||||
|
||||
vec2 pix_size = blur.pixel_size;
|
||||
vec4 color = texture(source_color, uv_interp + vec2(0.0, 0.0) * pix_size) * 0.288713;
|
||||
GLOW_ADD(vec2(0.0, 1.0),0.233062);
|
||||
GLOW_ADD(vec2(0.0, 2.0),0.122581);
|
||||
GLOW_ADD(vec2(0.0, -1.0),0.233062);
|
||||
GLOW_ADD(vec2(0.0, -2.0),0.122581);
|
||||
GLOW_ADD(vec2(0.0, 1.0), 0.233062);
|
||||
GLOW_ADD(vec2(0.0, 2.0), 0.122581);
|
||||
GLOW_ADD(vec2(0.0, -1.0), 0.233062);
|
||||
GLOW_ADD(vec2(0.0, -2.0), 0.122581);
|
||||
color *= blur.glow_strength;
|
||||
frag_color = color;
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ void main() {
|
|||
#ifdef MODE_SIMPLE_COPY
|
||||
vec4 color = texture(source_color, uv_interp, 0.0);
|
||||
if (bool(blur.flags & FLAG_COPY_FORCE_LUMINANCE)) {
|
||||
color.rgb = vec3(max(max(color.r,color.g),color.b));
|
||||
color.rgb = vec3(max(max(color.r, color.g), color.b));
|
||||
}
|
||||
frag_color = color;
|
||||
#endif
|
||||
|
|
|
@ -31,4 +31,5 @@ layout(push_constant, binding = 1, std430) uniform Blur {
|
|||
float camera_z_near;
|
||||
|
||||
vec4 ssao_color;
|
||||
} blur;
|
||||
}
|
||||
blur;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* clang-format off */
|
||||
[compute]
|
||||
/* clang-format on */
|
||||
|
||||
#version 450
|
||||
|
||||
VERSION_DEFINES
|
||||
|
@ -8,7 +8,7 @@ VERSION_DEFINES
|
|||
#define BLOCK_SIZE 8
|
||||
|
||||
layout(local_size_x = BLOCK_SIZE, local_size_y = BLOCK_SIZE, local_size_z = 1) in;
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifdef MODE_GEN_BLUR_SIZE
|
||||
layout(rgba16f, set = 0, binding = 0) uniform restrict image2D color_image;
|
||||
|
@ -27,7 +27,6 @@ layout(set = 1, binding = 0) uniform sampler2D source_bokeh;
|
|||
|
||||
// based on https://www.shadertoy.com/view/Xd3GDl
|
||||
|
||||
|
||||
layout(push_constant, binding = 1, std430) uniform Params {
|
||||
ivec2 size;
|
||||
float z_far;
|
||||
|
@ -51,7 +50,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
bool use_jitter;
|
||||
float jitter_seed;
|
||||
uint pad[2];
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
//used to work around downsampling filter
|
||||
#define DEPTH_GAP 0.0
|
||||
|
@ -59,7 +59,7 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
#ifdef MODE_GEN_BLUR_SIZE
|
||||
|
||||
float get_depth_at_pos(vec2 uv) {
|
||||
float depth = textureLod(source_depth,uv,0.0).x;
|
||||
float depth = textureLod(source_depth, uv, 0.0).x;
|
||||
if (params.orthogonal) {
|
||||
depth = ((depth + (params.z_far + params.z_near) / (params.z_far - params.z_near)) * (params.z_far - params.z_near)) / 2.0;
|
||||
} else {
|
||||
|
@ -68,15 +68,14 @@ float get_depth_at_pos(vec2 uv) {
|
|||
return depth;
|
||||
}
|
||||
|
||||
|
||||
float get_blur_size(float depth) {
|
||||
|
||||
if (params.blur_near_active && depth < params.blur_near_begin) {
|
||||
return - (1.0 - smoothstep(params.blur_near_end,params.blur_near_begin,depth) ) * params.blur_size - DEPTH_GAP; //near blur is negative
|
||||
return -(1.0 - smoothstep(params.blur_near_end, params.blur_near_begin, depth)) * params.blur_size - DEPTH_GAP; //near blur is negative
|
||||
}
|
||||
|
||||
if (params.blur_far_active && depth > params.blur_far_begin) {
|
||||
return smoothstep(params.blur_far_begin,params.blur_far_end,depth) * params.blur_size + DEPTH_GAP;
|
||||
return smoothstep(params.blur_far_begin, params.blur_far_end, depth) * params.blur_size + DEPTH_GAP;
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
|
@ -86,10 +85,9 @@ float get_blur_size(float depth) {
|
|||
|
||||
const float GOLDEN_ANGLE = 2.39996323;
|
||||
|
||||
|
||||
//note: uniform pdf rand [0;1[
|
||||
float hash12n(vec2 p) {
|
||||
p = fract(p * vec2(5.3987, 5.4421));
|
||||
p = fract(p * vec2(5.3987, 5.4421));
|
||||
p += dot(p.yx, p.xy + vec2(21.5351, 14.3137));
|
||||
return fract(p.x * p.y * 95.4307);
|
||||
}
|
||||
|
@ -99,20 +97,20 @@ float hash12n(vec2 p) {
|
|||
vec4 weighted_filter_dir(vec2 dir, vec2 uv, vec2 pixel_size) {
|
||||
|
||||
dir *= pixel_size;
|
||||
vec4 color = texture(color_texture,uv);
|
||||
vec4 color = texture(color_texture, uv);
|
||||
|
||||
vec4 accum = color;
|
||||
float total = 1.0;
|
||||
|
||||
float blur_scale = params.blur_size/float(params.blur_steps);
|
||||
float blur_scale = params.blur_size / float(params.blur_steps);
|
||||
|
||||
if (params.use_jitter) {
|
||||
uv += dir * (hash12n(uv+params.jitter_seed) - 0.5);
|
||||
uv += dir * (hash12n(uv + params.jitter_seed) - 0.5);
|
||||
}
|
||||
|
||||
for(int i=-params.blur_steps;i<=params.blur_steps;i++) {
|
||||
for (int i = -params.blur_steps; i <= params.blur_steps; i++) {
|
||||
|
||||
if (i==0) {
|
||||
if (i == 0) {
|
||||
continue;
|
||||
}
|
||||
float radius = float(i) * blur_scale;
|
||||
|
@ -130,12 +128,11 @@ vec4 weighted_filter_dir(vec2 dir, vec2 uv, vec2 pixel_size) {
|
|||
|
||||
limit -= DEPTH_GAP;
|
||||
|
||||
float m = smoothstep(radius-0.5, radius+0.5, limit);
|
||||
float m = smoothstep(radius - 0.5, radius + 0.5, limit);
|
||||
|
||||
accum += mix(color, sample_color, m );
|
||||
accum += mix(color, sample_color, m);
|
||||
|
||||
total += 1.0;
|
||||
|
||||
}
|
||||
|
||||
return accum / total;
|
||||
|
@ -147,80 +144,76 @@ void main() {
|
|||
|
||||
ivec2 pos = ivec2(gl_GlobalInvocationID.xy);
|
||||
|
||||
if (any(greaterThan(pos,params.size))) { //too large, do nothing
|
||||
if (any(greaterThan(pos, params.size))) { //too large, do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
vec2 pixel_size = 1.0/vec2(params.size);
|
||||
vec2 pixel_size = 1.0 / vec2(params.size);
|
||||
vec2 uv = vec2(pos) / vec2(params.size);
|
||||
|
||||
#ifdef MODE_GEN_BLUR_SIZE
|
||||
uv+=pixel_size * 0.5;
|
||||
uv += pixel_size * 0.5;
|
||||
//precompute size in alpha channel
|
||||
float depth = get_depth_at_pos(uv);
|
||||
float size = get_blur_size(depth);
|
||||
|
||||
vec4 color = imageLoad(color_image,pos);
|
||||
vec4 color = imageLoad(color_image, pos);
|
||||
color.a = size;
|
||||
imageStore(color_image,pos,color);
|
||||
imageStore(color_image, pos, color);
|
||||
#endif
|
||||
|
||||
#ifdef MODE_BOKEH_BOX
|
||||
|
||||
//pixel_size*=0.5; //resolution is doubled
|
||||
if (params.second_pass || !params.half_size) {
|
||||
uv+=pixel_size * 0.5; //half pixel to read centers
|
||||
uv += pixel_size * 0.5; //half pixel to read centers
|
||||
} else {
|
||||
uv+=pixel_size * 0.25; //half pixel to read centers from full res
|
||||
uv += pixel_size * 0.25; //half pixel to read centers from full res
|
||||
}
|
||||
|
||||
vec2 dir = (params.second_pass ? vec2(0.0,1.0) : vec2(1.0,0.0));
|
||||
vec2 dir = (params.second_pass ? vec2(0.0, 1.0) : vec2(1.0, 0.0));
|
||||
|
||||
vec4 color = weighted_filter_dir(dir,uv,pixel_size);
|
||||
vec4 color = weighted_filter_dir(dir, uv, pixel_size);
|
||||
|
||||
imageStore(bokeh_image,pos,color);
|
||||
imageStore(bokeh_image, pos, color);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MODE_BOKEH_HEXAGONAL
|
||||
|
||||
|
||||
//pixel_size*=0.5; //resolution is doubled
|
||||
if (params.second_pass || !params.half_size) {
|
||||
uv+=pixel_size * 0.5; //half pixel to read centers
|
||||
uv += pixel_size * 0.5; //half pixel to read centers
|
||||
} else {
|
||||
uv+=pixel_size * 0.25; //half pixel to read centers from full res
|
||||
uv += pixel_size * 0.25; //half pixel to read centers from full res
|
||||
}
|
||||
|
||||
vec2 dir = (params.second_pass ? normalize(vec2( 1.0, 0.577350269189626 )) : vec2(0.0,1.0));
|
||||
vec2 dir = (params.second_pass ? normalize(vec2(1.0, 0.577350269189626)) : vec2(0.0, 1.0));
|
||||
|
||||
vec4 color = weighted_filter_dir(dir,uv,pixel_size);
|
||||
vec4 color = weighted_filter_dir(dir, uv, pixel_size);
|
||||
|
||||
if (params.second_pass) {
|
||||
dir = normalize(vec2( -1.0, 0.577350269189626 ));
|
||||
dir = normalize(vec2(-1.0, 0.577350269189626));
|
||||
|
||||
vec4 color2 = weighted_filter_dir(dir,uv,pixel_size);
|
||||
vec4 color2 = weighted_filter_dir(dir, uv, pixel_size);
|
||||
|
||||
color.rgb = min(color.rgb,color2.rgb);
|
||||
color.rgb = min(color.rgb, color2.rgb);
|
||||
color.a = (color.a + color2.a) * 0.5;
|
||||
}
|
||||
|
||||
imageStore(bokeh_image,pos,color);
|
||||
|
||||
|
||||
imageStore(bokeh_image, pos, color);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MODE_BOKEH_CIRCULAR
|
||||
|
||||
if (params.half_size) {
|
||||
pixel_size*=0.5; //resolution is doubled
|
||||
pixel_size *= 0.5; //resolution is doubled
|
||||
}
|
||||
|
||||
uv+=pixel_size * 0.5; //half pixel to read centers
|
||||
uv += pixel_size * 0.5; //half pixel to read centers
|
||||
|
||||
vec4 color = texture(color_texture,uv);
|
||||
vec4 color = texture(color_texture, uv);
|
||||
float accum = 1.0;
|
||||
float radius = params.blur_scale;
|
||||
|
||||
|
@ -230,37 +223,36 @@ void main() {
|
|||
vec4 sample_color = texture(color_texture, suv);
|
||||
float sample_size = abs(sample_color.a);
|
||||
if (sample_color.a > color.a) {
|
||||
sample_size = clamp(sample_size, 0.0, abs(color.a)*2.0);
|
||||
sample_size = clamp(sample_size, 0.0, abs(color.a) * 2.0);
|
||||
}
|
||||
|
||||
float m = smoothstep(radius-0.5, radius+0.5, sample_size);
|
||||
color += mix(color/accum, sample_color, m);
|
||||
float m = smoothstep(radius - 0.5, radius + 0.5, sample_size);
|
||||
color += mix(color / accum, sample_color, m);
|
||||
accum += 1.0;
|
||||
radius += params.blur_scale/radius;
|
||||
radius += params.blur_scale / radius;
|
||||
}
|
||||
|
||||
color /= accum;
|
||||
|
||||
imageStore(bokeh_image,pos,color);
|
||||
imageStore(bokeh_image, pos, color);
|
||||
#endif
|
||||
|
||||
#ifdef MODE_COMPOSITE_BOKEH
|
||||
|
||||
uv+=pixel_size * 0.5;
|
||||
vec4 color = imageLoad(color_image,pos);
|
||||
vec4 bokeh = texture(source_bokeh,uv);
|
||||
uv += pixel_size * 0.5;
|
||||
vec4 color = imageLoad(color_image, pos);
|
||||
vec4 bokeh = texture(source_bokeh, uv);
|
||||
|
||||
float mix_amount;
|
||||
if (bokeh.a < color.a) {
|
||||
mix_amount = min(1.0,max(0.0,max(abs(color.a),abs(bokeh.a))-DEPTH_GAP));
|
||||
mix_amount = min(1.0, max(0.0, max(abs(color.a), abs(bokeh.a)) - DEPTH_GAP));
|
||||
} else {
|
||||
mix_amount = min(1.0,max(0.0,abs(color.a)-DEPTH_GAP));
|
||||
mix_amount = min(1.0, max(0.0, abs(color.a) - DEPTH_GAP));
|
||||
}
|
||||
|
||||
color.rgb = mix(color.rgb,bokeh.rgb,mix_amount); //blend between hires and lowres
|
||||
color.rgb = mix(color.rgb, bokeh.rgb, mix_amount); //blend between hires and lowres
|
||||
|
||||
color.a=0; //reset alpha
|
||||
imageStore(color_image,pos,color);
|
||||
color.a = 0; //reset alpha
|
||||
imageStore(color_image, pos, color);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,8 @@ layout(push_constant, binding = 0, std430) uniform Constants {
|
|||
mat2x4 modelview;
|
||||
vec2 direction;
|
||||
vec2 pad;
|
||||
} constants;
|
||||
}
|
||||
constants;
|
||||
|
||||
layout(location = 0) out highp float depth;
|
||||
|
||||
|
|
|
@ -50,7 +50,8 @@ layout(push_constant, binding = 0, std430) uniform DrawData {
|
|||
#endif
|
||||
vec2 color_texture_pixel_size;
|
||||
uint lights[4];
|
||||
} draw_data;
|
||||
}
|
||||
draw_data;
|
||||
|
||||
// The values passed per draw primitives are cached within it
|
||||
|
||||
|
@ -80,14 +81,16 @@ layout(set = 2, binding = 0, std140) uniform CanvasData {
|
|||
float time;
|
||||
float time_pad;
|
||||
//uint light_count;
|
||||
} canvas_data;
|
||||
}
|
||||
canvas_data;
|
||||
|
||||
layout(set = 2, binding = 1) uniform textureBuffer skeleton_buffer;
|
||||
|
||||
layout(set = 2, binding = 2, std140) uniform SkeletonData {
|
||||
mat4 skeleton_transform; //in world coordinates
|
||||
mat4 skeleton_transform_inverse;
|
||||
} skeleton_data;
|
||||
}
|
||||
skeleton_data;
|
||||
|
||||
#ifdef USE_LIGHTING
|
||||
|
||||
|
@ -119,7 +122,8 @@ struct Light {
|
|||
|
||||
layout(set = 2, binding = 3, std140) uniform LightData {
|
||||
Light data[MAX_LIGHTS];
|
||||
} light_array;
|
||||
}
|
||||
light_array;
|
||||
|
||||
layout(set = 2, binding = 4) uniform texture2D light_textures[MAX_LIGHT_TEXTURES];
|
||||
layout(set = 2, binding = 5) uniform texture2D shadow_textures[MAX_LIGHT_TEXTURES];
|
||||
|
|
|
@ -35,7 +35,8 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||
float z_far;
|
||||
float z_near;
|
||||
bool z_flip;
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
layout(location = 0) out float depth_buffer;
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
uint sample_count;
|
||||
float roughness;
|
||||
bool use_direct_write;
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
layout(location = 0) in vec2 uv_interp;
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ struct CellChildren {
|
|||
|
||||
layout(set = 0, binding = 1, std430) buffer CellChildrenBuffer {
|
||||
CellChildren data[];
|
||||
} cell_children;
|
||||
}
|
||||
cell_children;
|
||||
|
||||
struct CellData {
|
||||
uint position; // xyz 10 bits
|
||||
|
@ -34,7 +35,8 @@ struct CellData {
|
|||
|
||||
layout(set = 0, binding = 2, std430) buffer CellDataBuffer {
|
||||
CellData data[];
|
||||
} cell_data;
|
||||
}
|
||||
cell_data;
|
||||
|
||||
#endif // MODE DYNAMIC
|
||||
|
||||
|
@ -63,7 +65,8 @@ struct Light {
|
|||
|
||||
layout(set = 0, binding = 3, std140) uniform Lights {
|
||||
Light data[MAX_LIGHTS];
|
||||
} lights;
|
||||
}
|
||||
lights;
|
||||
|
||||
#endif // MODE COMPUTE LIGHT
|
||||
|
||||
|
@ -93,11 +96,13 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||
uint cell_count;
|
||||
float aniso_strength;
|
||||
uint pad;
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
layout(set = 0, binding = 4, std430) buffer Outputs {
|
||||
vec4 data[];
|
||||
} outputs;
|
||||
}
|
||||
outputs;
|
||||
|
||||
#endif // MODE DYNAMIC
|
||||
|
||||
|
@ -138,7 +143,8 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||
bool on_mipmap;
|
||||
float propagation;
|
||||
float pad[3];
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
#ifdef MODE_DYNAMIC_LIGHTING
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@ struct CellData {
|
|||
|
||||
layout(set = 0, binding = 1, std140) buffer CellDataBuffer {
|
||||
CellData data[];
|
||||
} cell_data;
|
||||
}
|
||||
cell_data;
|
||||
|
||||
layout(set = 0, binding = 2) uniform texture3D color_tex;
|
||||
|
||||
|
@ -35,7 +36,8 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||
uint level;
|
||||
ivec3 bounds;
|
||||
uint pad;
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
layout(location = 0) out vec4 color_interp;
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@ struct CellChildren {
|
|||
|
||||
layout(set = 0, binding = 1, std430) buffer CellChildrenBuffer {
|
||||
CellChildren data[];
|
||||
} cell_children;
|
||||
}
|
||||
cell_children;
|
||||
|
||||
struct CellData {
|
||||
uint position; // xyz 10 bits
|
||||
|
@ -30,7 +31,8 @@ struct CellData {
|
|||
|
||||
layout(set = 0, binding = 2, std430) buffer CellDataBuffer {
|
||||
CellData data[];
|
||||
} cell_data;
|
||||
}
|
||||
cell_data;
|
||||
|
||||
layout(r8ui, set = 0, binding = 3) uniform restrict writeonly uimage3D sdf_tex;
|
||||
|
||||
|
@ -39,7 +41,8 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||
uint end;
|
||||
uint pad0;
|
||||
uint pad1;
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
void main() {
|
||||
|
||||
|
|
|
@ -17,7 +17,8 @@ struct CellChildren {
|
|||
|
||||
layout(set = 0, binding = 1, std430) buffer CellChildrenBuffer {
|
||||
CellChildren data[];
|
||||
} cell_children;
|
||||
}
|
||||
cell_children;
|
||||
|
||||
struct CellData {
|
||||
uint position; // xyz 10 bits
|
||||
|
@ -28,7 +29,8 @@ struct CellData {
|
|||
|
||||
layout(set = 0, binding = 2, std430) buffer CellDataBuffer {
|
||||
CellData data[];
|
||||
} cell_data;
|
||||
}
|
||||
cell_data;
|
||||
|
||||
#define LIGHT_TYPE_DIRECTIONAL 0
|
||||
#define LIGHT_TYPE_OMNI 1
|
||||
|
@ -54,7 +56,8 @@ struct Light {
|
|||
|
||||
layout(set = 0, binding = 3, std140) uniform Lights {
|
||||
Light data[MAX_LIGHTS];
|
||||
} lights;
|
||||
}
|
||||
lights;
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -70,11 +73,13 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||
uint cell_offset;
|
||||
uint cell_count;
|
||||
uint pad[2];
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
layout(set = 0, binding = 4, std140) uniform Outputs {
|
||||
vec4 data[];
|
||||
} output;
|
||||
}
|
||||
output;
|
||||
|
||||
#ifdef MODE_COMPUTE_LIGHT
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* clang-format off */
|
||||
[compute]
|
||||
/* clang-format on */
|
||||
|
||||
#version 450
|
||||
|
||||
VERSION_DEFINES
|
||||
|
@ -8,9 +8,9 @@ VERSION_DEFINES
|
|||
#define BLOCK_SIZE 8
|
||||
|
||||
layout(local_size_x = BLOCK_SIZE, local_size_y = BLOCK_SIZE, local_size_z = 1) in;
|
||||
/* clang-format on */
|
||||
|
||||
shared float tmp_data[BLOCK_SIZE*BLOCK_SIZE];
|
||||
|
||||
shared float tmp_data[BLOCK_SIZE * BLOCK_SIZE];
|
||||
|
||||
#ifdef READ_TEXTURE
|
||||
|
||||
|
@ -36,19 +36,19 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
float min_luminance;
|
||||
float exposure_adjust;
|
||||
float pad[3];
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
void main() {
|
||||
|
||||
|
||||
uint t = gl_LocalInvocationID.y * BLOCK_SIZE + gl_LocalInvocationID.x;
|
||||
ivec2 pos = ivec2(gl_GlobalInvocationID.xy);
|
||||
|
||||
if (any(lessThan(pos,params.source_size))) {
|
||||
if (any(lessThan(pos, params.source_size))) {
|
||||
|
||||
#ifdef READ_TEXTURE
|
||||
vec3 v = texelFetch(source_texture,pos,0).rgb;
|
||||
tmp_data[t] = max(v.r,max(v.g,v.b));
|
||||
vec3 v = texelFetch(source_texture, pos, 0).rgb;
|
||||
tmp_data[t] = max(v.r, max(v.g, v.b));
|
||||
#else
|
||||
tmp_data[t] = imageLoad(source_luminance, pos).r;
|
||||
#endif
|
||||
|
@ -59,28 +59,28 @@ void main() {
|
|||
groupMemoryBarrier();
|
||||
barrier();
|
||||
|
||||
uint size = (BLOCK_SIZE * BLOCK_SIZE)>>1;
|
||||
uint size = (BLOCK_SIZE * BLOCK_SIZE) >> 1;
|
||||
|
||||
do {
|
||||
if (t<size) {
|
||||
tmp_data[t]+=tmp_data[t+size];
|
||||
if (t < size) {
|
||||
tmp_data[t] += tmp_data[t + size];
|
||||
}
|
||||
groupMemoryBarrier();
|
||||
barrier();
|
||||
|
||||
size>>=1;
|
||||
size >>= 1;
|
||||
|
||||
} while(size>=1);
|
||||
} while (size >= 1);
|
||||
|
||||
if (t==0) {
|
||||
if (t == 0) {
|
||||
//compute rect size
|
||||
ivec2 rect_size = min(params.source_size - pos,ivec2(BLOCK_SIZE));
|
||||
float avg = tmp_data[0] / float(rect_size.x*rect_size.y);
|
||||
ivec2 rect_size = min(params.source_size - pos, ivec2(BLOCK_SIZE));
|
||||
float avg = tmp_data[0] / float(rect_size.x * rect_size.y);
|
||||
//float avg = tmp_data[0] / float(BLOCK_SIZE*BLOCK_SIZE);
|
||||
pos/=ivec2(BLOCK_SIZE);
|
||||
pos /= ivec2(BLOCK_SIZE);
|
||||
#ifdef WRITE_LUMINANCE
|
||||
float prev_lum = texelFetch(prev_luminance, ivec2(0, 0), 0).r; //1 pixel previous exposure
|
||||
avg= clamp(prev_lum + (avg - prev_lum) * params.exposure_adjust, params.min_luminance, params.max_luminance);
|
||||
avg = clamp(prev_lum + (avg - prev_lum) * params.exposure_adjust, params.min_luminance, params.max_luminance);
|
||||
#endif
|
||||
imageStore(dest_luminance, pos, vec4(avg));
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
/* clang-format off */
|
||||
[compute]
|
||||
/* clang-format on */
|
||||
|
||||
#version 450
|
||||
|
||||
VERSION_DEFINES
|
||||
|
||||
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D source_normal;
|
||||
layout(r8, set = 1, binding = 0) uniform restrict writeonly image2D dest_roughness;
|
||||
|
@ -16,7 +15,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
ivec2 screen_size;
|
||||
float curve;
|
||||
uint pad;
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
#define HALF_PI 1.5707963267948966
|
||||
|
||||
|
@ -24,16 +24,16 @@ void main() {
|
|||
|
||||
// Pixel being shaded
|
||||
ivec2 pos = ivec2(gl_GlobalInvocationID.xy);
|
||||
if (any(greaterThan(pos,params.screen_size))) { //too large, do nothing
|
||||
if (any(greaterThan(pos, params.screen_size))) { //too large, do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
vec3 normal_accum = vec3(0.0);
|
||||
float accum = 0.0;
|
||||
for(int i=0;i<=1;i++) {
|
||||
for(int j=0;j<=1;j++) {
|
||||
normal_accum += normalize(texelFetch(source_normal,pos+ivec2(i,j),0).xyz * 2.0 - 1.0);
|
||||
accum+=1.0;
|
||||
for (int i = 0; i <= 1; i++) {
|
||||
for (int j = 0; j <= 1; j++) {
|
||||
normal_accum += normalize(texelFetch(source_normal, pos + ivec2(i, j), 0).xyz * 2.0 - 1.0);
|
||||
accum += 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ void main() {
|
|||
if (r < 1.0) {
|
||||
float threshold = 0.4;
|
||||
|
||||
/*
|
||||
/*
|
||||
//Formula from Filament, does not make sense to me.
|
||||
|
||||
float r2 = r * r;
|
||||
|
@ -54,7 +54,7 @@ void main() {
|
|||
float variance = 0.25f / kappa;
|
||||
limit = sqrt(min(2.0f * variance, threshold * threshold));
|
||||
//*/
|
||||
/*
|
||||
/*
|
||||
//Formula based on probability distribution graph
|
||||
|
||||
float width = acos(max(0.0,r)); // convert to angle (width)
|
||||
|
@ -62,12 +62,12 @@ void main() {
|
|||
limit = min(sqrt(roughness), threshold); //convert to perceptual roughness and apply threshold
|
||||
//*/
|
||||
|
||||
limit = min(sqrt(pow(acos(max(0.0,r)) / HALF_PI ,params.curve)), threshold); //convert to perceptual roughness and apply threshold
|
||||
limit = min(sqrt(pow(acos(max(0.0, r)) / HALF_PI, params.curve)), threshold); //convert to perceptual roughness and apply threshold
|
||||
|
||||
//limit = 0.5;
|
||||
} else {
|
||||
limit = 0.0;
|
||||
}
|
||||
|
||||
imageStore(dest_roughness,pos,vec4(limit));
|
||||
imageStore(dest_roughness, pos, vec4(limit));
|
||||
}
|
||||
|
|
|
@ -1151,7 +1151,7 @@ void gi_probe_compute(uint index, vec3 position, vec3 normal, vec3 ref_vec, mat3
|
|||
|
||||
ao = 1.0 - min(1.0, ao);
|
||||
|
||||
light = mix(scene_data.ao_color.rgb,light,mix(1.0, ao, gi_probes.data[index].ambient_occlusion));
|
||||
light = mix(scene_data.ao_color.rgb, light, mix(1.0, ao, gi_probes.data[index].ambient_occlusion));
|
||||
}
|
||||
|
||||
out_diff += vec4(light * blend, blend);
|
||||
|
@ -1272,7 +1272,6 @@ FRAGMENT_SHADER_CODE
|
|||
|
||||
#endif // !USE_SHADOW_TO_OPACITY
|
||||
|
||||
|
||||
#if defined(NORMALMAP_USED)
|
||||
|
||||
normalmap.xy = normalmap.xy * 2.0 - 1.0;
|
||||
|
@ -1312,12 +1311,10 @@ FRAGMENT_SHADER_CODE
|
|||
#if !defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED)
|
||||
|
||||
if (scene_data.roughness_limiter_enabled) {
|
||||
float limit = texelFetch(sampler2D(roughness_buffer, material_samplers[SAMPLER_NEAREST_CLAMP]),ivec2(gl_FragCoord.xy),0).r;
|
||||
roughness = max(roughness,limit);
|
||||
|
||||
float limit = texelFetch(sampler2D(roughness_buffer, material_samplers[SAMPLER_NEAREST_CLAMP]), ivec2(gl_FragCoord.xy), 0).r;
|
||||
roughness = max(roughness, limit);
|
||||
}
|
||||
|
||||
|
||||
if (scene_data.use_reflection_cubemap) {
|
||||
|
||||
vec3 ref_vec = reflect(-view, normal);
|
||||
|
@ -1407,7 +1404,7 @@ FRAGMENT_SHADER_CODE
|
|||
}
|
||||
#endif
|
||||
|
||||
uvec4 cluster_cell = texture(usampler3D(cluster_texture, material_samplers[SAMPLER_NEAREST_CLAMP]),vec3(screen_uv,(abs(vertex.z)-scene_data.z_near)/(scene_data.z_far-scene_data.z_near)));
|
||||
uvec4 cluster_cell = texture(usampler3D(cluster_texture, material_samplers[SAMPLER_NEAREST_CLAMP]), vec3(screen_uv, (abs(vertex.z) - scene_data.z_near) / (scene_data.z_far - scene_data.z_near)));
|
||||
|
||||
{ // process reflections
|
||||
|
||||
|
@ -1544,7 +1541,7 @@ FRAGMENT_SHADER_CODE
|
|||
|
||||
uint light_index = cluster_data.indices[omni_light_pointer + i];
|
||||
|
||||
if (!bool(lights.data[light_index].mask&instances.data[instance_index].layer_mask)) {
|
||||
if (!bool(lights.data[light_index].mask & instances.data[instance_index].layer_mask)) {
|
||||
continue; //not masked
|
||||
}
|
||||
|
||||
|
@ -1577,7 +1574,7 @@ FRAGMENT_SHADER_CODE
|
|||
|
||||
uint light_index = cluster_data.indices[spot_light_pointer + i];
|
||||
|
||||
if (!bool(lights.data[light_index].mask&instances.data[instance_index].layer_mask)) {
|
||||
if (!bool(lights.data[light_index].mask & instances.data[instance_index].layer_mask)) {
|
||||
continue; //not masked
|
||||
}
|
||||
|
||||
|
@ -1648,7 +1645,7 @@ FRAGMENT_SHADER_CODE
|
|||
#endif
|
||||
|
||||
#ifdef MODE_RENDER_NORMAL
|
||||
normal_output_buffer = vec4(normal * 0.5 + 0.5,0.0);
|
||||
normal_output_buffer = vec4(normal * 0.5 + 0.5, 0.0);
|
||||
#ifdef MODE_RENDER_ROUGHNESS
|
||||
roughness_output_buffer = roughness;
|
||||
#endif //MODE_RENDER_ROUGHNESS
|
||||
|
@ -1664,24 +1661,24 @@ FRAGMENT_SHADER_CODE
|
|||
#if defined(AO_USED)
|
||||
|
||||
if (scene_data.ssao_enabled && scene_data.ssao_ao_affect > 0.0) {
|
||||
float ssao = texture(sampler2D(ao_buffer, material_samplers[SAMPLER_LINEAR_CLAMP]),screen_uv).r;
|
||||
ao = mix(ao,min(ao,ssao),scene_data.ssao_ao_affect);
|
||||
ao_light_affect = mix(ao_light_affect,max(ao_light_affect,scene_data.ssao_light_affect),scene_data.ssao_ao_affect);
|
||||
float ssao = texture(sampler2D(ao_buffer, material_samplers[SAMPLER_LINEAR_CLAMP]), screen_uv).r;
|
||||
ao = mix(ao, min(ao, ssao), scene_data.ssao_ao_affect);
|
||||
ao_light_affect = mix(ao_light_affect, max(ao_light_affect, scene_data.ssao_light_affect), scene_data.ssao_ao_affect);
|
||||
}
|
||||
|
||||
ambient_light = mix(scene_data.ao_color.rgb,ambient_light,ao);
|
||||
ambient_light = mix(scene_data.ao_color.rgb, ambient_light, ao);
|
||||
ao_light_affect = mix(1.0, ao, ao_light_affect);
|
||||
specular_light = mix(scene_data.ao_color.rgb,specular_light,ao_light_affect);
|
||||
diffuse_light = mix(scene_data.ao_color.rgb,diffuse_light,ao_light_affect);
|
||||
specular_light = mix(scene_data.ao_color.rgb, specular_light, ao_light_affect);
|
||||
diffuse_light = mix(scene_data.ao_color.rgb, diffuse_light, ao_light_affect);
|
||||
|
||||
#else
|
||||
|
||||
if (scene_data.ssao_enabled) {
|
||||
float ao = texture(sampler2D(ao_buffer, material_samplers[SAMPLER_LINEAR_CLAMP]),screen_uv).r;
|
||||
ambient_light = mix(scene_data.ao_color.rgb,ambient_light,ao);
|
||||
float ao_light_affect = mix(1.0, ao,scene_data.ssao_light_affect);
|
||||
specular_light = mix(scene_data.ao_color.rgb,specular_light,ao_light_affect);
|
||||
diffuse_light = mix(scene_data.ao_color.rgb,diffuse_light,ao_light_affect);
|
||||
float ao = texture(sampler2D(ao_buffer, material_samplers[SAMPLER_LINEAR_CLAMP]), screen_uv).r;
|
||||
ambient_light = mix(scene_data.ao_color.rgb, ambient_light, ao);
|
||||
float ao_light_affect = mix(1.0, ao, scene_data.ssao_light_affect);
|
||||
specular_light = mix(scene_data.ao_color.rgb, specular_light, ao_light_affect);
|
||||
diffuse_light = mix(scene_data.ao_color.rgb, diffuse_light, ao_light_affect);
|
||||
}
|
||||
|
||||
#endif // AO_USED
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
layout(push_constant, binding = 0, std430) uniform DrawCall {
|
||||
uint instance_index;
|
||||
uint pad[3]; //16 bits minimum size
|
||||
} draw_call;
|
||||
}
|
||||
draw_call;
|
||||
|
||||
/* Set 0 Scene data that never changes, ever */
|
||||
|
||||
|
@ -101,7 +102,8 @@ layout(set = 0, binding = 3, std140) uniform SceneData {
|
|||
float fog_height_max;
|
||||
float fog_height_curve;
|
||||
#endif
|
||||
} scene_data;
|
||||
}
|
||||
scene_data;
|
||||
|
||||
#define INSTANCE_FLAGS_FORWARD_MASK 0x7
|
||||
#define INSTANCE_FLAGS_FORWARD_OMNI_LIGHT_SHIFT 3
|
||||
|
@ -129,7 +131,8 @@ struct InstanceData {
|
|||
|
||||
layout(set = 0, binding = 4, std430) buffer Instances {
|
||||
InstanceData data[];
|
||||
} instances;
|
||||
}
|
||||
instances;
|
||||
|
||||
struct LightData { //this structure needs to be 128 bits
|
||||
vec3 position;
|
||||
|
@ -146,7 +149,8 @@ struct LightData { //this structure needs to be 128 bits
|
|||
|
||||
layout(set = 0, binding = 5, std140) uniform Lights {
|
||||
LightData data[MAX_LIGHT_DATA_STRUCTS];
|
||||
} lights;
|
||||
}
|
||||
lights;
|
||||
|
||||
struct ReflectionData {
|
||||
|
||||
|
@ -162,7 +166,8 @@ struct ReflectionData {
|
|||
|
||||
layout(set = 0, binding = 6, std140) uniform ReflectionProbeData {
|
||||
ReflectionData data[MAX_REFLECTION_DATA_STRUCTS];
|
||||
} reflections;
|
||||
}
|
||||
reflections;
|
||||
|
||||
struct DirectionalLightData {
|
||||
vec3 direction;
|
||||
|
@ -184,7 +189,8 @@ struct DirectionalLightData {
|
|||
|
||||
layout(set = 0, binding = 7, std140) uniform DirectionalLights {
|
||||
DirectionalLightData data[MAX_DIRECTIONAL_LIGHT_DATA_STRUCTS];
|
||||
} directional_lights;
|
||||
}
|
||||
directional_lights;
|
||||
|
||||
struct GIProbeData {
|
||||
mat4 xform;
|
||||
|
@ -204,7 +210,8 @@ struct GIProbeData {
|
|||
|
||||
layout(set = 0, binding = 8, std140) uniform GIProbes {
|
||||
GIProbeData data[MAX_GI_PROBES];
|
||||
} gi_probes;
|
||||
}
|
||||
gi_probes;
|
||||
|
||||
layout(set = 0, binding = 9) uniform texture3D gi_probe_textures[MAX_GI_PROBE_TEXTURES];
|
||||
|
||||
|
@ -216,7 +223,8 @@ layout(set = 0, binding = 10) uniform utexture3D cluster_texture;
|
|||
|
||||
layout(set = 0, binding = 11, std430) buffer ClusterData {
|
||||
uint indices[];
|
||||
} cluster_data;
|
||||
}
|
||||
cluster_data;
|
||||
|
||||
layout(set = 0, binding = 12) uniform texture2D directional_shadow_atlas;
|
||||
|
||||
|
@ -234,7 +242,6 @@ layout(set = 1, binding = 0) uniform textureCube radiance_cubemap;
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
/* Set 2, Reflection and Shadow Atlases (view dependant) */
|
||||
|
||||
layout(set = 2, binding = 0) uniform textureCubeArray reflection_atlas;
|
||||
|
@ -253,6 +260,7 @@ layout(set = 3, binding = 4) uniform texture2D ao_buffer;
|
|||
|
||||
layout(set = 4, binding = 0, std430) buffer Transforms {
|
||||
vec4 data[];
|
||||
} transforms;
|
||||
}
|
||||
transforms;
|
||||
|
||||
/* Set 5 User Material */
|
||||
|
|
|
@ -15,7 +15,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
float alpha;
|
||||
float depth;
|
||||
float pad;
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
void main() {
|
||||
|
||||
|
@ -45,7 +46,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
float alpha;
|
||||
float depth;
|
||||
float pad;
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
vec4 texturePanorama(sampler2D pano, vec3 normal) {
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
/* clang-format off */
|
||||
[compute]
|
||||
/* clang-format on */
|
||||
|
||||
#version 450
|
||||
|
||||
VERSION_DEFINES
|
||||
|
||||
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
|
||||
/* clang-format on */
|
||||
|
||||
#define TWO_PI 6.283185307179586476925286766559
|
||||
|
||||
|
@ -76,9 +77,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
vec2 pixel_size;
|
||||
float proj_scale;
|
||||
uint pad;
|
||||
|
||||
} params;
|
||||
|
||||
}
|
||||
params;
|
||||
|
||||
vec3 reconstructCSPosition(vec2 S, float z) {
|
||||
if (params.orthogonal) {
|
||||
|
@ -157,7 +157,6 @@ vec3 getOffsetPosition(ivec2 ssP, float ssR) {
|
|||
// Offset to pixel center
|
||||
P = reconstructCSPosition(vec2(ssP) + vec2(0.5), P.z);
|
||||
|
||||
|
||||
return P;
|
||||
}
|
||||
|
||||
|
@ -178,7 +177,7 @@ float sampleAO(in ivec2 ssC, in vec3 C, in vec3 n_C, in float ssDiskRadius, in f
|
|||
|
||||
ivec2 ssP = ivec2(ssR * unitOffset) + ssC;
|
||||
|
||||
if (any(lessThan(ssP,ivec2(0))) || any(greaterThanEqual(ssP,params.screen_size))) {
|
||||
if (any(lessThan(ssP, ivec2(0))) || any(greaterThanEqual(ssP, params.screen_size))) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
@ -213,25 +212,21 @@ float sampleAO(in ivec2 ssC, in vec3 C, in vec3 n_C, in float ssDiskRadius, in f
|
|||
void main() {
|
||||
// Pixel being shaded
|
||||
ivec2 ssC = ivec2(gl_GlobalInvocationID.xy);
|
||||
if (any(greaterThan(ssC,params.screen_size))) { //too large, do nothing
|
||||
if (any(greaterThan(ssC, params.screen_size))) { //too large, do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
// World space point being shaded
|
||||
vec3 C = getPosition(ssC);
|
||||
|
||||
|
||||
|
||||
#ifdef USE_HALF_SIZE
|
||||
vec3 n_C = texelFetch(source_normal,ssC<<1,0).xyz * 2.0 - 1.0;
|
||||
vec3 n_C = texelFetch(source_normal, ssC << 1, 0).xyz * 2.0 - 1.0;
|
||||
#else
|
||||
vec3 n_C = texelFetch(source_normal,ssC,0).xyz * 2.0 - 1.0;
|
||||
vec3 n_C = texelFetch(source_normal, ssC, 0).xyz * 2.0 - 1.0;
|
||||
#endif
|
||||
n_C = normalize(n_C);
|
||||
n_C.y = -n_C.y; //because this code reads flipped
|
||||
|
||||
|
||||
|
||||
// Hash function used in the HPG12 AlchemyAO paper
|
||||
float randomPatternRotationAngle = mod(float((3 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 10), TWO_PI);
|
||||
|
||||
|
@ -253,5 +248,5 @@ void main() {
|
|||
|
||||
float A = max(0.0, 1.0 - sum * params.intensity_div_r6 * (5.0 / float(NUM_SAMPLES)));
|
||||
|
||||
imageStore(dest_image,ssC,vec4(A));
|
||||
imageStore(dest_image, ssC, vec4(A));
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
/* clang-format off */
|
||||
[compute]
|
||||
/* clang-format on */
|
||||
|
||||
#version 450
|
||||
|
||||
VERSION_DEFINES
|
||||
|
||||
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D source_ssao;
|
||||
layout(set = 1, binding = 0) uniform sampler2D source_depth;
|
||||
|
@ -31,9 +30,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
uint pad2;
|
||||
ivec2 axis; /** (1, 0) or (0, 1) */
|
||||
ivec2 screen_size;
|
||||
} params;
|
||||
|
||||
|
||||
}
|
||||
params;
|
||||
|
||||
/** Filter radius in pixels. This will be multiplied by SCALE. */
|
||||
#define R (4)
|
||||
|
@ -47,14 +45,11 @@ const float gaussian[R + 1] =
|
|||
float[](0.153170, 0.144893, 0.122649, 0.092902, 0.062970); // stddev = 2.0
|
||||
//float[](0.111220, 0.107798, 0.098151, 0.083953, 0.067458, 0.050920, 0.036108); // stddev = 3.0
|
||||
|
||||
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
// Pixel being shaded
|
||||
ivec2 ssC = ivec2(gl_GlobalInvocationID.xy);
|
||||
if (any(greaterThan(ssC,params.screen_size))) { //too large, do nothing
|
||||
if (any(greaterThan(ssC, params.screen_size))) { //too large, do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -73,22 +68,22 @@ void main() {
|
|||
vec2 pixel_size = 1.0 / vec2(params.screen_size);
|
||||
vec2 closest_uv = vec2(ssC) * pixel_size + pixel_size * 0.5;
|
||||
vec2 from_uv = closest_uv;
|
||||
vec2 ps2 = pixel_size;// * 2.0;
|
||||
vec2 ps2 = pixel_size; // * 2.0;
|
||||
|
||||
float closest_depth = abs(textureLod(source_depth_mipmaps,closest_uv,0.0).r-depth);
|
||||
float closest_depth = abs(textureLod(source_depth_mipmaps, closest_uv, 0.0).r - depth);
|
||||
|
||||
vec2 offsets[4]=vec2[](vec2(ps2.x,0),vec2(-ps2.x,0),vec2(0,ps2.y),vec2(0,-ps2.y));
|
||||
for(int i=0;i<4;i++) {
|
||||
vec2 offsets[4] = vec2[](vec2(ps2.x, 0), vec2(-ps2.x, 0), vec2(0, ps2.y), vec2(0, -ps2.y));
|
||||
for (int i = 0; i < 4; i++) {
|
||||
vec2 neighbour = from_uv + offsets[i];
|
||||
float neighbour_depth = abs(textureLod(source_depth_mipmaps,neighbour,0.0).r-depth);
|
||||
if (neighbour_depth < closest_depth ) {
|
||||
float neighbour_depth = abs(textureLod(source_depth_mipmaps, neighbour, 0.0).r - depth);
|
||||
if (neighbour_depth < closest_depth) {
|
||||
closest_uv = neighbour;
|
||||
closest_depth = neighbour_depth;
|
||||
}
|
||||
}
|
||||
|
||||
float visibility = textureLod(source_ssao,closest_uv,0.0).r;
|
||||
imageStore(dest_image,ssC,vec4(visibility));
|
||||
float visibility = textureLod(source_ssao, closest_uv, 0.0).r;
|
||||
imageStore(dest_image, ssC, vec4(visibility));
|
||||
#else
|
||||
|
||||
float depth = texelFetch(source_depth, ssC, 0).r;
|
||||
|
@ -132,7 +127,6 @@ void main() {
|
|||
float value = texelFetch(source_ssao, clamp(ppos, ivec2(0), clamp_limit), 0).r;
|
||||
ivec2 rpos = clamp(ppos, ivec2(0), clamp_limit);
|
||||
|
||||
|
||||
float temp_depth = texelFetch(source_depth, rpos, 0).r;
|
||||
#ifdef MODE_FULL_SIZE
|
||||
temp_depth = temp_depth * 2.0 - 1.0;
|
||||
|
@ -158,6 +152,6 @@ void main() {
|
|||
const float epsilon = 0.0001;
|
||||
float visibility = sum / (totalWeight + epsilon);
|
||||
|
||||
imageStore(dest_image,ssC,vec4(visibility));
|
||||
imageStore(dest_image, ssC, vec4(visibility));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* clang-format off */
|
||||
[compute]
|
||||
/* clang-format on */
|
||||
|
||||
#version 450
|
||||
|
||||
VERSION_DEFINES
|
||||
|
||||
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
|
||||
/* clang-format on */
|
||||
|
||||
layout(push_constant, binding = 1, std430) uniform Params {
|
||||
vec2 pixel_size;
|
||||
|
@ -15,8 +15,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
ivec2 source_size;
|
||||
bool orthogonal;
|
||||
uint pad;
|
||||
} params;
|
||||
|
||||
}
|
||||
params;
|
||||
|
||||
#ifdef MINIFY_START
|
||||
layout(set = 0, binding = 0) uniform sampler2D source_texture;
|
||||
|
@ -29,21 +29,20 @@ void main() {
|
|||
|
||||
ivec2 pos = ivec2(gl_GlobalInvocationID.xy);
|
||||
|
||||
if (any(greaterThan(pos,params.source_size>>1))) { //too large, do nothing
|
||||
if (any(greaterThan(pos, params.source_size >> 1))) { //too large, do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef MINIFY_START
|
||||
float depth = texelFetch(source_texture,pos<<1,0).r * 2.0 - 1.0;
|
||||
float depth = texelFetch(source_texture, pos << 1, 0).r * 2.0 - 1.0;
|
||||
if (params.orthogonal) {
|
||||
depth = ((depth + (params.z_far + params.z_near) / (params.z_far - params.z_near)) * (params.z_far - params.z_near)) / 2.0;
|
||||
} else {
|
||||
depth = 2.0 * params.z_near * params.z_far / (params.z_far + params.z_near - depth * (params.z_far - params.z_near));
|
||||
}
|
||||
#else
|
||||
float depth = imageLoad(source_image,pos<<1).r;
|
||||
float depth = imageLoad(source_image, pos << 1).r;
|
||||
#endif
|
||||
|
||||
imageStore(dest_image,pos,vec4(depth));
|
||||
|
||||
imageStore(dest_image, pos, vec4(depth));
|
||||
}
|
||||
|
|
|
@ -48,7 +48,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||
float exposure;
|
||||
float white;
|
||||
float auto_exposure_grey;
|
||||
} params;
|
||||
}
|
||||
params;
|
||||
|
||||
layout(location = 0) out vec4 frag_color;
|
||||
|
||||
|
@ -270,8 +271,7 @@ void main() {
|
|||
if (params.use_glow && params.glow_mode == GLOW_MODE_MIX) {
|
||||
|
||||
vec3 glow = gather_glow(source_glow, uv_interp);
|
||||
color.rgb = mix(color.rgb,glow,params.glow_intensity);
|
||||
|
||||
color.rgb = mix(color.rgb, glow, params.glow_intensity);
|
||||
}
|
||||
|
||||
color = apply_tonemapping(color, params.white);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
|
|
@ -547,6 +547,11 @@ Files extracted from upstream source:
|
|||
`loader/` folder
|
||||
- `LICENSE.txt`
|
||||
|
||||
`vk_enum_string_helper.h` is taken from the match `Vulkan-ValidationLayers` SDK
|
||||
release: https://github.com/KhronosGroup/Vulkan-Loader/tree/master/loader/generated
|
||||
|
||||
`vk_mem_alloc.h` is taken from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
|
||||
|
||||
|
||||
## wslay
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue