Fix code formatting issues and VS compilation
Also temporarily disable multicheck build so that we get a full build even when there are style issues on Vulkan. Fixes #33356.
This commit is contained in:
parent
4b2351f341
commit
1bad89b90d
@ -4,7 +4,6 @@ language: cpp
|
|||||||
dist: xenial
|
dist: xenial
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- check
|
|
||||||
- build
|
- build
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@ -21,7 +20,7 @@ cache:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- name: Static checks (clang-format) + Documentation checks
|
- name: Static checks (clang-format) + Documentation checks
|
||||||
stage: check
|
stage: build
|
||||||
env: STATIC_CHECKS=yes
|
env: STATIC_CHECKS=yes
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* vector3i.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. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "vector3i.h"
|
#include "vector3i.h"
|
||||||
|
|
||||||
void Vector3i::set_axis(int p_axis, int32_t p_value) {
|
void Vector3i::set_axis(int p_axis, int32_t p_value) {
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* vector3i.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) */
|
||||||
|
/* */
|
||||||
|
/* 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 VECTOR3I_H
|
#ifndef VECTOR3I_H
|
||||||
#define VECTOR3I_H
|
#define VECTOR3I_H
|
||||||
|
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* rid_owner.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. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "rid_owner.h"
|
#include "rid_owner.h"
|
||||||
|
|
||||||
volatile uint64_t RID_AllocBase::base_id = 1;
|
volatile uint64_t RID_AllocBase::base_id = 1;
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* rid_owner.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) */
|
||||||
|
/* */
|
||||||
|
/* 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 RID_OWNER_H
|
#ifndef RID_OWNER_H
|
||||||
#define RID_OWNER_H
|
#define RID_OWNER_H
|
||||||
|
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* spin_lock.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) */
|
||||||
|
/* */
|
||||||
|
/* 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 SPIN_LOCK_H
|
#ifndef SPIN_LOCK_H
|
||||||
#define SPIN_LOCK_H
|
#define SPIN_LOCK_H
|
||||||
|
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* thread_work_pool.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. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "thread_work_pool.h"
|
#include "thread_work_pool.h"
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
|
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* thread_work_pool.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) */
|
||||||
|
/* */
|
||||||
|
/* 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 THREAD_WORK_POOL_H
|
#ifndef THREAD_WORK_POOL_H
|
||||||
#define THREAD_WORK_POOL_H
|
#define THREAD_WORK_POOL_H
|
||||||
|
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* editor_visual_profiler.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. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "editor_visual_profiler.h"
|
#include "editor_visual_profiler.h"
|
||||||
|
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* editor_visual_profiler.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) */
|
||||||
|
/* */
|
||||||
|
/* 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 EDITOR_FRAME_PROFILER_H
|
#ifndef EDITOR_FRAME_PROFILER_H
|
||||||
#define EDITOR_FRAME_PROFILER_H
|
#define EDITOR_FRAME_PROFILER_H
|
||||||
|
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* resource_importer_layered_texture.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) */
|
||||||
|
/* */
|
||||||
|
/* 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. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* resource_importer_layered_texture.h */
|
/* resource_importer_layered_texture.h */
|
||||||
|
@ -136,7 +136,6 @@ void GIProbeEditorPlugin::_bind_methods() {
|
|||||||
|
|
||||||
ClassDB::bind_method("_bake", &GIProbeEditorPlugin::_bake);
|
ClassDB::bind_method("_bake", &GIProbeEditorPlugin::_bake);
|
||||||
ClassDB::bind_method("_giprobe_save_path_and_bake", &GIProbeEditorPlugin::_giprobe_save_path_and_bake);
|
ClassDB::bind_method("_giprobe_save_path_and_bake", &GIProbeEditorPlugin::_giprobe_save_path_and_bake);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) {
|
GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) {
|
||||||
|
@ -57,7 +57,6 @@ class GIProbeEditorPlugin : public EditorPlugin {
|
|||||||
void _bake();
|
void _bake();
|
||||||
void _giprobe_save_path_and_bake(const String &p_path);
|
void _giprobe_save_path_and_bake(const String &p_path);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* register_types.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. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "register_types.h"
|
#include "register_types.h"
|
||||||
|
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* texture_basisu.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. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "texture_basisu.h"
|
#include "texture_basisu.h"
|
||||||
#if 0
|
#if 0
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* texture_basisu.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) */
|
||||||
|
/* */
|
||||||
|
/* 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 "scene/resources/texture.h"
|
#include "scene/resources/texture.h"
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
|
@ -1928,7 +1928,6 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
|
|||||||
|
|
||||||
cursors_cache.erase(p_shape);
|
cursors_cache.erase(p_shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OS_OSX::set_mouse_show(bool p_show) {
|
void OS_OSX::set_mouse_show(bool p_show) {
|
||||||
|
@ -1450,7 +1450,6 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
|
|||||||
context_gles2 = NULL;
|
context_gles2 = NULL;
|
||||||
ERR_FAIL_V(ERR_UNAVAILABLE);
|
ERR_FAIL_V(ERR_UNAVAILABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
@ -1652,7 +1651,6 @@ void OS_Windows::finalize() {
|
|||||||
|
|
||||||
if (context_gles2)
|
if (context_gles2)
|
||||||
memdelete(context_gles2);
|
memdelete(context_gles2);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(VULKAN_ENABLED)
|
#if defined(VULKAN_ENABLED)
|
||||||
|
@ -415,7 +415,6 @@ Vector3i GIProbe::get_estimated_cell_size() const {
|
|||||||
int longest_axis = bounds.get_longest_axis_index();
|
int longest_axis = bounds.get_longest_axis_index();
|
||||||
axis_cell_size[longest_axis] = 1 << cell_subdiv;
|
axis_cell_size[longest_axis] = 1 << cell_subdiv;
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
|
|
||||||
if (i == longest_axis)
|
if (i == longest_axis)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* voxel_light_baker.cpp */
|
/* voxelizer.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* voxel_light_baker.h */
|
/* voxelizer.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* rasterizer_effects_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) */
|
||||||
|
/* */
|
||||||
|
/* 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 "rasterizer_effects_rd.h"
|
#include "rasterizer_effects_rd.h"
|
||||||
|
|
||||||
static _FORCE_INLINE_ void store_transform_3x3(const Basis &p_basis, float *p_array) {
|
static _FORCE_INLINE_ void store_transform_3x3(const Basis &p_basis, float *p_array) {
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* rasterizer_effects_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) */
|
||||||
|
/* */
|
||||||
|
/* 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 RASTERIZER_EFFECTS_RD_H
|
#ifndef RASTERIZER_EFFECTS_RD_H
|
||||||
#define RASTERIZER_EFFECTS_RD_H
|
#define RASTERIZER_EFFECTS_RD_H
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* rasterizer_rd.cpp */
|
/* rasterizer_rd.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -1556,7 +1556,7 @@ void RasterizerSceneForwardRD::_setup_gi_probes(RID *p_gi_probe_probe_cull_resul
|
|||||||
gi_probe_ubo.texture_slot = gi_probe_instance_get_slot(rpi);
|
gi_probe_ubo.texture_slot = gi_probe_instance_get_slot(rpi);
|
||||||
gi_probe_ubo.anisotropy_strength = storage->gi_probe_get_anisotropy_strength(base_probe);
|
gi_probe_ubo.anisotropy_strength = storage->gi_probe_get_anisotropy_strength(base_probe);
|
||||||
gi_probe_ubo.ao = storage->gi_probe_get_ao(base_probe);
|
gi_probe_ubo.ao = storage->gi_probe_get_ao(base_probe);
|
||||||
gi_probe_ubo.ao_size = Math::pow(storage->gi_probe_get_ao_size(base_probe),4.0);
|
gi_probe_ubo.ao_size = Math::pow(storage->gi_probe_get_ao_size(base_probe), 4.0f);
|
||||||
|
|
||||||
if (gi_probe_is_anisotropic()) {
|
if (gi_probe_is_anisotropic()) {
|
||||||
gi_probe_ubo.texture_slot *= 3;
|
gi_probe_ubo.texture_slot *= 3;
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* rasterizer_scene_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) */
|
||||||
|
/* */
|
||||||
|
/* 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 "rasterizer_scene_rd.h"
|
#include "rasterizer_scene_rd.h"
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "core/project_settings.h"
|
#include "core/project_settings.h"
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* rasterizer_scene_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) */
|
||||||
|
/* */
|
||||||
|
/* 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 RASTERIZER_SCENE_RD_H
|
#ifndef RASTERIZER_SCENE_RD_H
|
||||||
#define RASTERIZER_SCENE_RD_H
|
#define RASTERIZER_SCENE_RD_H
|
||||||
|
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* shader_compiler_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) */
|
||||||
|
/* */
|
||||||
|
/* 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 "shader_compiler_rd.h"
|
#include "shader_compiler_rd.h"
|
||||||
|
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*************************************************************************/
|
||||||
|
/* shader_compiler_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) */
|
||||||
|
/* */
|
||||||
|
/* 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 SHADER_COMPILER_RD_H
|
#ifndef SHADER_COMPILER_RD_H
|
||||||
#define SHADER_COMPILER_RD_H
|
#define SHADER_COMPILER_RD_H
|
||||||
|
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[vertex]
|
[vertex]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#include "blur_inc.glsl"
|
#include "blur_inc.glsl"
|
||||||
|
|
||||||
layout(location = 0) out vec2 uv_interp;
|
layout(location = 0) out vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
@ -26,22 +24,19 @@ void main() {
|
|||||||
if (bool(blur.flags & FLAG_FLIP_Y)) {
|
if (bool(blur.flags & FLAG_FLIP_Y)) {
|
||||||
uv_interp.y = 1.0 - uv_interp.y;
|
uv_interp.y = 1.0 - uv_interp.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[fragment]
|
[fragment]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#include "blur_inc.glsl"
|
#include "blur_inc.glsl"
|
||||||
|
|
||||||
layout(location = 0) in vec2 uv_interp;
|
layout(location = 0) in vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
layout(set = 0, binding = 0) uniform sampler2D source_color;
|
layout(set = 0, binding = 0) uniform sampler2D source_color;
|
||||||
|
|
||||||
@ -53,7 +48,6 @@ layout( set=1, binding=0 ) uniform sampler2D source_ssao;
|
|||||||
layout(set = 1, binding = 0) uniform sampler2D source_auto_exposure;
|
layout(set = 1, binding = 0) uniform sampler2D source_auto_exposure;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 frag_color;
|
layout(location = 0) out vec4 frag_color;
|
||||||
|
|
||||||
//DOF
|
//DOF
|
||||||
@ -86,7 +80,6 @@ const float dof_kernel[21] = float[](0.028174, 0.032676, 0.037311, 0.041944, 0.0
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
#ifdef MODE_MIPMAP
|
#ifdef MODE_MIPMAP
|
||||||
@ -128,8 +121,6 @@ void main() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODE_GAUSSIAN_GLOW
|
#ifdef MODE_GAUSSIAN_GLOW
|
||||||
|
|
||||||
//Glow uses larger sigma 1 for a more rounded blur effect
|
//Glow uses larger sigma 1 for a more rounded blur effect
|
||||||
@ -159,7 +150,6 @@ void main() {
|
|||||||
frag_color = color;
|
frag_color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (bool(blur.flags & FLAG_GLOW_FIRST_PASS)) {
|
if (bool(blur.flags & FLAG_GLOW_FIRST_PASS)) {
|
||||||
#ifdef GLOW_USE_AUTO_EXPOSURE
|
#ifdef GLOW_USE_AUTO_EXPOSURE
|
||||||
|
|
||||||
@ -173,7 +163,6 @@ void main() {
|
|||||||
frag_color = min(frag_color * feedback, vec4(blur.glow_luminance_cap));
|
frag_color = min(frag_color * feedback, vec4(blur.glow_luminance_cap));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MODE_DOF_FAR_BLUR
|
#ifdef MODE_DOF_FAR_BLUR
|
||||||
|
@ -10,7 +10,7 @@ layout(push_constant, binding = 1, std430) uniform Blur {
|
|||||||
vec2 pixel_size;
|
vec2 pixel_size;
|
||||||
uint flags;
|
uint flags;
|
||||||
uint pad;
|
uint pad;
|
||||||
//glow
|
// Glow.
|
||||||
float glow_strength;
|
float glow_strength;
|
||||||
float glow_bloom;
|
float glow_bloom;
|
||||||
float glow_hdr_threshold;
|
float glow_hdr_threshold;
|
||||||
@ -19,7 +19,7 @@ layout(push_constant, binding = 1, std430) uniform Blur {
|
|||||||
float glow_white;
|
float glow_white;
|
||||||
float glow_luminance_cap;
|
float glow_luminance_cap;
|
||||||
float glow_auto_exposure_grey;
|
float glow_auto_exposure_grey;
|
||||||
//dof
|
// DOF.
|
||||||
float dof_begin;
|
float dof_begin;
|
||||||
float dof_end;
|
float dof_end;
|
||||||
float dof_radius;
|
float dof_radius;
|
||||||
@ -30,7 +30,4 @@ layout(push_constant, binding = 1, std430) uniform Blur {
|
|||||||
float camera_z_near;
|
float camera_z_near;
|
||||||
|
|
||||||
vec4 ssao_color;
|
vec4 ssao_color;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} blur;
|
} blur;
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[vertex]
|
[vertex]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#ifdef USE_ATTRIBUTES
|
#ifdef USE_ATTRIBUTES
|
||||||
layout(location = 0) in vec2 vertex_attrib;
|
layout(location = 0) in vec2 vertex_attrib;
|
||||||
|
/* clang-format on */
|
||||||
layout(location = 3) in vec4 color_attrib;
|
layout(location = 3) in vec4 color_attrib;
|
||||||
layout(location = 4) in vec2 uv_attrib;
|
layout(location = 4) in vec2 uv_attrib;
|
||||||
|
|
||||||
@ -19,7 +17,6 @@ layout(location = 6) in uvec4 bones_attrib;
|
|||||||
|
|
||||||
#include "canvas_uniforms_inc.glsl"
|
#include "canvas_uniforms_inc.glsl"
|
||||||
|
|
||||||
|
|
||||||
layout(location = 0) out vec2 uv_interp;
|
layout(location = 0) out vec2 uv_interp;
|
||||||
layout(location = 1) out vec4 color_interp;
|
layout(location = 1) out vec4 color_interp;
|
||||||
layout(location = 2) out vec2 vertex_interp;
|
layout(location = 2) out vec2 vertex_interp;
|
||||||
@ -42,7 +39,6 @@ MATERIAL_UNIFORMS
|
|||||||
VERTEX_SHADER_GLOBALS
|
VERTEX_SHADER_GLOBALS
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
vec4 instance_custom = vec4(0.0);
|
vec4 instance_custom = vec4(0.0);
|
||||||
@ -89,8 +85,8 @@ void main() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
mat4 world_matrix = mat4(vec4(draw_data.world_x, 0.0, 0.0), vec4(draw_data.world_y, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(draw_data.world_ofs, 0.0, 1.0));
|
mat4 world_matrix = mat4(vec4(draw_data.world_x, 0.0, 0.0), vec4(draw_data.world_y, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(draw_data.world_ofs, 0.0, 1.0));
|
||||||
#if 0
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (draw_data.flags & FLAGS_INSTANCING_ENABLED) {
|
if (draw_data.flags & FLAGS_INSTANCING_ENABLED) {
|
||||||
|
|
||||||
uint offset = draw_data.flags & FLAGS_INSTANCING_STRIDE_MASK;
|
uint offset = draw_data.flags & FLAGS_INSTANCING_STRIDE_MASK;
|
||||||
@ -122,7 +118,6 @@ void main() {
|
|||||||
instance_custom = vec4(texelFetch(instancing_buffer, offset + 0), texelFetch(instancing_buffer, offset + 1), texelFetch(instancing_buffer, offset + 2), texelFetch(instancing_buffer, offset + 3));
|
instance_custom = vec4(texelFetch(instancing_buffer, offset + 0), texelFetch(instancing_buffer, offset + 1), texelFetch(instancing_buffer, offset + 2), texelFetch(instancing_buffer, offset + 3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -143,8 +138,6 @@ VERTEX_SHADER_CODE
|
|||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_NINEPATCH
|
#ifdef USE_NINEPATCH
|
||||||
pixel_size_interp = abs(draw_data.dst_rect.zw) * vertex_base;
|
pixel_size_interp = abs(draw_data.dst_rect.zw) * vertex_base;
|
||||||
#endif
|
#endif
|
||||||
@ -206,7 +199,6 @@ VERTEX_SHADER_CODE
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
vertex = (canvas_data.canvas_transform * vec4(vertex, 0.0, 1.0)).xy;
|
vertex = (canvas_data.canvas_transform * vec4(vertex, 0.0, 1.0)).xy;
|
||||||
|
|
||||||
vertex_interp = vertex;
|
vertex_interp = vertex;
|
||||||
@ -217,7 +209,6 @@ VERTEX_SHADER_CODE
|
|||||||
#ifdef USE_POINT_SIZE
|
#ifdef USE_POINT_SIZE
|
||||||
gl_PointSize = point_size;
|
gl_PointSize = point_size;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
@ -225,13 +216,12 @@ VERTEX_SHADER_CODE
|
|||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#include "canvas_uniforms_inc.glsl"
|
#include "canvas_uniforms_inc.glsl"
|
||||||
|
|
||||||
layout(location = 0) in vec2 uv_interp;
|
layout(location = 0) in vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
layout(location = 1) in vec4 color_interp;
|
layout(location = 1) in vec4 color_interp;
|
||||||
layout(location = 2) in vec2 vertex_interp;
|
layout(location = 2) in vec2 vertex_interp;
|
||||||
|
|
||||||
@ -251,7 +241,6 @@ MATERIAL_UNIFORMS
|
|||||||
} material;
|
} material;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
FRAGMENT_SHADER_GLOBALS
|
FRAGMENT_SHADER_GLOBALS
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
@ -318,7 +307,6 @@ float map_ninepatch_axis(float pixel, float draw_size, float tex_pixel_size, flo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
@ -354,7 +342,6 @@ void main() {
|
|||||||
|
|
||||||
uint light_count = (draw_data.flags >> FLAGS_LIGHT_COUNT_SHIFT) & 0xF; //max 16 lights
|
uint light_count = (draw_data.flags >> FLAGS_LIGHT_COUNT_SHIFT) & 0xF; //max 16 lights
|
||||||
|
|
||||||
|
|
||||||
vec3 normal;
|
vec3 normal;
|
||||||
|
|
||||||
#if defined(NORMAL_USED)
|
#if defined(NORMAL_USED)
|
||||||
@ -364,7 +351,6 @@ void main() {
|
|||||||
bool normal_used = false;
|
bool normal_used = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (normal_used || (light_count > 0 && bool(draw_data.flags & FLAGS_DEFAULT_NORMAL_MAP_USED))) {
|
if (normal_used || (light_count > 0 && bool(draw_data.flags & FLAGS_DEFAULT_NORMAL_MAP_USED))) {
|
||||||
normal.xy = texture(sampler2D(normal_texture, texture_sampler), uv).xy * vec2(2.0, -2.0) - vec2(1.0, -1.0);
|
normal.xy = texture(sampler2D(normal_texture, texture_sampler), uv).xy * vec2(2.0, -2.0) - vec2(1.0, -1.0);
|
||||||
normal.z = sqrt(1.0 - dot(normal.xy, normal.xy));
|
normal.z = sqrt(1.0 - dot(normal.xy, normal.xy));
|
||||||
@ -390,7 +376,6 @@ void main() {
|
|||||||
specular_shininess = vec4(1.0);
|
specular_shininess = vec4(1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(SCREEN_UV_USED)
|
#if defined(SCREEN_UV_USED)
|
||||||
vec2 screen_uv = gl_FragCoord.xy * canvas_data.screen_pixel_size;
|
vec2 screen_uv = gl_FragCoord.xy * canvas_data.screen_pixel_size;
|
||||||
#else
|
#else
|
||||||
@ -426,7 +411,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
normal = normalize((canvas_data.canvas_normal_transform * vec4(normal, 0.0)).xyz);
|
normal = normalize((canvas_data.canvas_normal_transform * vec4(normal, 0.0)).xyz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vec4 base_color = color;
|
vec4 base_color = color;
|
||||||
if (bool(draw_data.flags & FLAGS_USING_LIGHT_MASK)) {
|
if (bool(draw_data.flags & FLAGS_USING_LIGHT_MASK)) {
|
||||||
color = vec4(0.0); //inivisible by default due to using light mask
|
color = vec4(0.0); //inivisible by default due to using light mask
|
||||||
@ -468,7 +452,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
light_color = light_compute(light_vertex, light_position, normal, light_color, light_base_color.a, specular_shininess, shadow_modulate, screen_uv, color, uv);
|
light_color = light_compute(light_vertex, light_position, normal, light_color, light_base_color.a, specular_shininess, shadow_modulate, screen_uv, color, uv);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
||||||
light_color.rgb *= light_base_color.rgb * light_base_color.a;
|
light_color.rgb *= light_base_color.rgb * light_base_color.a;
|
||||||
|
|
||||||
if (normal_used) {
|
if (normal_used) {
|
||||||
@ -496,7 +479,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
} else {
|
} else {
|
||||||
light_color.rgb *= cNdotL;
|
light_color.rgb *= cNdotL;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (any(lessThan(tex_uv, vec2(0.0, 0.0))) || any(greaterThanEqual(tex_uv, vec2(1.0, 1.0)))) {
|
if (any(lessThan(tex_uv, vec2(0.0, 0.0))) || any(greaterThanEqual(tex_uv, vec2(1.0, 1.0)))) {
|
||||||
@ -573,7 +555,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
shadow_color *= shadow_modulate;
|
shadow_color *= shadow_modulate;
|
||||||
#endif
|
#endif
|
||||||
light_color = mix(light_color, shadow_color, shadow);
|
light_color = mix(light_color, shadow_color, shadow);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint blend_mode = light_array.data[light_base].flags & LIGHT_FLAGS_BLEND_MASK;
|
uint blend_mode = light_array.data[light_base].flags & LIGHT_FLAGS_BLEND_MASK;
|
||||||
@ -597,5 +578,4 @@ FRAGMENT_SHADER_CODE
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
frag_color = color;
|
frag_color = color;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[vertex]
|
[vertex]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
layout(location = 0) in highp vec3 vertex;
|
layout(location = 0) in highp vec3 vertex;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
layout(push_constant, binding = 0, std430) uniform Constants {
|
layout(push_constant, binding = 0, std430) uniform Constants {
|
||||||
|
|
||||||
@ -22,16 +22,15 @@ void main() {
|
|||||||
depth = dot(constants.direction, vtx.xy);
|
depth = dot(constants.direction, vtx.xy);
|
||||||
|
|
||||||
gl_Position = constants.projection * vtx;
|
gl_Position = constants.projection * vtx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[fragment]
|
[fragment]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
layout(location = 0) in highp float depth;
|
layout(location = 0) in highp float depth;
|
||||||
|
/* clang-format on */
|
||||||
layout(location = 0) out highp float distance_buf;
|
layout(location = 0) out highp float distance_buf;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define M_PI 3.14159265359
|
#define M_PI 3.14159265359
|
||||||
|
|
||||||
#define FLAGS_INSTANCING_STRIDE_MASK 0xF
|
#define FLAGS_INSTANCING_STRIDE_MASK 0xF
|
||||||
@ -53,7 +50,6 @@ layout(push_constant, binding = 0, std430) uniform DrawData {
|
|||||||
#endif
|
#endif
|
||||||
vec2 color_texture_pixel_size;
|
vec2 color_texture_pixel_size;
|
||||||
uint lights[4];
|
uint lights[4];
|
||||||
|
|
||||||
} draw_data;
|
} draw_data;
|
||||||
|
|
||||||
// The values passed per draw primitives are cached within it
|
// The values passed per draw primitives are cached within it
|
||||||
@ -67,7 +63,6 @@ layout(set = 0, binding = 5) uniform textureBuffer instancing_buffer;
|
|||||||
|
|
||||||
/* SET1: Is reserved for the material */
|
/* SET1: Is reserved for the material */
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_MATERIAL_SAMPLERS
|
#ifdef USE_MATERIAL_SAMPLERS
|
||||||
|
|
||||||
layout(set = 1, binding = 0) uniform sampler material_samplers[12];
|
layout(set = 1, binding = 0) uniform sampler material_samplers[12];
|
||||||
@ -76,7 +71,6 @@ layout(set = 1, binding = 0) uniform sampler material_samplers[12];
|
|||||||
|
|
||||||
/* SET2: Canvas Item State (including lighting) */
|
/* SET2: Canvas Item State (including lighting) */
|
||||||
|
|
||||||
|
|
||||||
layout(set = 2, binding = 0, std140) uniform CanvasData {
|
layout(set = 2, binding = 0, std140) uniform CanvasData {
|
||||||
mat4 canvas_transform;
|
mat4 canvas_transform;
|
||||||
mat4 screen_transform;
|
mat4 screen_transform;
|
||||||
@ -95,7 +89,6 @@ layout(set = 2, binding = 2, std140) uniform SkeletonData {
|
|||||||
mat4 skeleton_transform_inverse;
|
mat4 skeleton_transform_inverse;
|
||||||
} skeleton_data;
|
} skeleton_data;
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_LIGHTING
|
#ifdef USE_LIGHTING
|
||||||
|
|
||||||
#define LIGHT_FLAGS_BLEND_MASK (3 << 16)
|
#define LIGHT_FLAGS_BLEND_MASK (3 << 16)
|
||||||
@ -110,7 +103,6 @@ layout(set = 2, binding = 2, std140) uniform SkeletonData {
|
|||||||
#define LIGHT_FLAGS_SHADOW_PCF5 (1 << 22)
|
#define LIGHT_FLAGS_SHADOW_PCF5 (1 << 22)
|
||||||
#define LIGHT_FLAGS_SHADOW_PCF13 (2 << 22)
|
#define LIGHT_FLAGS_SHADOW_PCF13 (2 << 22)
|
||||||
|
|
||||||
|
|
||||||
struct Light {
|
struct Light {
|
||||||
mat2x4 matrix; //light to texture coordinate matrix (transposed)
|
mat2x4 matrix; //light to texture coordinate matrix (transposed)
|
||||||
mat2x4 shadow_matrix; //light to shadow coordinate matrix (transposed)
|
mat2x4 shadow_matrix; //light to shadow coordinate matrix (transposed)
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[vertex]
|
[vertex]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
layout(location = 0) out vec2 uv_interp;
|
layout(location = 0) out vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
@ -16,20 +14,17 @@ void main() {
|
|||||||
uv_interp = base_arr[gl_VertexIndex];
|
uv_interp = base_arr[gl_VertexIndex];
|
||||||
|
|
||||||
gl_Position = vec4(uv_interp * 2.0 - 1.0, 0.0, 1.0);
|
gl_Position = vec4(uv_interp * 2.0 - 1.0, 0.0, 1.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[fragment]
|
[fragment]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
layout(location = 0) in vec2 uv_interp;
|
layout(location = 0) in vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
#ifdef MODE_CUBE_TO_DP
|
#ifdef MODE_CUBE_TO_DP
|
||||||
|
|
||||||
@ -40,14 +35,12 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||||||
float z_far;
|
float z_far;
|
||||||
float z_near;
|
float z_near;
|
||||||
bool z_flip;
|
bool z_flip;
|
||||||
|
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
layout(location = 0) out float depth_buffer;
|
layout(location = 0) out float depth_buffer;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
#ifdef MODE_CUBE_TO_DP
|
#ifdef MODE_CUBE_TO_DP
|
||||||
@ -57,7 +50,6 @@ void main() {
|
|||||||
normal.z = 0.5 - 0.5 * ((normal.x * normal.x) + (normal.y * normal.y));
|
normal.z = 0.5 - 0.5 * ((normal.x * normal.x) + (normal.y * normal.y));
|
||||||
normal = normalize(normal);
|
normal = normalize(normal);
|
||||||
|
|
||||||
|
|
||||||
normal.y = -normal.y; //needs to be flipped to match projection matrix
|
normal.y = -normal.y; //needs to be flipped to match projection matrix
|
||||||
if (!params.z_flip) {
|
if (!params.z_flip) {
|
||||||
normal.z = -normal.z;
|
normal.z = -normal.z;
|
||||||
|
@ -1,37 +1,30 @@
|
|||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[vertex]
|
[vertex]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
|
|
||||||
layout(location = 0) out highp vec2 uv_interp;
|
layout(location = 0) out highp vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
vec2 base_arr[4] = vec2[](vec2(0.0, 0.0), vec2(0.0, 1.0), vec2(1.0, 1.0), vec2(1.0, 0.0));
|
vec2 base_arr[4] = vec2[](vec2(0.0, 0.0), vec2(0.0, 1.0), vec2(1.0, 1.0), vec2(1.0, 0.0));
|
||||||
uv_interp = base_arr[gl_VertexIndex];
|
uv_interp = base_arr[gl_VertexIndex];
|
||||||
gl_Position = vec4(uv_interp * 2.0 - 1.0, 0.0, 1.0);
|
gl_Position = vec4(uv_interp * 2.0 - 1.0, 0.0, 1.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[fragment]
|
[fragment]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#ifdef MODE_SOURCE_PANORAMA
|
#ifdef MODE_SOURCE_PANORAMA
|
||||||
layout(set = 0, binding = 0) uniform sampler2D source_panorama;
|
layout(set = 0, binding = 0) uniform sampler2D source_panorama;
|
||||||
|
/* clang-format on */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MODE_SOURCE_CUBEMAP
|
#ifdef MODE_SOURCE_CUBEMAP
|
||||||
@ -184,7 +177,6 @@ vec4 texturePanorama(vec3 normal, sampler2D pano) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
vec2 uv = (uv_interp * 2.0) - 1.0;
|
vec2 uv = (uv_interp * 2.0) - 1.0;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* clang-format off */
|
||||||
[compute]
|
[compute]
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
@ -5,14 +6,11 @@
|
|||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
|
|
||||||
#ifdef MODE_DYNAMIC
|
#ifdef MODE_DYNAMIC
|
||||||
|
|
||||||
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
|
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
#ifndef MODE_DYNAMIC
|
#ifndef MODE_DYNAMIC
|
||||||
|
|
||||||
@ -38,7 +36,6 @@ layout(set=0,binding=2,std430) buffer CellDataBuffer {
|
|||||||
CellData data[];
|
CellData data[];
|
||||||
} cell_data;
|
} cell_data;
|
||||||
|
|
||||||
|
|
||||||
#endif // MODE DYNAMIC
|
#endif // MODE DYNAMIC
|
||||||
|
|
||||||
#define LIGHT_TYPE_DIRECTIONAL 0
|
#define LIGHT_TYPE_DIRECTIONAL 0
|
||||||
@ -64,16 +61,12 @@ struct Light {
|
|||||||
bool has_shadow;
|
bool has_shadow;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
layout(set = 0, binding = 3, std140) uniform Lights {
|
layout(set = 0, binding = 3, std140) uniform Lights {
|
||||||
Light data[MAX_LIGHTS];
|
Light data[MAX_LIGHTS];
|
||||||
} lights;
|
} lights;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // MODE COMPUTE LIGHT
|
#endif // MODE COMPUTE LIGHT
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODE_SECOND_BOUNCE
|
#ifdef MODE_SECOND_BOUNCE
|
||||||
|
|
||||||
layout(set = 0, binding = 5) uniform texture3D color_texture;
|
layout(set = 0, binding = 5) uniform texture3D color_texture;
|
||||||
@ -88,7 +81,6 @@ layout (set=0,binding=8) uniform texture3D aniso_neg_texture;
|
|||||||
#ifndef MODE_DYNAMIC
|
#ifndef MODE_DYNAMIC
|
||||||
|
|
||||||
layout(push_constant, binding = 0, std430) uniform Params {
|
layout(push_constant, binding = 0, std430) uniform Params {
|
||||||
|
|
||||||
ivec3 limits;
|
ivec3 limits;
|
||||||
uint stack_size;
|
uint stack_size;
|
||||||
|
|
||||||
@ -101,10 +93,8 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||||||
uint cell_count;
|
uint cell_count;
|
||||||
float aniso_strength;
|
float aniso_strength;
|
||||||
uint pad;
|
uint pad;
|
||||||
|
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
|
|
||||||
layout(set = 0, binding = 4, std430) buffer Outputs {
|
layout(set = 0, binding = 4, std430) buffer Outputs {
|
||||||
vec4 data[];
|
vec4 data[];
|
||||||
} outputs;
|
} outputs;
|
||||||
@ -125,14 +115,11 @@ layout (r16ui,set=0,binding=7) uniform restrict writeonly uimage3D aniso_neg_tex
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODE_DYNAMIC
|
#ifdef MODE_DYNAMIC
|
||||||
|
|
||||||
layout(push_constant, binding = 0, std430) uniform Params {
|
layout(push_constant, binding = 0, std430) uniform Params {
|
||||||
|
|
||||||
ivec3 limits;
|
ivec3 limits;
|
||||||
uint light_count; //when not lighting
|
uint light_count; //when not lighting
|
||||||
ivec3 x_dir;
|
ivec3 x_dir;
|
||||||
@ -193,15 +180,12 @@ layout (r16ui,set=0,binding=13) uniform restrict writeonly uimage3D aniso_neg_te
|
|||||||
|
|
||||||
//layout (rgba8,set=0,binding=5) uniform restrict writeonly image3D color_tex;
|
//layout (rgba8,set=0,binding=5) uniform restrict writeonly image3D color_tex;
|
||||||
|
|
||||||
|
|
||||||
#endif // MODE DYNAMIC
|
#endif // MODE DYNAMIC
|
||||||
|
|
||||||
#if defined(MODE_COMPUTE_LIGHT) || defined(MODE_DYNAMIC_LIGHTING)
|
#if defined(MODE_COMPUTE_LIGHT) || defined(MODE_DYNAMIC_LIGHTING)
|
||||||
|
|
||||||
float raymarch(float distance, float distance_adv, vec3 from, vec3 direction) {
|
float raymarch(float distance, float distance_adv, vec3 from, vec3 direction) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vec3 cell_size = 1.0 / vec3(params.limits);
|
vec3 cell_size = 1.0 / vec3(params.limits);
|
||||||
float occlusion = 1.0;
|
float occlusion = 1.0;
|
||||||
while (distance > 0.5) { //use this to avoid precision errors
|
while (distance > 0.5) { //use this to avoid precision errors
|
||||||
@ -220,12 +204,10 @@ float raymarch(float distance,float distance_adv,vec3 from,vec3 direction) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return occlusion; //max(0.0,distance);
|
return occlusion; //max(0.0,distance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compute_light_vector(uint light, vec3 pos, out float attenuation, out vec3 light_pos) {
|
bool compute_light_vector(uint light, vec3 pos, out float attenuation, out vec3 light_pos) {
|
||||||
|
|
||||||
|
|
||||||
if (lights.data[light].type == LIGHT_TYPE_DIRECTIONAL) {
|
if (lights.data[light].type == LIGHT_TYPE_DIRECTIONAL) {
|
||||||
|
|
||||||
light_pos = pos - lights.data[light].direction * length(vec3(params.limits));
|
light_pos = pos - lights.data[light].direction * length(vec3(params.limits));
|
||||||
@ -239,10 +221,8 @@ bool compute_light_vector(uint light, vec3 pos,out float attenuation, out vec3 l
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
attenuation = pow(clamp(1.0 - distance / lights.data[light].radius, 0.0001, 1.0), lights.data[light].attenuation);
|
attenuation = pow(clamp(1.0 - distance / lights.data[light].radius, 0.0001, 1.0), lights.data[light].attenuation);
|
||||||
|
|
||||||
|
|
||||||
if (lights.data[light].type == LIGHT_TYPE_SPOT) {
|
if (lights.data[light].type == LIGHT_TYPE_SPOT) {
|
||||||
|
|
||||||
vec3 rel = normalize(pos - light_pos);
|
vec3 rel = normalize(pos - light_pos);
|
||||||
@ -282,9 +262,6 @@ float get_normal_advance(vec3 p_normal) {
|
|||||||
return 1.0 / dot(normal, unorm);
|
return 1.0 / dot(normal, unorm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void clip_segment(vec4 plane, vec3 begin, inout vec3 end) {
|
void clip_segment(vec4 plane, vec3 begin, inout vec3 end) {
|
||||||
|
|
||||||
vec3 segment = begin - end;
|
vec3 segment = begin - end;
|
||||||
@ -322,7 +299,6 @@ bool compute_light_at_pos(uint index, vec3 pos, vec3 normal, inout vec3 light, i
|
|||||||
|
|
||||||
float distance_adv = get_normal_advance(light_dir);
|
float distance_adv = get_normal_advance(light_dir);
|
||||||
|
|
||||||
|
|
||||||
vec3 to = pos;
|
vec3 to = pos;
|
||||||
if (length(normal) > 0.2) {
|
if (length(normal) > 0.2) {
|
||||||
to += normal * distance_adv * 0.51;
|
to += normal * distance_adv * 0.51;
|
||||||
@ -335,7 +311,6 @@ bool compute_light_at_pos(uint index, vec3 pos, vec3 normal, inout vec3 light, i
|
|||||||
clip_segment(mix(vec4(0.0, -1.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, float(params.limits.y - 1)), bvec4(light_dir.y < 0.0)), to, light_pos);
|
clip_segment(mix(vec4(0.0, -1.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, float(params.limits.y - 1)), bvec4(light_dir.y < 0.0)), to, light_pos);
|
||||||
clip_segment(mix(vec4(0.0, 0.0, -1.0, 0.0), vec4(0.0, 0.0, 1.0, float(params.limits.z - 1)), bvec4(light_dir.z < 0.0)), to, light_pos);
|
clip_segment(mix(vec4(0.0, 0.0, -1.0, 0.0), vec4(0.0, 0.0, 1.0, float(params.limits.z - 1)), bvec4(light_dir.z < 0.0)), to, light_pos);
|
||||||
|
|
||||||
|
|
||||||
float distance = length(to - light_pos);
|
float distance = length(to - light_pos);
|
||||||
if (distance < 0.1) {
|
if (distance < 0.1) {
|
||||||
return false; // hit
|
return false; // hit
|
||||||
@ -362,7 +337,6 @@ bool compute_light_at_pos(uint index, vec3 pos, vec3 normal, inout vec3 light, i
|
|||||||
}
|
}
|
||||||
|
|
||||||
attenuation *= occlusion; //1.0 - smoothstep(0.1*distance_adv,distance_adv,dist);
|
attenuation *= occlusion; //1.0 - smoothstep(0.1*distance_adv,distance_adv,dist);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
light = lights.data[index].color * attenuation * lights.data[index].energy;
|
light = lights.data[index].color * attenuation * lights.data[index].energy;
|
||||||
@ -375,7 +349,7 @@ void main() {
|
|||||||
|
|
||||||
#ifndef MODE_DYNAMIC
|
#ifndef MODE_DYNAMIC
|
||||||
|
|
||||||
uint cell_index = gl_GlobalInvocationID.x;;
|
uint cell_index = gl_GlobalInvocationID.x;
|
||||||
if (cell_index >= params.cell_count) {
|
if (cell_index >= params.cell_count) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -427,7 +401,6 @@ void main() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODE_ANISOTROPIC
|
#ifdef MODE_ANISOTROPIC
|
||||||
|
|
||||||
for (uint i = 0; i < 6; i++) {
|
for (uint i = 0; i < 6; i++) {
|
||||||
@ -446,17 +419,15 @@ void main() {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif //MODE_COMPUTE_LIGHT
|
#endif //MODE_COMPUTE_LIGHT
|
||||||
|
|
||||||
/////////////////SECOND BOUNCE///////////////////////////////
|
/////////////////SECOND BOUNCE///////////////////////////////
|
||||||
|
|
||||||
#ifdef MODE_SECOND_BOUNCE
|
#ifdef MODE_SECOND_BOUNCE
|
||||||
vec3 pos = vec3(posu) + vec3(0.5);
|
vec3 pos = vec3(posu) + vec3(0.5);
|
||||||
ivec3 ipos = ivec3(posu);
|
ivec3 ipos = ivec3(posu);
|
||||||
vec4 normal = unpackSnorm4x8(cell_data.data[cell_index].normal);
|
vec4 normal = unpackSnorm4x8(cell_data.data[cell_index].normal);
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODE_ANISOTROPIC
|
#ifdef MODE_ANISOTROPIC
|
||||||
vec3 accum[6];
|
vec3 accum[6];
|
||||||
const vec3 accum_dirs[6] = vec3[](vec3(1.0, 0.0, 0.0), vec3(-1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), vec3(0.0, -1.0, 0.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, -1.0));
|
const vec3 accum_dirs[6] = vec3[](vec3(1.0, 0.0, 0.0), vec3(-1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), vec3(0.0, -1.0, 0.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, -1.0));
|
||||||
@ -537,9 +508,7 @@ void main() {
|
|||||||
float a = (1.0 - color.a);
|
float a = (1.0 - color.a);
|
||||||
color += a * scolor;
|
color += a * scolor;
|
||||||
dist += half_diameter;
|
dist += half_diameter;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
color *= cone_weights[i] * vec4(albedo.rgb, 1.0) * params.dynamic_range; //restore range
|
color *= cone_weights[i] * vec4(albedo.rgb, 1.0) * params.dynamic_range; //restore range
|
||||||
#ifdef MODE_ANISOTROPIC
|
#ifdef MODE_ANISOTROPIC
|
||||||
@ -567,6 +536,7 @@ void main() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // MODE_SECOND_BOUNCE
|
#endif // MODE_SECOND_BOUNCE
|
||||||
|
|
||||||
/////////////////UPDATE MIPMAPS///////////////////////////////
|
/////////////////UPDATE MIPMAPS///////////////////////////////
|
||||||
|
|
||||||
#ifdef MODE_UPDATE_MIPMAPS
|
#ifdef MODE_UPDATE_MIPMAPS
|
||||||
@ -611,9 +581,6 @@ void main() {
|
|||||||
#else
|
#else
|
||||||
outputs.data[cell_index] = vec4(light_accum / divisor, 0.0);
|
outputs.data[cell_index] = vec4(light_accum / divisor, 0.0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -635,7 +602,6 @@ void main() {
|
|||||||
vec3 iso_positive = vec3(dot(outputs.data[cell_index * 6 + 0].rgb, GREY_VEC), dot(outputs.data[cell_index * 6 + 2].rgb, GREY_VEC), dot(outputs.data[cell_index * 6 + 4].rgb, GREY_VEC)) / vec3(accum_total_energy);
|
vec3 iso_positive = vec3(dot(outputs.data[cell_index * 6 + 0].rgb, GREY_VEC), dot(outputs.data[cell_index * 6 + 2].rgb, GREY_VEC), dot(outputs.data[cell_index * 6 + 4].rgb, GREY_VEC)) / vec3(accum_total_energy);
|
||||||
vec3 iso_negative = vec3(dot(outputs.data[cell_index * 6 + 1].rgb, GREY_VEC), dot(outputs.data[cell_index * 6 + 3].rgb, GREY_VEC), dot(outputs.data[cell_index * 6 + 5].rgb, GREY_VEC)) / vec3(accum_total_energy);
|
vec3 iso_negative = vec3(dot(outputs.data[cell_index * 6 + 1].rgb, GREY_VEC), dot(outputs.data[cell_index * 6 + 3].rgb, GREY_VEC), dot(outputs.data[cell_index * 6 + 5].rgb, GREY_VEC)) / vec3(accum_total_energy);
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
uint aniso_pos = uint(clamp(iso_positive.b * 31.0, 0.0, 31.0));
|
uint aniso_pos = uint(clamp(iso_positive.b * 31.0, 0.0, 31.0));
|
||||||
aniso_pos |= uint(clamp(iso_positive.g * 63.0, 0.0, 63.0)) << 5;
|
aniso_pos |= uint(clamp(iso_positive.g * 63.0, 0.0, 63.0)) << 5;
|
||||||
@ -657,8 +623,6 @@ void main() {
|
|||||||
imageStore(color_tex, ivec3(posu), vec4(outputs.data[cell_index].rgb / params.dynamic_range, albedo.a));
|
imageStore(color_tex, ivec3(posu), vec4(outputs.data[cell_index].rgb / params.dynamic_range, albedo.a));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -679,13 +643,9 @@ void main() {
|
|||||||
uv_xy.y = params.rect_size.y - pos_xy.y - 1;
|
uv_xy.y = params.rect_size.y - pos_xy.y - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODE_DYNAMIC_LIGHTING
|
#ifdef MODE_DYNAMIC_LIGHTING
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
float z = params.z_base + imageLoad(depth, uv_xy).x * params.z_sign;
|
float z = params.z_base + imageLoad(depth, uv_xy).x * params.z_sign;
|
||||||
|
|
||||||
ivec3 pos = params.x_dir * (params.rect_pos.x + pos_xy.x) + params.y_dir * (params.rect_pos.y + pos_xy.y) + abs(params.z_dir) * int(z);
|
ivec3 pos = params.x_dir * (params.rect_pos.x + pos_xy.x) + params.y_dir * (params.rect_pos.y + pos_xy.y) + abs(params.z_dir) * int(z);
|
||||||
@ -693,9 +653,6 @@ void main() {
|
|||||||
vec3 normal = imageLoad(source_normal, uv_xy).xyz * 2.0 - 1.0;
|
vec3 normal = imageLoad(source_normal, uv_xy).xyz * 2.0 - 1.0;
|
||||||
normal = vec3(params.x_dir) * normal.x * mix(1.0, -1.0, params.flip_x) + vec3(params.y_dir) * normal.y * mix(1.0, -1.0, params.flip_y) - vec3(params.z_dir) * normal.z;
|
normal = vec3(params.x_dir) * normal.x * mix(1.0, -1.0, params.flip_x) + vec3(params.y_dir) * normal.y * mix(1.0, -1.0, params.flip_y) - vec3(params.z_dir) * normal.z;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vec4 albedo = imageLoad(source_albedo, uv_xy);
|
vec4 albedo = imageLoad(source_albedo, uv_xy);
|
||||||
|
|
||||||
//determine the position in space
|
//determine the position in space
|
||||||
@ -712,14 +669,12 @@ void main() {
|
|||||||
light *= albedo.rgb;
|
light *= albedo.rgb;
|
||||||
|
|
||||||
accum += max(0.0, dot(normal, -light_dir)) * light;
|
accum += max(0.0, dot(normal, -light_dir)) * light;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
accum += imageLoad(emission, uv_xy).xyz;
|
accum += imageLoad(emission, uv_xy).xyz;
|
||||||
|
|
||||||
imageStore(emission, uv_xy, vec4(accum, albedo.a));
|
imageStore(emission, uv_xy, vec4(accum, albedo.a));
|
||||||
imageStore(depth, uv_xy, vec4(z));
|
imageStore(depth, uv_xy, vec4(z));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // MODE DYNAMIC LIGHTING
|
#endif // MODE DYNAMIC LIGHTING
|
||||||
@ -753,7 +708,6 @@ void main() {
|
|||||||
count += 1.0;
|
count += 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (params.on_mipmap) {
|
if (params.on_mipmap) {
|
||||||
accum.rgb /= mix(8.0, count, params.propagation);
|
accum.rgb /= mix(8.0, count, params.propagation);
|
||||||
accum.a /= 8.0;
|
accum.a /= 8.0;
|
||||||
@ -775,7 +729,6 @@ void main() {
|
|||||||
|
|
||||||
#ifdef MODE_DYNAMIC_SHRINK_PLOT
|
#ifdef MODE_DYNAMIC_SHRINK_PLOT
|
||||||
|
|
||||||
|
|
||||||
if (accum.a < 0.001) {
|
if (accum.a < 0.001) {
|
||||||
return; //do not blit if alpha is too low
|
return; //do not blit if alpha is too low
|
||||||
}
|
}
|
||||||
@ -799,7 +752,6 @@ void main() {
|
|||||||
color.a+=color_blit.a;
|
color.a+=color_blit.a;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
||||||
float sa = 1.0 - color_blit.a;
|
float sa = 1.0 - color_blit.a;
|
||||||
vec4 result;
|
vec4 result;
|
||||||
result.a = color.a * sa + color_blit.a;
|
result.a = color.a * sa + color_blit.a;
|
||||||
@ -823,8 +775,6 @@ void main() {
|
|||||||
#endif // ANISOTROPIC
|
#endif // ANISOTROPIC
|
||||||
}
|
}
|
||||||
#endif // MODE_DYNAMIC_SHRINK_PLOT
|
#endif // MODE_DYNAMIC_SHRINK_PLOT
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* clang-format off */
|
||||||
[vertex]
|
[vertex]
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
@ -10,6 +11,7 @@ struct CellData {
|
|||||||
uint emission; //rgb normalized with e as multiplier
|
uint emission; //rgb normalized with e as multiplier
|
||||||
uint normal; //RGB normal encoded
|
uint normal; //RGB normal encoded
|
||||||
};
|
};
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
layout(set = 0, binding = 1, std140) buffer CellDataBuffer {
|
layout(set = 0, binding = 1, std140) buffer CellDataBuffer {
|
||||||
CellData data[];
|
CellData data[];
|
||||||
@ -24,7 +26,6 @@ layout (set=0,binding=4) uniform texture3D aniso_pos_tex;
|
|||||||
layout(set = 0, binding = 5) uniform texture3D aniso_neg_tex;
|
layout(set = 0, binding = 5) uniform texture3D aniso_neg_tex;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
layout(push_constant, binding = 0, std430) uniform Params {
|
layout(push_constant, binding = 0, std430) uniform Params {
|
||||||
|
|
||||||
mat4 projection;
|
mat4 projection;
|
||||||
@ -34,7 +35,6 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||||||
uint level;
|
uint level;
|
||||||
ivec3 bounds;
|
ivec3 bounds;
|
||||||
uint pad;
|
uint pad;
|
||||||
|
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
layout(location = 0) out vec4 color_interp;
|
layout(location = 0) out vec4 color_interp;
|
||||||
@ -77,9 +77,7 @@ void main() {
|
|||||||
vec3(-1.0f, 1.0f, 1.0f),
|
vec3(-1.0f, 1.0f, 1.0f),
|
||||||
vec3(1.0f, 1.0f, 1.0f),
|
vec3(1.0f, 1.0f, 1.0f),
|
||||||
vec3(-1.0f, 1.0f, 1.0f),
|
vec3(-1.0f, 1.0f, 1.0f),
|
||||||
vec3(1.0f,-1.0f, 1.0f)
|
vec3(1.0f, -1.0f, 1.0f));
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
vec3 vertex = cube_triangles[gl_VertexIndex] * 0.5 + 0.5;
|
vec3 vertex = cube_triangles[gl_VertexIndex] * 0.5 + 0.5;
|
||||||
#ifdef MODE_DEBUG_LIGHT_FULL
|
#ifdef MODE_DEBUG_LIGHT_FULL
|
||||||
@ -121,8 +119,7 @@ void main() {
|
|||||||
POS_X,
|
POS_X,
|
||||||
POS_Y,
|
POS_Y,
|
||||||
POS_Y,
|
POS_Y,
|
||||||
POS_Z
|
POS_Z);
|
||||||
);
|
|
||||||
|
|
||||||
color_interp.xyz = texelFetch(sampler3D(color_tex, tex_sampler), ivec3(posu), int(params.level)).xyz * params.dynamic_range;
|
color_interp.xyz = texelFetch(sampler3D(color_tex, tex_sampler), ivec3(posu), int(params.level)).xyz * params.dynamic_range;
|
||||||
vec3 aniso_pos = texelFetch(sampler3D(aniso_pos_tex, tex_sampler), ivec3(posu), int(params.level)).xyz;
|
vec3 aniso_pos = texelFetch(sampler3D(aniso_pos_tex, tex_sampler), ivec3(posu), int(params.level)).xyz;
|
||||||
@ -137,7 +134,6 @@ void main() {
|
|||||||
case NEG_X: strength = aniso_neg.x; break;
|
case NEG_X: strength = aniso_neg.x; break;
|
||||||
case NEG_Y: strength = aniso_neg.y; break;
|
case NEG_Y: strength = aniso_neg.y; break;
|
||||||
case NEG_Z: strength = aniso_neg.z; break;
|
case NEG_Z: strength = aniso_neg.z; break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
color_interp.xyz *= strength;
|
color_interp.xyz *= strength;
|
||||||
@ -160,9 +156,9 @@ void main() {
|
|||||||
#else
|
#else
|
||||||
color_interp.a = params.alpha;
|
color_interp.a = params.alpha;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* clang-format off */
|
||||||
[fragment]
|
[fragment]
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
@ -170,6 +166,7 @@ void main() {
|
|||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
|
|
||||||
layout(location = 0) in vec4 color_interp;
|
layout(location = 0) in vec4 color_interp;
|
||||||
|
/* clang-format on */
|
||||||
layout(location = 0) out vec4 frag_color;
|
layout(location = 0) out vec4 frag_color;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* clang-format off */
|
||||||
[compute]
|
[compute]
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
@ -5,6 +6,7 @@
|
|||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
|
|
||||||
layout(local_size_x = 4, local_size_y = 4, local_size_z = 4) in;
|
layout(local_size_x = 4, local_size_y = 4, local_size_z = 4) in;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
#define MAX_DISTANCE 100000
|
#define MAX_DISTANCE 100000
|
||||||
|
|
||||||
@ -19,7 +21,6 @@ layout(set=0,binding=1,std430) buffer CellChildrenBuffer {
|
|||||||
CellChildren data[];
|
CellChildren data[];
|
||||||
} cell_children;
|
} cell_children;
|
||||||
|
|
||||||
|
|
||||||
struct CellData {
|
struct CellData {
|
||||||
uint position; // xyz 10 bits
|
uint position; // xyz 10 bits
|
||||||
uint albedo; //rgb albedo
|
uint albedo; //rgb albedo
|
||||||
@ -33,9 +34,7 @@ layout(set=0,binding=2,std430) buffer CellDataBuffer {
|
|||||||
|
|
||||||
layout(r8ui, set = 0, binding = 3) uniform restrict writeonly uimage3D sdf_tex;
|
layout(r8ui, set = 0, binding = 3) uniform restrict writeonly uimage3D sdf_tex;
|
||||||
|
|
||||||
|
|
||||||
layout(push_constant, binding = 0, std430) uniform Params {
|
layout(push_constant, binding = 0, std430) uniform Params {
|
||||||
|
|
||||||
uint offset;
|
uint offset;
|
||||||
uint end;
|
uint end;
|
||||||
uint pad0;
|
uint pad0;
|
||||||
@ -67,7 +66,6 @@ void main() {
|
|||||||
//imageStore(sdf_tex,pos,uvec4(pos*2,0));
|
//imageStore(sdf_tex,pos,uvec4(pos*2,0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
layout(push_constant, binding = 0, std430) uniform Params {
|
layout(push_constant, binding = 0, std430) uniform Params {
|
||||||
|
|
||||||
@ -75,7 +73,6 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||||||
uint stack_size;
|
uint stack_size;
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
|
|
||||||
float distance_to_aabb(ivec3 pos, ivec3 aabb_pos, ivec3 aabb_size) {
|
float distance_to_aabb(ivec3 pos, ivec3 aabb_pos, ivec3 aabb_size) {
|
||||||
|
|
||||||
vec3 delta = vec3(max(ivec3(0), max(aabb_pos - pos, pos - (aabb_pos + aabb_size - ivec3(1)))));
|
vec3 delta = vec3(max(ivec3(0), max(aabb_pos - pos, pos - (aabb_pos + aabb_size - ivec3(1)))));
|
||||||
@ -98,8 +95,7 @@ void main() {
|
|||||||
0x8d11f5,
|
0x8d11f5,
|
||||||
0x70ae2e,
|
0x70ae2e,
|
||||||
0x463d47,
|
0x463d47,
|
||||||
0x29cbb8
|
0x29cbb8);
|
||||||
);
|
|
||||||
|
|
||||||
bool cell_found = false;
|
bool cell_found = false;
|
||||||
bool cell_found_exact = false;
|
bool cell_found_exact = false;
|
||||||
@ -122,7 +118,6 @@ void main() {
|
|||||||
|
|
||||||
stack_indices[stack_pos] = (stack_indices[stack_pos] & ((1 << 24) - 1)) | ((index + 1) << 24);
|
stack_indices[stack_pos] = (stack_indices[stack_pos] & ((1 << 24) - 1)) | ((index + 1) << 24);
|
||||||
|
|
||||||
|
|
||||||
uint cell_index = (stack_indices[stack_pos] >> (index * 3)) & 0x7;
|
uint cell_index = (stack_indices[stack_pos] >> (index * 3)) & 0x7;
|
||||||
uint child_cell = cell_children.data[stack[stack_pos]].children[cell_index];
|
uint child_cell = cell_children.data[stack[stack_pos]].children[cell_index];
|
||||||
|
|
||||||
@ -163,9 +158,6 @@ void main() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bvec3 direction = greaterThan((pos - (child_cell_pos + (child_cell_size >> 1))), ivec3(0));
|
bvec3 direction = greaterThan((pos - (child_cell_pos + (child_cell_size >> 1))), ivec3(0));
|
||||||
uint cell_order = 0;
|
uint cell_order = 0;
|
||||||
cell_order |= mix(0, 1, direction.x);
|
cell_order |= mix(0, 1, direction.x);
|
||||||
@ -176,7 +168,6 @@ void main() {
|
|||||||
stack_indices[stack_pos + 1] = cell_orders[cell_order]; //start counting
|
stack_indices[stack_pos + 1] = cell_orders[cell_order]; //start counting
|
||||||
stack_positions[stack_pos + 1] = child_cell_pos;
|
stack_positions[stack_pos + 1] = child_cell_pos;
|
||||||
stack_pos++; //go up stack
|
stack_pos++; //go up stack
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint dist_8;
|
uint dist_8;
|
||||||
@ -189,6 +180,5 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
imageStore(sdf_tex, pos, uvec4(dist_8));
|
imageStore(sdf_tex, pos, uvec4(dist_8));
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* clang-format off */
|
||||||
[compute]
|
[compute]
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
@ -5,6 +6,7 @@
|
|||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
|
|
||||||
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
#define NO_CHILDREN 0xFFFFFFFF
|
#define NO_CHILDREN 0xFFFFFFFF
|
||||||
#define GREY_VEC vec3(0.33333, 0.33333, 0.33333)
|
#define GREY_VEC vec3(0.33333, 0.33333, 0.33333)
|
||||||
@ -35,7 +37,6 @@ layout(set=0,binding=2,std430) buffer CellDataBuffer {
|
|||||||
#ifdef MODE_COMPUTE_LIGHT
|
#ifdef MODE_COMPUTE_LIGHT
|
||||||
|
|
||||||
struct Light {
|
struct Light {
|
||||||
|
|
||||||
uint type;
|
uint type;
|
||||||
float energy;
|
float energy;
|
||||||
float radius;
|
float radius;
|
||||||
@ -51,7 +52,6 @@ struct Light {
|
|||||||
bool has_shadow;
|
bool has_shadow;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
layout(set = 0, binding = 3, std140) uniform Lights {
|
layout(set = 0, binding = 3, std140) uniform Lights {
|
||||||
Light data[MAX_LIGHTS];
|
Light data[MAX_LIGHTS];
|
||||||
} lights;
|
} lights;
|
||||||
@ -59,7 +59,6 @@ layout(set=0,binding=3,std140) uniform Lights {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
layout(push_constant, binding = 0, std430) uniform Params {
|
layout(push_constant, binding = 0, std430) uniform Params {
|
||||||
|
|
||||||
ivec3 limits;
|
ivec3 limits;
|
||||||
uint stack_size;
|
uint stack_size;
|
||||||
|
|
||||||
@ -71,16 +70,12 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||||||
uint cell_offset;
|
uint cell_offset;
|
||||||
uint cell_count;
|
uint cell_count;
|
||||||
uint pad[2];
|
uint pad[2];
|
||||||
|
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
|
|
||||||
layout(set = 0, binding = 4, std140) uniform Outputs {
|
layout(set = 0, binding = 4, std140) uniform Outputs {
|
||||||
vec4 data[];
|
vec4 data[];
|
||||||
} output;
|
} output;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODE_COMPUTE_LIGHT
|
#ifdef MODE_COMPUTE_LIGHT
|
||||||
|
|
||||||
uint raymarch(float distance, float distance_adv, vec3 from, vec3 direction) {
|
uint raymarch(float distance, float distance_adv, vec3 from, vec3 direction) {
|
||||||
@ -127,7 +122,6 @@ uint raymarch(float distance,float distance_adv,vec3 from,vec3 direction) {
|
|||||||
if (cell != NO_CHILDREN) {
|
if (cell != NO_CHILDREN) {
|
||||||
return cell; //found cell!
|
return cell; //found cell!
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
from += direction * distance_adv;
|
from += direction * distance_adv;
|
||||||
@ -139,7 +133,6 @@ uint raymarch(float distance,float distance_adv,vec3 from,vec3 direction) {
|
|||||||
|
|
||||||
bool compute_light_vector(uint light, uint cell, vec3 pos, out float attenuation, out vec3 light_pos) {
|
bool compute_light_vector(uint light, uint cell, vec3 pos, out float attenuation, out vec3 light_pos) {
|
||||||
|
|
||||||
|
|
||||||
if (lights.data[light].type == LIGHT_TYPE_DIRECTIONAL) {
|
if (lights.data[light].type == LIGHT_TYPE_DIRECTIONAL) {
|
||||||
|
|
||||||
light_pos = pos - lights.data[light].direction * length(vec3(params.limits));
|
light_pos = pos - lights.data[light].direction * length(vec3(params.limits));
|
||||||
@ -153,10 +146,8 @@ bool compute_light_vector(uint light,uint cell, vec3 pos,out float attenuation,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
attenuation = pow(clamp(1.0 - distance / lights.data[light].radius, 0.0001, 1.0), lights.data[light].attenuation);
|
attenuation = pow(clamp(1.0 - distance / lights.data[light].radius, 0.0001, 1.0), lights.data[light].attenuation);
|
||||||
|
|
||||||
|
|
||||||
if (lights.data[light].type == LIGHT_TYPE_SPOT) {
|
if (lights.data[light].type == LIGHT_TYPE_SPOT) {
|
||||||
|
|
||||||
vec3 rel = normalize(pos - light_pos);
|
vec3 rel = normalize(pos - light_pos);
|
||||||
@ -198,12 +189,9 @@ float get_normal_advance(vec3 p_normal) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
uint cell_index = gl_GlobalInvocationID.x;;
|
uint cell_index = gl_GlobalInvocationID.x;
|
||||||
if (cell_index >= params.cell_count) {
|
if (cell_index >= params.cell_count) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -247,14 +235,11 @@ void main() {
|
|||||||
|
|
||||||
float distance_adv = get_normal_advance(light_dir);
|
float distance_adv = get_normal_advance(light_dir);
|
||||||
|
|
||||||
|
|
||||||
distance += distance_adv - mod(distance, distance_adv); //make it reach the center of the box always
|
distance += distance_adv - mod(distance, distance_adv); //make it reach the center of the box always
|
||||||
|
|
||||||
vec3 from = pos - light_dir * distance; //approximate
|
vec3 from = pos - light_dir * distance; //approximate
|
||||||
from -= sign(light_dir) * 0.45; //go near the edge towards the light direction to avoid self occlusion
|
from -= sign(light_dir) * 0.45; //go near the edge towards the light direction to avoid self occlusion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint result = raymarch(distance, distance_adv, from, light_dir);
|
uint result = raymarch(distance, distance_adv, from, light_dir);
|
||||||
|
|
||||||
if (result != cell_index) {
|
if (result != cell_index) {
|
||||||
@ -276,7 +261,6 @@ void main() {
|
|||||||
accum += light + emission;
|
accum += light + emission;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MODE_ANISOTROPIC
|
#ifdef MODE_ANISOTROPIC
|
||||||
@ -294,7 +278,6 @@ void main() {
|
|||||||
|
|
||||||
#endif //MODE_COMPUTE_LIGHT
|
#endif //MODE_COMPUTE_LIGHT
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODE_UPDATE_MIPMAPS
|
#ifdef MODE_UPDATE_MIPMAPS
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -337,17 +320,11 @@ void main() {
|
|||||||
#else
|
#else
|
||||||
output.data[cell_index] = vec4(light_accum / divisor, 0.0);
|
output.data[cell_index] = vec4(light_accum / divisor, 0.0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MODE_WRITE_TEXTURE
|
#ifdef MODE_WRITE_TEXTURE
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,12 @@
|
|||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[vertex]
|
[vertex]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#include "scene_forward_inc.glsl"
|
#include "scene_forward_inc.glsl"
|
||||||
|
|
||||||
|
|
||||||
/* INPUT ATTRIBS */
|
/* INPUT ATTRIBS */
|
||||||
|
|
||||||
layout(location = 0) in vec3 vertex_attrib;
|
layout(location = 0) in vec3 vertex_attrib;
|
||||||
@ -64,7 +60,6 @@ MATERIAL_UNIFORMS
|
|||||||
} material;
|
} material;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
|
|
||||||
VERTEX_SHADER_GLOBALS
|
VERTEX_SHADER_GLOBALS
|
||||||
@ -99,7 +94,6 @@ void main() {
|
|||||||
uint offset = (instances.data[instance_index].flags >> INSTANCE_FLAGS_MULTIMESH_STRIDE_SHIFT) & INSTANCE_FLAGS_MULTIMESH_STRIDE_MASK;
|
uint offset = (instances.data[instance_index].flags >> INSTANCE_FLAGS_MULTIMESH_STRIDE_SHIFT) & INSTANCE_FLAGS_MULTIMESH_STRIDE_MASK;
|
||||||
offset *= gl_InstanceIndex;
|
offset *= gl_InstanceIndex;
|
||||||
|
|
||||||
|
|
||||||
mat4 matrix;
|
mat4 matrix;
|
||||||
if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_MULTIMESH_FORMAT_2D)) {
|
if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_MULTIMESH_FORMAT_2D)) {
|
||||||
matrix = mat4(transforms.data[offset + 0], transforms.data[offset + 1], vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0));
|
matrix = mat4(transforms.data[offset + 0], transforms.data[offset + 1], vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0));
|
||||||
@ -139,7 +133,6 @@ void main() {
|
|||||||
vec3 binormal = normalize(cross(normal, tangent) * binormalf);
|
vec3 binormal = normalize(cross(normal, tangent) * binormalf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_SKELETON)) {
|
if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_SKELETON)) {
|
||||||
//multimesh, instances are for it
|
//multimesh, instances are for it
|
||||||
|
|
||||||
@ -162,7 +155,6 @@ void main() {
|
|||||||
tangent = (vec4(tangent, 0.0) * m).xyz;
|
tangent = (vec4(tangent, 0.0) * m).xyz;
|
||||||
binormal = (vec4(binormal, 0.0) * m).xyz;
|
binormal = (vec4(binormal, 0.0) * m).xyz;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(UV_USED)
|
#if defined(UV_USED)
|
||||||
@ -177,8 +169,6 @@ void main() {
|
|||||||
vec4 position;
|
vec4 position;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mat4 projection_matrix = scene_data.projection_matrix;
|
mat4 projection_matrix = scene_data.projection_matrix;
|
||||||
|
|
||||||
//using world coordinates
|
//using world coordinates
|
||||||
@ -222,7 +212,6 @@ VERTEX_SHADER_CODE
|
|||||||
tangent = modelview_normal * tangent;
|
tangent = modelview_normal * tangent;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//using world coordinates
|
//using world coordinates
|
||||||
#if !defined(SKIP_TRANSFORM_USED) && defined(VERTEX_WORLD_COORDS_USED)
|
#if !defined(SKIP_TRANSFORM_USED) && defined(VERTEX_WORLD_COORDS_USED)
|
||||||
|
|
||||||
@ -278,24 +267,21 @@ VERTEX_SHADER_CODE
|
|||||||
#else
|
#else
|
||||||
gl_Position = projection_matrix * vec4(vertex_interp, 1.0);
|
gl_Position = projection_matrix * vec4(vertex_interp, 1.0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[fragment]
|
[fragment]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#include "scene_forward_inc.glsl"
|
#include "scene_forward_inc.glsl"
|
||||||
|
|
||||||
/* Varyings */
|
/* Varyings */
|
||||||
|
|
||||||
layout(location = 0) in vec3 vertex_interp;
|
layout(location = 0) in vec3 vertex_interp;
|
||||||
|
/* clang-format on */
|
||||||
layout(location = 1) in vec3 normal_interp;
|
layout(location = 1) in vec3 normal_interp;
|
||||||
|
|
||||||
#if defined(COLOR_USED)
|
#if defined(COLOR_USED)
|
||||||
@ -323,7 +309,6 @@ layout(location =8) in float dp_clip;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//defines to keep compatibility with vertex
|
//defines to keep compatibility with vertex
|
||||||
|
|
||||||
#define world_matrix instances.data[instance_index].transform
|
#define world_matrix instances.data[instance_index].transform
|
||||||
@ -369,8 +354,6 @@ layout(location = 0) out vec4 frag_color;
|
|||||||
|
|
||||||
#endif // RENDER DEPTH
|
#endif // RENDER DEPTH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// This returns the G_GGX function divided by 2 cos_theta_m, where in practice cos_theta_m is either N.L or N.V.
|
// This returns the G_GGX function divided by 2 cos_theta_m, where in practice cos_theta_m is either N.L or N.V.
|
||||||
// We're dividing this factor off because the overall term we'll end up looks like
|
// We're dividing this factor off because the overall term we'll end up looks like
|
||||||
// (see, for example, the first unnumbered equation in B. Burley, "Physically Based Shading at Disney", SIGGRAPH 2012):
|
// (see, for example, the first unnumbered equation in B. Burley, "Physically Based Shading at Disney", SIGGRAPH 2012):
|
||||||
@ -461,8 +444,7 @@ void light_compute(vec3 N, vec3 L, vec3 V, vec3 light_color, vec3 attenuation, v
|
|||||||
#ifdef USE_SHADOW_TO_OPACITY
|
#ifdef USE_SHADOW_TO_OPACITY
|
||||||
inout float alpha,
|
inout float alpha,
|
||||||
#endif
|
#endif
|
||||||
inout vec3 diffuse_light, inout vec3 specular_light
|
inout vec3 diffuse_light, inout vec3 specular_light) {
|
||||||
) {
|
|
||||||
|
|
||||||
#if defined(USE_LIGHT_SHADER_CODE)
|
#if defined(USE_LIGHT_SHADER_CODE)
|
||||||
// light is written by the light shader
|
// light is written by the light shader
|
||||||
@ -696,7 +678,6 @@ float sample_shadow(texture2D shadow, vec2 shadow_pixel_size, vec4 coord) {
|
|||||||
|
|
||||||
#endif //USE_NO_SHADOWS
|
#endif //USE_NO_SHADOWS
|
||||||
|
|
||||||
|
|
||||||
void light_process_omni(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 albedo, float roughness, float metallic, float specular, float p_blob_intensity,
|
void light_process_omni(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 albedo, float roughness, float metallic, float specular, float p_blob_intensity,
|
||||||
#ifdef LIGHT_TRANSMISSION_USED
|
#ifdef LIGHT_TRANSMISSION_USED
|
||||||
vec3 transmission,
|
vec3 transmission,
|
||||||
@ -743,7 +724,6 @@ void light_process_omni(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 a
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
splane.z = 1.0 - splane.z;
|
splane.z = 1.0 - splane.z;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
splane.xy /= splane.z;
|
splane.xy /= splane.z;
|
||||||
@ -771,14 +751,12 @@ void light_process_omni(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 a
|
|||||||
binormal, tangent, anisotropy,
|
binormal, tangent, anisotropy,
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_SHADOW_TO_OPACITY
|
#ifdef USE_SHADOW_TO_OPACITY
|
||||||
alpha
|
alpha,
|
||||||
#endif
|
#endif
|
||||||
diffuse_light, specular_light);
|
diffuse_light,
|
||||||
|
specular_light);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void light_process_spot(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 albedo, float roughness, float metallic, float specular, float p_blob_intensity,
|
void light_process_spot(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 albedo, float roughness, float metallic, float specular, float p_blob_intensity,
|
||||||
#ifdef LIGHT_TRANSMISSION_USED
|
#ifdef LIGHT_TRANSMISSION_USED
|
||||||
vec3 transmission,
|
vec3 transmission,
|
||||||
@ -793,9 +771,10 @@ void light_process_spot(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 a
|
|||||||
vec3 binormal, vec3 tangent, float anisotropy,
|
vec3 binormal, vec3 tangent, float anisotropy,
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_SHADOW_TO_OPACITY
|
#ifdef USE_SHADOW_TO_OPACITY
|
||||||
inout float alpha
|
inout float alpha,
|
||||||
#endif
|
#endif
|
||||||
inout vec3 diffuse_light, inout vec3 specular_light) {
|
inout vec3 diffuse_light,
|
||||||
|
inout vec3 specular_light) {
|
||||||
|
|
||||||
vec3 light_rel_vec = lights.data[idx].position - vertex;
|
vec3 light_rel_vec = lights.data[idx].position - vertex;
|
||||||
float light_length = length(light_rel_vec);
|
float light_length = length(light_rel_vec);
|
||||||
@ -811,8 +790,6 @@ void light_process_spot(uint idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 a
|
|||||||
vec4 color_specular = unpackUnorm4x8(lights.data[idx].color_specular);
|
vec4 color_specular = unpackUnorm4x8(lights.data[idx].color_specular);
|
||||||
color_specular.rgb *= attenuation_energy.y;
|
color_specular.rgb *= attenuation_energy.y;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (lights.data[idx].atlas_rect!=vec4(0.0)) {
|
if (lights.data[idx].atlas_rect!=vec4(0.0)) {
|
||||||
//use projector texture
|
//use projector texture
|
||||||
@ -951,13 +928,11 @@ vec4 voxel_cone_trace(texture3D probe, vec3 cell_size, vec3 pos, vec3 direction,
|
|||||||
float a = (1.0 - color.a);
|
float a = (1.0 - color.a);
|
||||||
color += a * scolor;
|
color += a * scolor;
|
||||||
dist += half_diameter;
|
dist += half_diameter;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef GI_PROBE_HIGH_QUALITY
|
#ifndef GI_PROBE_HIGH_QUALITY
|
||||||
//faster version for 45 degrees
|
//faster version for 45 degrees
|
||||||
|
|
||||||
@ -989,8 +964,6 @@ vec4 voxel_cone_trace_anisotropic_45_degrees(texture3D probe,texture3D aniso_pos
|
|||||||
color += scolor;
|
color += scolor;
|
||||||
dist += radius;
|
dist += radius;
|
||||||
radius = max(0.5, tan_half_angle * dist);
|
radius = max(0.5, tan_half_angle * dist);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
@ -1019,7 +992,6 @@ vec4 voxel_cone_trace_45_degrees(texture3D probe, vec3 cell_size, vec3 pos, vec3
|
|||||||
color += scolor;
|
color += scolor;
|
||||||
dist += radius;
|
dist += radius;
|
||||||
radius = max(0.5, tan_half_angle * dist);
|
radius = max(0.5, tan_half_angle * dist);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
@ -1027,10 +999,8 @@ vec4 voxel_cone_trace_45_degrees(texture3D probe, vec3 cell_size, vec3 pos, vec3
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#elif defined(GI_PROBE_USE_ANISOTROPY)
|
#elif defined(GI_PROBE_USE_ANISOTROPY)
|
||||||
|
|
||||||
|
|
||||||
//standard voxel cone trace
|
//standard voxel cone trace
|
||||||
vec4 voxel_cone_trace_anisotropic(texture3D probe, texture3D aniso_pos, texture3D aniso_neg, vec3 normal, vec3 cell_size, vec3 pos, vec3 direction, float tan_half_angle, float max_distance, float p_bias) {
|
vec4 voxel_cone_trace_anisotropic(texture3D probe, texture3D aniso_pos, texture3D aniso_neg, vec3 normal, vec3 cell_size, vec3 pos, vec3 direction, float tan_half_angle, float max_distance, float p_bias) {
|
||||||
|
|
||||||
@ -1056,20 +1026,15 @@ vec4 voxel_cone_trace_anisotropic(texture3D probe,texture3D aniso_pos,texture3D
|
|||||||
scolor *= a;
|
scolor *= a;
|
||||||
color += scolor;
|
color += scolor;
|
||||||
dist += half_diameter;
|
dist += half_diameter;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void gi_probe_compute(uint index, vec3 position, vec3 normal, vec3 ref_vec, mat3 normal_xform, float roughness, vec3 ambient, vec3 environment, inout vec4 out_spec, inout vec4 out_diff) {
|
void gi_probe_compute(uint index, vec3 position, vec3 normal, vec3 ref_vec, mat3 normal_xform, float roughness, vec3 ambient, vec3 environment, inout vec4 out_spec, inout vec4 out_diff) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
position = (gi_probes.data[index].xform * vec4(position, 1.0)).xyz;
|
position = (gi_probes.data[index].xform * vec4(position, 1.0)).xyz;
|
||||||
ref_vec = normalize((gi_probes.data[index].xform * vec4(ref_vec, 0.0)).xyz);
|
ref_vec = normalize((gi_probes.data[index].xform * vec4(ref_vec, 0.0)).xyz);
|
||||||
normal = normalize((gi_probes.data[index].xform * vec4(normal, 0.0)).xyz);
|
normal = normalize((gi_probes.data[index].xform * vec4(normal, 0.0)).xyz);
|
||||||
@ -1145,7 +1110,6 @@ void gi_probe_compute(uint index, vec3 position, vec3 normal,vec3 ref_vec, mat3
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
||||||
#ifdef GI_PROBE_USE_ANISOTROPY
|
#ifdef GI_PROBE_USE_ANISOTROPY
|
||||||
vec4 cone_light = voxel_cone_trace_anisotropic_45_degrees(gi_probe_textures[gi_probes.data[index].texture_slot], gi_probe_textures[gi_probes.data[index].texture_slot + 1], gi_probe_textures[gi_probes.data[index].texture_slot + 2], normalize(mix(dir, normal, gi_probes.data[index].anisotropy_strength)), cell_size, position, dir, cone_angle_tan, max_distance, gi_probes.data[index].bias);
|
vec4 cone_light = voxel_cone_trace_anisotropic_45_degrees(gi_probe_textures[gi_probes.data[index].texture_slot], gi_probe_textures[gi_probes.data[index].texture_slot + 1], gi_probe_textures[gi_probes.data[index].texture_slot + 2], normalize(mix(dir, normal, gi_probes.data[index].anisotropy_strength)), cell_size, position, dir, cone_angle_tan, max_distance, gi_probes.data[index].bias);
|
||||||
#else
|
#else
|
||||||
@ -1158,8 +1122,6 @@ void gi_probe_compute(uint index, vec3 position, vec3 normal,vec3 ref_vec, mat3
|
|||||||
}
|
}
|
||||||
|
|
||||||
light += cone_weights[i] * cone_light.rgb;
|
light += cone_weights[i] * cone_light.rgb;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
light *= gi_probes.data[index].dynamic_range;
|
light *= gi_probes.data[index].dynamic_range;
|
||||||
@ -1205,7 +1167,6 @@ void gi_probe_compute(uint index, vec3 position, vec3 normal,vec3 ref_vec, mat3
|
|||||||
|
|
||||||
#endif //!defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED)
|
#endif //!defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED)
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
#ifdef MODE_DUAL_PARABOLOID
|
#ifdef MODE_DUAL_PARABOLOID
|
||||||
@ -1281,7 +1242,6 @@ void main() {
|
|||||||
|
|
||||||
float sss_strength = 0.0;
|
float sss_strength = 0.0;
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
|
|
||||||
@ -1380,14 +1340,11 @@ FRAGMENT_SHADER_CODE
|
|||||||
|
|
||||||
ambient_light = mix(ambient_light, cubemap_ambient * scene_data.ambient_light_color_energy.a, scene_data.ambient_color_sky_mix);
|
ambient_light = mix(ambient_light, cubemap_ambient * scene_data.ambient_light_color_energy.a, scene_data.ambient_color_sky_mix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif // USE_LIGHTMAP
|
#endif // USE_LIGHTMAP
|
||||||
|
|
||||||
#endif //!defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED)
|
#endif //!defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED)
|
||||||
|
|
||||||
|
|
||||||
//radiance
|
//radiance
|
||||||
|
|
||||||
float specular_blob_intensity = 1.0;
|
float specular_blob_intensity = 1.0;
|
||||||
@ -1434,13 +1391,11 @@ FRAGMENT_SHADER_CODE
|
|||||||
|
|
||||||
specular_light = spec_accum.rgb;
|
specular_light = spec_accum.rgb;
|
||||||
ambient_light = amb_accum.rgb;
|
ambient_light = amb_accum.rgb;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
{ // process reflections
|
{ // process reflections
|
||||||
|
|
||||||
|
|
||||||
vec4 reflection_accum = vec4(0.0, 0.0, 0.0, 0.0);
|
vec4 reflection_accum = vec4(0.0, 0.0, 0.0, 0.0);
|
||||||
vec4 ambient_accum = vec4(0.0, 0.0, 0.0, 0.0);
|
vec4 ambient_accum = vec4(0.0, 0.0, 0.0, 0.0);
|
||||||
|
|
||||||
@ -1448,7 +1403,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
|
|
||||||
for (uint i = 0; i < reflection_probe_count; i++) {
|
for (uint i = 0; i < reflection_probe_count; i++) {
|
||||||
|
|
||||||
|
|
||||||
uint ref_index = instances.data[instance_index].reflection_probe_indices[i >> 1];
|
uint ref_index = instances.data[instance_index].reflection_probe_indices[i >> 1];
|
||||||
|
|
||||||
if (bool(i & 1)) {
|
if (bool(i & 1)) {
|
||||||
@ -1457,9 +1411,7 @@ FRAGMENT_SHADER_CODE
|
|||||||
ref_index &= 0xFFFF;
|
ref_index &= 0xFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
reflection_process(ref_index, vertex, normal, roughness, ambient_light, specular_light, ambient_accum, reflection_accum);
|
reflection_process(ref_index, vertex, normal, roughness, ambient_light, specular_light, ambient_accum, reflection_accum);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reflection_accum.a > 0.0) {
|
if (reflection_accum.a > 0.0) {
|
||||||
@ -1471,8 +1423,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
ambient_light = ambient_accum.rgb / ambient_accum.a;
|
ambient_light = ambient_accum.rgb / ambient_accum.a;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -1548,7 +1498,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
|
|
||||||
float shadow2 = sample_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size, pssm_coord);
|
float shadow2 = sample_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size, pssm_coord);
|
||||||
shadow = mix(shadow, shadow2, pssm_blend);
|
shadow = mix(shadow, shadow2, pssm_blend);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shadow = mix(shadow, 1.0, smoothstep(directional_lights.data[i].fade_from, directional_lights.data[i].fade_to, vertex.z)); //done with negative values for performance
|
shadow = mix(shadow, 1.0, smoothstep(directional_lights.data[i].fade_from, directional_lights.data[i].fade_to, vertex.z)); //done with negative values for performance
|
||||||
@ -1556,7 +1505,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
light_attenuation = mix(directional_lights.data[i].shadow_color, vec3(1.0), shadow);
|
light_attenuation = mix(directional_lights.data[i].shadow_color, vec3(1.0), shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
light_compute(normal, directional_lights.data[i].direction, normalize(view), directional_lights.data[i].color * directional_lights.data[i].energy, light_attenuation, albedo, roughness, metallic, specular, directional_lights.data[i].specular * specular_blob_intensity,
|
light_compute(normal, directional_lights.data[i].direction, normalize(view), directional_lights.data[i].color * directional_lights.data[i].energy, light_attenuation, albedo, roughness, metallic, specular, directional_lights.data[i].specular * specular_blob_intensity,
|
||||||
#ifdef LIGHT_TRANSMISSION_USED
|
#ifdef LIGHT_TRANSMISSION_USED
|
||||||
transmission,
|
transmission,
|
||||||
@ -1571,9 +1519,10 @@ FRAGMENT_SHADER_CODE
|
|||||||
binormal, tangent, anisotropy,
|
binormal, tangent, anisotropy,
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_SHADOW_TO_OPACITY
|
#ifdef USE_SHADOW_TO_OPACITY
|
||||||
alpha
|
alpha,
|
||||||
#endif
|
#endif
|
||||||
diffuse_light, specular_light);
|
diffuse_light,
|
||||||
|
specular_light);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1613,7 +1562,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
#endif
|
#endif
|
||||||
diffuse_light, specular_light);
|
diffuse_light, specular_light);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{ //spot lights
|
{ //spot lights
|
||||||
@ -1652,12 +1600,8 @@ FRAGMENT_SHADER_CODE
|
|||||||
#endif
|
#endif
|
||||||
diffuse_light, specular_light);
|
diffuse_light, specular_light);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_SHADOW_TO_OPACITY
|
#ifdef USE_SHADOW_TO_OPACITY
|
||||||
alpha = min(alpha, clamp(length(ambient_light), 0.0, 1.0));
|
alpha = min(alpha, clamp(length(ambient_light), 0.0, 1.0));
|
||||||
|
|
||||||
@ -1679,7 +1623,6 @@ FRAGMENT_SHADER_CODE
|
|||||||
|
|
||||||
#endif //!defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED)
|
#endif //!defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED)
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODE_RENDER_DEPTH
|
#ifdef MODE_RENDER_DEPTH
|
||||||
|
|
||||||
#ifdef MODE_RENDER_MATERIAL
|
#ifdef MODE_RENDER_MATERIAL
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#define M_PI 3.14159265359
|
#define M_PI 3.14159265359
|
||||||
#define ROUGHNESS_MAX_LOD 5
|
#define ROUGHNESS_MAX_LOD 5
|
||||||
|
|
||||||
@ -7,11 +6,8 @@ layout(push_constant, binding = 0, std430) uniform DrawCall {
|
|||||||
uint pad[3]; //16 bits minimum size
|
uint pad[3]; //16 bits minimum size
|
||||||
} draw_call;
|
} draw_call;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Set 0 Scene data that never changes, ever */
|
/* Set 0 Scene data that never changes, ever */
|
||||||
|
|
||||||
|
|
||||||
#define SAMPLER_NEAREST_CLAMP 0
|
#define SAMPLER_NEAREST_CLAMP 0
|
||||||
#define SAMPLER_LINEAR_CLAMP 1
|
#define SAMPLER_LINEAR_CLAMP 1
|
||||||
#define SAMPLER_NEAREST_WITH_MIMPAMPS_CLAMP 2
|
#define SAMPLER_NEAREST_WITH_MIMPAMPS_CLAMP 2
|
||||||
@ -44,7 +40,6 @@ layout(set=0,binding=3,std140) uniform SceneData {
|
|||||||
float z_offset;
|
float z_offset;
|
||||||
float z_slope_scale;
|
float z_slope_scale;
|
||||||
|
|
||||||
|
|
||||||
float time;
|
float time;
|
||||||
float reflection_multiplier; // one normally, zero when rendering reflections
|
float reflection_multiplier; // one normally, zero when rendering reflections
|
||||||
|
|
||||||
@ -74,14 +69,12 @@ layout(set=0,binding=3,std140) uniform SceneData {
|
|||||||
|
|
||||||
float ambient_energy;
|
float ambient_energy;
|
||||||
float bg_energy;
|
float bg_energy;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
vec2 shadow_atlas_pixel_size;
|
vec2 shadow_atlas_pixel_size;
|
||||||
vec2 directional_shadow_pixel_size;
|
vec2 directional_shadow_pixel_size;
|
||||||
|
|
||||||
|
|
||||||
float z_far;
|
float z_far;
|
||||||
|
|
||||||
float subsurface_scatter_width;
|
float subsurface_scatter_width;
|
||||||
@ -118,7 +111,6 @@ layout(set=0,binding=3,std140) uniform SceneData {
|
|||||||
|
|
||||||
#define INSTANCE_FLAGS_SKELETON (1 << 19)
|
#define INSTANCE_FLAGS_SKELETON (1 << 19)
|
||||||
|
|
||||||
|
|
||||||
struct InstanceData {
|
struct InstanceData {
|
||||||
mat4 transform;
|
mat4 transform;
|
||||||
mat4 normal_transform;
|
mat4 normal_transform;
|
||||||
@ -133,13 +125,11 @@ struct InstanceData {
|
|||||||
uint decal_indices[4];
|
uint decal_indices[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
layout(set = 0, binding = 4, std430) buffer Instances {
|
layout(set = 0, binding = 4, std430) buffer Instances {
|
||||||
InstanceData data[];
|
InstanceData data[];
|
||||||
} instances;
|
} instances;
|
||||||
|
|
||||||
struct LightData { //this structure needs to be 128 bits
|
struct LightData { //this structure needs to be 128 bits
|
||||||
|
|
||||||
vec3 position;
|
vec3 position;
|
||||||
float inv_radius;
|
float inv_radius;
|
||||||
vec3 direction;
|
vec3 direction;
|
||||||
@ -173,7 +163,6 @@ layout(set=0,binding=6,std140) uniform ReflectionProbeData {
|
|||||||
} reflections;
|
} reflections;
|
||||||
|
|
||||||
struct DirectionalLightData {
|
struct DirectionalLightData {
|
||||||
|
|
||||||
vec3 direction;
|
vec3 direction;
|
||||||
float energy;
|
float energy;
|
||||||
vec3 color;
|
vec3 color;
|
||||||
@ -189,7 +178,6 @@ struct DirectionalLightData {
|
|||||||
mat4 shadow_matrix2;
|
mat4 shadow_matrix2;
|
||||||
mat4 shadow_matrix3;
|
mat4 shadow_matrix3;
|
||||||
mat4 shadow_matrix4;
|
mat4 shadow_matrix4;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(set = 0, binding = 7, std140) uniform DirectionalLights {
|
layout(set = 0, binding = 7, std140) uniform DirectionalLights {
|
||||||
@ -218,10 +206,8 @@ layout(set=0,binding=8,std140) uniform GIProbes {
|
|||||||
|
|
||||||
layout(set = 0, binding = 9) uniform texture3D gi_probe_textures[MAX_GI_PROBE_TEXTURES];
|
layout(set = 0, binding = 9) uniform texture3D gi_probe_textures[MAX_GI_PROBE_TEXTURES];
|
||||||
|
|
||||||
|
|
||||||
/* Set 1, Scene data that changes per render pass */
|
/* Set 1, Scene data that changes per render pass */
|
||||||
|
|
||||||
|
|
||||||
layout(set = 1, binding = 0) uniform texture2D depth_buffer;
|
layout(set = 1, binding = 0) uniform texture2D depth_buffer;
|
||||||
layout(set = 1, binding = 1) uniform texture2D color_buffer;
|
layout(set = 1, binding = 1) uniform texture2D color_buffer;
|
||||||
layout(set = 1, binding = 2) uniform texture2D normal_buffer;
|
layout(set = 1, binding = 2) uniform texture2D normal_buffer;
|
||||||
@ -237,14 +223,12 @@ layout(set = 1, binding = 4) uniform textureCube radiance_cubemap;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
layout(set = 1, binding = 5) uniform textureCubeArray reflection_atlas;
|
layout(set = 1, binding = 5) uniform textureCubeArray reflection_atlas;
|
||||||
|
|
||||||
layout(set = 1, binding = 6) uniform texture2D shadow_atlas;
|
layout(set = 1, binding = 6) uniform texture2D shadow_atlas;
|
||||||
|
|
||||||
layout(set = 1, binding = 7) uniform texture2D directional_shadow_atlas;
|
layout(set = 1, binding = 7) uniform texture2D directional_shadow_atlas;
|
||||||
|
|
||||||
|
|
||||||
/* Set 2 Skeleton & Instancing (Multimesh) */
|
/* Set 2 Skeleton & Instancing (Multimesh) */
|
||||||
|
|
||||||
layout(set = 2, binding = 0, std430) buffer Transforms {
|
layout(set = 2, binding = 0, std430) buffer Transforms {
|
||||||
@ -252,5 +236,3 @@ layout(set=2,binding=0,std430) buffer Transforms {
|
|||||||
} transforms;
|
} transforms;
|
||||||
|
|
||||||
/* Set 3 User Material */
|
/* Set 3 User Material */
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[vertex]
|
[vertex]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
layout(location = 0) out vec2 uv_interp;
|
layout(location = 0) out vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
layout(push_constant, binding = 1, std430) uniform Params {
|
layout(push_constant, binding = 1, std430) uniform Params {
|
||||||
mat3 orientation;
|
mat3 orientation;
|
||||||
@ -17,7 +15,6 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||||||
float alpha;
|
float alpha;
|
||||||
float depth;
|
float depth;
|
||||||
float pad;
|
float pad;
|
||||||
|
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
@ -25,26 +22,22 @@ void main() {
|
|||||||
vec2 base_arr[4] = vec2[](vec2(-1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0), vec2(1.0, -1.0));
|
vec2 base_arr[4] = vec2[](vec2(-1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0), vec2(1.0, -1.0));
|
||||||
uv_interp = base_arr[gl_VertexIndex];
|
uv_interp = base_arr[gl_VertexIndex];
|
||||||
gl_Position = vec4(uv_interp, params.depth, 1.0);
|
gl_Position = vec4(uv_interp, params.depth, 1.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[fragment]
|
[fragment]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#define M_PI 3.14159265359
|
#define M_PI 3.14159265359
|
||||||
|
|
||||||
layout(location = 0) in vec2 uv_interp;
|
layout(location = 0) in vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
layout(set = 0, binding = 0) uniform sampler2D source_panorama;
|
layout(set = 0, binding = 0) uniform sampler2D source_panorama;
|
||||||
|
|
||||||
|
|
||||||
layout(push_constant, binding = 1, std430) uniform Params {
|
layout(push_constant, binding = 1, std430) uniform Params {
|
||||||
mat3 orientation;
|
mat3 orientation;
|
||||||
vec4 proj;
|
vec4 proj;
|
||||||
@ -52,10 +45,8 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||||||
float alpha;
|
float alpha;
|
||||||
float depth;
|
float depth;
|
||||||
float pad;
|
float pad;
|
||||||
|
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
|
|
||||||
vec4 texturePanorama(sampler2D pano, vec3 normal) {
|
vec4 texturePanorama(sampler2D pano, vec3 normal) {
|
||||||
|
|
||||||
vec2 st = vec2(
|
vec2 st = vec2(
|
||||||
@ -70,10 +61,8 @@ vec4 texturePanorama(sampler2D pano, vec3 normal) {
|
|||||||
return texture(pano, st);
|
return texture(pano, st);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 frag_color;
|
layout(location = 0) out vec4 frag_color;
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
vec3 cube_normal;
|
vec3 cube_normal;
|
||||||
@ -85,5 +74,4 @@ void main() {
|
|||||||
|
|
||||||
frag_color.rgb = texturePanorama(source_panorama, normalize(cube_normal.xyz)).rgb;
|
frag_color.rgb = texturePanorama(source_panorama, normalize(cube_normal.xyz)).rgb;
|
||||||
frag_color.a = params.alpha;
|
frag_color.a = params.alpha;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[vertex]
|
[vertex]
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
layout(location = 0) out vec2 uv_interp;
|
layout(location = 0) out vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
@ -20,16 +18,12 @@ void main() {
|
|||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
[fragment]
|
[fragment]
|
||||||
|
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
|
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
VERSION_DEFINES
|
VERSION_DEFINES
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
layout(location = 0) in vec2 uv_interp;
|
layout(location = 0) in vec2 uv_interp;
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
layout(set = 0, binding = 0) uniform sampler2D source_color;
|
layout(set = 0, binding = 0) uniform sampler2D source_color;
|
||||||
layout(set = 1, binding = 0) uniform sampler2D source_auto_exposure;
|
layout(set = 1, binding = 0) uniform sampler2D source_auto_exposure;
|
||||||
@ -54,7 +48,6 @@ layout(push_constant, binding = 1, std430) uniform Params {
|
|||||||
float exposure;
|
float exposure;
|
||||||
float white;
|
float white;
|
||||||
float auto_exposure_grey;
|
float auto_exposure_grey;
|
||||||
|
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
layout(location = 0) out vec4 frag_color;
|
layout(location = 0) out vec4 frag_color;
|
||||||
@ -95,7 +88,6 @@ float h1(float a) {
|
|||||||
return 1.0f + w3(a) / (w2(a) + w3(a));
|
return 1.0f + w3(a) / (w2(a) + w3(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vec4 texture2D_bicubic(sampler2D tex, vec2 uv, int p_lod) {
|
vec4 texture2D_bicubic(sampler2D tex, vec2 uv, int p_lod) {
|
||||||
float lod = float(p_lod);
|
float lod = float(p_lod);
|
||||||
vec2 tex_size = vec2(params.glow_texture_size >> p_lod);
|
vec2 tex_size = vec2(params.glow_texture_size >> p_lod);
|
||||||
|
Loading…
Reference in New Issue
Block a user