Skip to content
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

Implement DirectionalLight2D #43297

Merged
merged 1 commit into from
Nov 4, 2020

Conversation

reduz
Copy link
Member

@reduz reduz commented Nov 3, 2020

Also separated Light2D in PointLight2D and DirectionalLight2D.

Used PointLight2D because its more of a point, and it does not work
the same as OmniLight (as shape depends on texture).

Added a few utility methods to Rect2D I needed.

dl2

@Calinou
Copy link
Member

Calinou commented Nov 3, 2020

As for the naming, if PointLight2D turns out to be too confusing or difficult to search for, I think we could name it OmniLight2D for consistency with 3D. Sure, you can also use PointLight2D to create spotlights, but you can also do that in 3D by adding a projector texture that makes your OmniLight3D look like a SpotLight3D.

@reduz
Copy link
Member Author

reduz commented Nov 3, 2020

@Calinou The problem is that, most nodes in 2D and 3D work the same and have the same options when they have the same name. PointLight2D works quite different to OmniLight3D and SpotLight3D. At much it could be renamed to PositionalLight2D, but I think Point makes more sense.

@reduz reduz force-pushed the directional-light-2d branch 2 times, most recently from 937fc03 to 99d349b Compare November 3, 2020 23:17
@clayjohn
Copy link
Member

clayjohn commented Nov 4, 2020

There is something wrong with blend_mode if you change it the entire thing stops working.

More specifically, if you change the blend_mode to mix then the light disappears and it doesnt come back until you restart the engine.

@mrjustaguy
Copy link
Contributor

TextureLight2D could work if it depends on the texture, however PointLight2D is I'd say ok.

Also separated Light2D in PointLight2D and DirectionalLight2D.
Used PointLight2D because its more of a point, and it does not work
the same as OmniLight (as shape depends on texture).
Added a few utility methods to Rect2D I needed.
@akien-mga akien-mga merged commit 89f605c into godotengine:master Nov 4, 2020
@akien-mga
Copy link
Member

Thanks!

@h0lley
Copy link

h0lley commented May 13, 2022

@reduz I am trying to reconstruct this demo compiling from this commit, but seem to be unable to.
any chance you still have the demo files & can share?

edit: nevermind, the issue was that I wasn't using normal maps.
without normal maps, blending seems to be broken. see #49922

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants