-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial ies lights. #63835
Add initial ies lights. #63835
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -572,11 +572,12 @@ bool GridMap::_octant_update(const OctantKey &p_key) { | |
NavigationServer3D::get_singleton()->region_set_map(region, get_world_3d()->get_navigation_map()); | ||
nm.region = region; | ||
|
||
#ifdef DEBUG_ENABLED | ||
// add navigation debugmesh visual instances if debug is enabled | ||
SceneTree *st = SceneTree::get_singleton(); | ||
if (st && st->is_debugging_navigation_hint()) { | ||
if (!nm.navmesh_debug_instance.is_valid()) { | ||
RID navmesh_debug_rid = navmesh->get_debug_mesh()->get_rid(); | ||
RID navmesh_debug_rid = navmesh->_get_debug_mesh()->get_rid(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated, should be removed (you can open an issue about what that bug is because it's weird you keep changing it - but I suspect you might be working off a slightly outdated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This happens on all my rebases up to last night. I also have the same error on ming-llvm and osx's clang. |
||
nm.navmesh_debug_instance = RS::get_singleton()->instance_create(); | ||
RS::get_singleton()->instance_set_base(nm.navmesh_debug_instance, navmesh_debug_rid); | ||
RS::get_singleton()->mesh_surface_set_material(navmesh_debug_rid, 0, st->get_debug_navigation_material()->get_rid()); | ||
|
@@ -586,6 +587,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) { | |
RS::get_singleton()->instance_set_transform(nm.navmesh_debug_instance, get_global_transform() * nm.xform); | ||
} | ||
} | ||
#endif | ||
} | ||
|
||
g.navmesh_ids[E] = nm; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
|
||
Import("env") | ||
Import("env_modules") | ||
|
||
env_ies = env_modules.Clone() | ||
|
||
# Thirdparty source files | ||
|
||
thirdparty_obj = [] | ||
|
||
# Not unbundled for now as they are not commonly available as shared library | ||
thirdparty_dir = "#thirdparty/ies/" | ||
thirdparty_sources = [ | ||
"ies_loader.cpp", | ||
] | ||
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] | ||
|
||
env_ies.Prepend(CPPPATH=[thirdparty_dir]) | ||
|
||
env_thirdparty = env_ies.Clone() | ||
env_thirdparty.disable_warnings() | ||
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources) | ||
env.modules_sources += thirdparty_obj | ||
|
||
# Godot source files | ||
|
||
module_obj = [] | ||
|
||
env_ies.add_source_files(module_obj, "*.cpp") | ||
env.modules_sources += module_obj | ||
|
||
# Needed to force rebuilding the module files when the thirdparty library is updated. | ||
env.Depends(module_obj, thirdparty_obj) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def can_build(env, platform): | ||
return env["tools"] | ||
|
||
|
||
def configure(env): | ||
pass |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/*************************************************************************/ | ||
/* image_loader_ies.cpp */ | ||
/*************************************************************************/ | ||
/* This file is part of: */ | ||
/* GODOT ENGINE */ | ||
/* https://godotengine.org */ | ||
/*************************************************************************/ | ||
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ | ||
/* Copyright (c) 2014-2022 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 "image_loader_ies.h" | ||
|
||
#include "core/io/file_access.h" | ||
#include "core/string/ustring.h" | ||
|
||
#include "thirdparty/ies/ies_loader.h" | ||
#include <ios> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What needs this? I only see |
||
|
||
Error ImageLoaderIES::load_image(Ref<Image> p_image, Ref<FileAccess> f, bool p_force_linear, float p_scale) { | ||
IESFileInfo info = {}; | ||
std::string ies_file = f->get_as_utf8_string(true).utf8().get_data(); | ||
|
||
IESLoadHelper IESLoader; | ||
if (!IESLoader.load(ies_file, info)) { | ||
ERR_PRINT(vformat("IES image loader error: %s", info.error().c_str())); | ||
return FAILED; | ||
} | ||
int32_t width = 512; | ||
width *= p_scale; | ||
int32_t height = 1; | ||
int32_t channel_count = 3; | ||
Vector<uint8_t> imgdata; | ||
imgdata.resize(width * height * channel_count * sizeof(float)); | ||
if (!IESLoader.saveAs1D(info, (float *)imgdata.ptrw(), width, channel_count)) { | ||
ERR_PRINT(vformat("IES save error: %s", info.error().c_str())); | ||
return FAILED; | ||
} | ||
p_image->create(width, height, false, Image::FORMAT_RGBF, imgdata); | ||
p_image->generate_mipmaps(); | ||
|
||
return OK; | ||
} | ||
|
||
void ImageLoaderIES::get_recognized_extensions(List<String> *p_extensions) const { | ||
p_extensions->push_back("ies"); | ||
} | ||
|
||
ImageLoaderIES::ImageLoaderIES() { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/*************************************************************************/ | ||
/* image_loader_ies.h */ | ||
/*************************************************************************/ | ||
/* This file is part of: */ | ||
/* GODOT ENGINE */ | ||
/* https://godotengine.org */ | ||
/*************************************************************************/ | ||
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ | ||
/* Copyright (c) 2014-2022 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 IMAGE_LOADER_IES_H | ||
#define IMAGE_LOADER_IES_H | ||
|
||
#include "core/io/image_loader.h" | ||
|
||
class ImageLoaderIES : public ImageFormatLoader { | ||
public: | ||
virtual Error load_image(Ref<Image> p_image, Ref<FileAccess> f, bool p_force_linear, float p_scale); | ||
virtual void get_recognized_extensions(List<String> *p_extensions) const; | ||
ImageLoaderIES(); | ||
}; | ||
|
||
#endif // IMAGE_LOADER_IES_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/*************************************************************************/ | ||
/* register_types.cpp */ | ||
/*************************************************************************/ | ||
/* This file is part of: */ | ||
/* GODOT ENGINE */ | ||
/* https://godotengine.org */ | ||
/*************************************************************************/ | ||
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ | ||
/* Copyright (c) 2014-2022 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 "image_loader_ies.h" | ||
|
||
static ImageLoaderIES *image_loader_ies = nullptr; | ||
|
||
void initialize_ies_module(ModuleInitializationLevel p_level) { | ||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { | ||
return; | ||
} | ||
|
||
image_loader_ies = memnew(ImageLoaderIES); | ||
ImageLoader::add_image_format_loader(image_loader_ies); | ||
} | ||
|
||
void uninitialize_ies_module(ModuleInitializationLevel p_level) { | ||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { | ||
return; | ||
} | ||
|
||
memdelete(image_loader_ies); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*************************************************************************/ | ||
/* register_types.h */ | ||
/*************************************************************************/ | ||
/* This file is part of: */ | ||
/* GODOT ENGINE */ | ||
/* https://godotengine.org */ | ||
/*************************************************************************/ | ||
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ | ||
/* Copyright (c) 2014-2022 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 IES_REGISTER_TYPES_H | ||
#define IES_REGISTER_TYPES_H | ||
|
||
#include "modules/register_module_types.h" | ||
|
||
void initialize_ies_module(ModuleInitializationLevel p_level); | ||
void uninitialize_ies_module(ModuleInitializationLevel p_level); | ||
|
||
#endif // IES_REGISTER_TYPES_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
MIT License | ||
|
||
Copyright (C) 2016-2017 Rui. All rights reserved. | ||
|
||
https://github.com/ray-cast/IES | ||
|
||
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 | ||
BRIAN PAUL 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems unrelated?