Godot: Inconsistent OmniLight energy in GLES2.

Created on 11 May 2019  路  9Comments  路  Source: godotengine/godot

Godot version:
v3.1.1.stable

OS/device including version:
Linux Mint 19.1
NVIDIA GP106 [GeForce GTX 1060 6GB], Driver version: 418.56

Issue description:
This may or may not be the same issue as #26269, not sure.
I have set up a small interior scene with a single MeshInstance and 4 OmniLights illuminating it.
When moving the camera through the scene, the OmniLights sometimes turn way brighter than what they should be, as if their energy value is being changed.
This does not happen in GLES3.

Update: It also happens with SpotLights.

Video:
https://gfycat.com/givingunawarekinkajou

Minimal reproduction project:
Minimal reproduction project

bug confirmed rendering

Most helpful comment

Alright thx @clayjohn! I'll begin working on this asap, although I might take a bit longer than 2 weeks. This seems a tough one to crack. I'll reference this issue when I create the pull request.

All 9 comments

It appears that some of the lights that are supposed to be culled are being drawn over top of the one light rather than the light itself changing brightness. There must be some sort of overlapping memory error, or maybe some state isn't being properly reset between lights.

I can confirm that the issue exists with Spotlights as well. I took a video in my project.

Video:
https://i.imgur.com/mPGD8Ct.gifv

Hello there, I'd like to work on this. If possible could I get some pointers on where to start? (this doesn't seem to be a problem where i can simply do "search on the entire project" and find a nice starting pointer XD)

@SonerSound Since the issue is in GLES2 you are likely to find the issue in rasterizer_storage_gles2.cpp or rasterizer_scene_gles2.cpp

Another thing I noticed while confirming this issue was that the order that you show/hide the lights matters. So this may be an issue of transforms being copied on show/hide or maybe there is a loop for all the lights that needs to change its size depending on how many lights are visible.

Alright thx @clayjohn! I'll begin working on this asap, although I might take a bit longer than 2 weeks. This seems a tough one to crack. I'll reference this issue when I create the pull request.

Thank you for picking it up @SonerSound!

I am having the same issue.

Godot 3.1.1.stable.official
Linux 5.1.5-arch1-2-ARCH x86_64
radeon driver

Simple scene with 3 Omnilights or Spotlights. You walk around and somewhere some lamp will flash like double the brightness, depending on the angle that the camera is turned.

It doesn't happen if you switch to GLES3 in the editor.

https://www.youtube.com/watch?v=UmGrd8CoiiQ

@ballerburg9005 I'm working on this on the little free time I have, and I've already pinpointed a possible cause. Since this is a bit out of my scope of knowledge (need to learn more renderings stuffs) I'm having trouble finding a nice fix. I expect to have this done in 1 month more or less.

@SonerSound feel free to drop into the developers irc channel and ask lots of questions. There are plenty of devs who can help you as you work through this issue. http://docs.godotengine.org/en/latest/community/channels.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nunodonato picture nunodonato  路  3Comments

SleepProgger picture SleepProgger  路  3Comments

Spooner picture Spooner  路  3Comments

bojidar-bg picture bojidar-bg  路  3Comments

kirilledelman picture kirilledelman  路  3Comments