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

Lack of ambient light with more than 2 lights causes "flashing" of whole meshes #8651

Closed
Zireael07 opened this issue May 5, 2017 · 21 comments

Comments

@Zireael07
Copy link
Contributor

Operating system or device - Godot version:
Win 7 64 bit - Godot 3.0 (May 4 build from Fixnum)

Issue description:
Meshes appear to flash depending on angle to camera. The whole single mesh flashes darker or brighter, regardless of how many faces it has. (The road is made of a sequence of meshes, each mesh has quads, one quad for one half of the road, both quads flash simultaneously)

Old road version where there is a single-face mesh for each half of the road (2x as many meshes) - at the beginning, you see some meshes on the left side flash and then the ones on the right (https://gfycat.com/TintedRealFlounder) - this is 2.x (stable)

It's not shadows (they are disabled in the example project).

The issue is much more pronounced in 2.x (stable).

(https://gfycat.com/GleamingNearKoodoo) - issue in 3.0

Steps to reproduce:
Load the example product and move the camera around a bit.
(It's less noticeable in-game but I left the car in so that you can have a look in game too)

Link to minimal example project:
The example project is a 3.0 project!
3.0flashingmeshes.zip

@bojidar-bg
Copy link
Contributor

Project is broken, plus it is far from "minimal" as it currently stands...

@Zireael07
Copy link
Contributor Author

Zireael07 commented May 5, 2017

What do you mean it's broken? It opens fine on my end...

@nunodonato
Copy link
Contributor

isn't this a z-index issue? put the road 1px higher :)

@bojidar-bg
Copy link
Contributor

@Zireael07 Here it complains about missing .tex and .tres files.

@Zireael07
Copy link
Contributor Author

@nunodonato: Believe me, moving the road 0.01, 0.02, 0.03 etc. up was one of the first things I tried. The other thing was turning off shadows.

3.0flashing meshes2.zip

I slimmed down the sample even more (turns out I missed a whole folder I'd stuffed random stuff into) and removed some old unused test things.

I even checked that I'm using matching case in script and in project. At any rate, the project opens both in editor and in play on my end, and still displays the issue as soon as you open the main scene in editor.

@eon-s
Copy link
Contributor

eon-s commented May 5, 2017

On simple meshes like the testcube I see that when turning shadows on a light, but on this project appears too but only on the editor, while running the textures are ok.

Except for the light, saw something weird, made the light pointing up and the wheels and other parts are receiving light when should not get it (model, exporter or importer issue?).

upsidedowncarandlight

(yes, I'm a bad driver)

@Zireael07
Copy link
Contributor Author

Car model is mine and admittedly not perfect, but since the same thing happens to the wheels (which are not mine, I took them from the truck town demo for 2.x) looks like something is indeed weird with lighting.

@eon-s: This was a quick export from 2.x and it appears there were changes made to the vehicle physics in-between, I already had to invert the logic for steering left/right and the car is very bouncy. So it's partially you being a bad driver and partially me not having found the right settings for 3.0.

@eon-s
Copy link
Contributor

eon-s commented May 5, 2017

Wait, when I was about to close the project, removed the environment, then the shadow (that added before) and everything suddenly looked fine in the editor.

Made some undo (to get the buggy textures) and disabled the shadows again and got this:

wut

Also noticed that sometimes the effects keep adding up for awhile (like changing specular, the effect stays after removing, same for lights), like if changes are not updated for some reason.

@Zireael07
Copy link
Contributor Author

Does the bug pop back up if you enable shadows?
I'm not averse to fiddling some with the environment node, but I need the directional light and the shadows enabled (working on a day/night system so they're the key!)

@bojidar-bg
Copy link
Contributor

Uhm, all areas where the road is "brigther" are where you are having overlap with other segments of the road. So, you can just pick up that part and move it up/delete it, and you would see it all nicely.
Low-res proof:
image

@eon-s
Copy link
Contributor

eon-s commented May 5, 2017

@Zireael07 shadows always adds that texture bug to me (on 3), maybe default shadow settings are wrong but I don't know.
Some parameters seems to make it look better like the normal bias, others used to crash the engine, like blend split (now just mess everything on the viewport).


Could be the default max distance at 0?
(I think that 2.x had that issue too for awhile)

@Zireael07
Copy link
Contributor Author

Zireael07 commented May 5, 2017

@bojidar-bg: I checked "Editable children" and tried moving apart the doubles, but they still flash (even the one on top which is certainly NOT overlapping anything).

I'll have to do something about eliminating the doubles but they are not the cause of the issue. It seems to be related to the lighting and the camera.

(Clip from stable [2.1.3] since the issue is more visible in it) - https://gfycat.com/DetailedBareGrosbeak

@themangomago
Copy link

themangomago commented May 31, 2017

I´ve got a similar problem, maybe the same.
At first I though it´s some kind of zbuffer issue, but it also applies for a simple sprite3d nodes. Found in 2.1.3.
Mesh:
mesh
Sprite3d:
sprite3d

@themangomago
Copy link

themangomago commented Jun 4, 2017

Ive added a stripped down project (2.3) to demonstrate the issue:

flicker

LightStrippedDownProblem.zip

@bojidar-bg
Copy link
Contributor

I could confirm with the given example, though I think it might be another issue (not completely sure yet), since the whole mesh is flashing, as opposed to random faces.

Note that 1) the issue is gone when the second (non-player) OmniLight is hidden/removed, and that 2) it isn't black, it is just a lack of ambient light. Also, removing the normal map makes it less likely to happen, though it still happens.

@themangomago
Copy link

Workaround I have found for my problem:

  • Adding a directional light with light on and energy zero will remove the flickers, however the normal map is now "enlighted" even in the dark.
  • Directional light + ambient light leads into massive problem while lighting simple quads/sprite3ds (not black but different shades). So I removed the ambient light and added a second omni light on the player with large radius and low energy to get back a semi-ambi light.

@Zireael07
Copy link
Contributor Author

Zireael07 commented Jun 6, 2017

@bojidar-bg: It's the same issue, see OP:

The whole single mesh flashes darker or brighter, regardless of how many faces it has

EDIT: Downloaded @Mangomago 's project and yes, it's the same issue. I stood in the doorway and looked towards the corner (either will do) and bam, flickering blackness.

I don't have an omni light in my project, just directional light plus ambient light from the environment, but I'm positive it's the same problem.

@Zireael07 Zireael07 changed the title "Flashing" meshes (both 2.x and 3.0) Lack of ambient light with more than 2 lights causes "flashing" of whole meshes Jun 18, 2017
@mikeleeman
Copy link

I have an omni light and spot light in my project, and things flicker (becomes darker or lighter) when the camera moves. Probably the same issue.

@mikeleeman
Copy link

After revisiting my ol' project and fiddled around, I can confirm that turning off ambient light causes the issue to disappear. Like mangomago said, you could use an omni-light with large radius to emulate ambient light.

@kubecz3k
Copy link
Contributor

kubecz3k commented Apr 7, 2018

First of all thank you for your report and sorry for the delay.

We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.

We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about its current status here?

For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.

Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.

Thanks in advance.

Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.

@akien-mga
Copy link
Member

As there was no answer to the above request, we're closing this issue as inactive.
If you can still reproduce it, please open a new issue against a currently supported release of Godot.

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

No branches or pull requests

8 participants