Page 1 of 1

[Godot] Light2D in add mode makes CreatureGodot node transparent

Posted: Wed Jan 23, 2019 11:14 am
by Sungray
Hi,

When I use a Light2D in Add mode next to a CreatureGodot sprite, the creature sprite becomes semi transparent. This doesn't happen with normal godot sprites.

Is there any workaround ?

Thanks

Re: [Godot] Light2D in add mode makes CreatureGodot node transparent

Posted: Wed Jan 23, 2019 4:51 pm
by chong
Hello,

I am not too sure about the exact details of Godot's light 2D implementation with respect to sprites.
The final rendering pass is at:

https://github.com/kestrelm/Creature_Go ... t.cpp#L444


As you can see it is just a single call to render the mesh, nothing too fancy here. The source code is provided so if you know anything about the details of the Godot renderer, you can change that to fit your needs. Or you can definitely ask Godot engine internals experts and post on this forum what the fix should be. I will patch it into the GitHub repo if the info can be provided.

Thanks

Re: [Godot] Light2D in add mode makes CreatureGodot node transparent

Posted: Wed Jan 23, 2019 8:21 pm
by Sungray
I've looked into it and tried getting some help from godot experts, but I haven't got much.

The problem isn't that the creaturenode has an alpha when close to a Light2D in add mode, it's that all the different layers are affected by the light. If you have a hand inside a sleeve, the Light2D color will be added to both the sleeve and the underlying hand, the result being that you can see the hand behind the sleeve in a transluscent way.

Any chance this helps you pinpoint the issue ?

Re: [Godot] Light2D in add mode makes CreatureGodot node transparent

Posted: Wed Jan 23, 2019 9:05 pm
by chong
Hello,

Thanks for the update. The issue is I too have tried looking/asking around but couldn't get any actual information about how to address this rendering issue. Their technical documentation on how their renderer works is still somewhat of a mystery to me.
As I mentioned before, I am using a very standard ( as far as I can tell given the state of their documentation ) way to render a mesh, I am not doing anything special or strange as far as I can tell. It will be great if the technical contributors in the Godot community can provide more insight into this issue.

Thanks

Re: [Godot] Light2D in add mode makes CreatureGodot node transparent

Posted: Thu Jan 24, 2019 9:36 am
by Sungray
Found this :
https://github.com/godotengine/godot/issues/17542

Seems it's indeed an issue in the Godot engine.

Re: [Godot] Light2D in add mode makes CreatureGodot node transparent

Posted: Thu Jan 24, 2019 4:53 pm
by chong
Thanks for the update, looks like a possible issue with the Godot Renderer itself...