-
-
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
Conversation
1414a5b
to
f4f9f98
Compare
036f62e
to
74eed9e
Compare
How does it works? |
I currently have generated a 521x1 strip. My next task is to convert that to a cube map.
Assistance helpful. |
bc48fc7
to
dd56013
Compare
@clayjohn Said he'll describe how to integrate with the light projectors. // From the original guide
// hlsl
float3 ComputeIESLightProfile1D(float3 L, float3 LightDirection)
{
L = mul(L, (float3x3)matViewInverse);
float angle = (1 - acos(dot(L, LightDirection)) / PI);
return tex2Dlod(IESTextureSamp, float4(angle, 0, 0, 0)).rgb;
} |
// 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 comment
The reason will be displayed to describe this comment to others. Learn more.
seems unrelated?
This looks good, why a draft? |
#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 comment
The reason will be displayed to describe this comment to others. Learn more.
What needs this? I only see std::string
.
static void getInt(const std::string& data, std::string& next, std::int32_t& ret, bool stopOnWhiteSpace = true, bool stopOnComma = false); | ||
}; | ||
|
||
#endif |
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.
Missing newline at EOF.
getLineContent(data, next, line, stopOnWhiteSpace, stopOnComma); | ||
assert(!line.empty()); | ||
ret = std::atoi(line.c_str()); | ||
} |
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.
Missing newline.
thirdparty/README.md
Outdated
- License: MIT | ||
|
||
See the standard from https://github.com/ray-cast/ies/blob/master/IES.pdf and from http://www.tc.faa.gov/its/worldpac/Standards/ansi/ansi-ies%20rp-1-04.pdf |
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.
- License: MIT | |
See the standard from https://github.com/ray-cast/ies/blob/master/IES.pdf and from http://www.tc.faa.gov/its/worldpac/Standards/ansi/ansi-ies%20rp-1-04.pdf | |
- License: MIT | |
Files extracted from upstream source: | |
- `ies_loader.{cpp,h}` | |
- `LICENSE.txt` | |
See the standard from https://github.com/ray-cast/ies/blob/master/IES.pdf and from http://www.tc.faa.gov/its/worldpac/Standards/ansi/ansi-ies%20rp-1-04.pdf |
@reduz I wasn't sure how to take the 1x512 px image and turn it into a projection that Godot can use for cookie lighting. |
OmniLights use a texture with spherical projection (like HDRI panoramas, but upside down). SpotLights use box texture projection in the direction the SpotLight is pointing towards. You should be able to correct the OmniLight projector's perspective using a polar to cartesian (or cartesian to polar) function. |
Please ensure that this feature works with static lights when baking lightmaps |
@jcostello I do not know if projectors bake. The goal of this pr is to generate a image that can be loaded by the light cookie projector. |
// 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 comment
The 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 master
branch if this breaks).
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.
This happens on all my rebases up to last night. I also have the same error on ming-llvm and osx's clang.
Co-authored-by: Rémi Verschelde <[email protected]>
Co-authored-by: Rémi Verschelde <[email protected]>
Co-authored-by: Rémi Verschelde <[email protected]>
This is salvageable. Will need to re-evaluate in 4.x |
Fixes: godotengine/godot-proposals#715
Status:
Imports something into an image. Not sure how projectors work.
Part of the V-Sekai project. https://github.com/v-sekai