#2064 closed defect (fixed)
Flickering decals in-game when camera moves
Reported by: | historic_bruno | Owned by: | historic_bruno |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 18 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description (last modified by )
This has long been noticeable on the gold mines around player 1's base on Acropolis I. If the camera was moved slightly, the mine would go darker or lighter. I don't notice it in Atlas. Here's a comparison to show the difference, but it's more annoying and visible in motion:
Curiously, r13603 changed the map's The only config options needed to reproduce this for me are
PostEffect
from "hdr" to "default" and the glitch went away.
preferglsl=true gentangents=true
(so it seems post processing is affecting rendering even when
postproc=false
.)
OS : Win7 SP 1 (6.1.7601) CPU : x86, Intel Core i7-2600K @ 3.40GHz (1x4x2), 3.39 GHz Memory : 8192 MiB; 5098 MiB free Graphics Card : ATI AMD Radeon HD 6800 Series OpenGL Drivers : 4.2.12217 Compatibility Profile Context 12.104.0.0; atioglxx.dll (6.14.10.12217)
Change History (12)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
Description: | modified (diff) |
---|
comment:3 by , 9 years ago
comment:5 by , 9 years ago
Summary: | Flickering on some mines in-game when camera moves → Flickering decals in-game when camera moves |
---|
comment:7 by , 9 years ago
It's caused by the GLSL terrain shaders, particularly when normal or specular mapping are enabled (they are in the above examples, via terrain_norm or terrain_norm_spec materials added around r12508). I don't know why it only affects decals, since terrains also use these materials - still it may be related to #2070. Nor do I know why it's not visible in Atlas and only on some maps in-game: I've tried to make the simplest possible test maps without success.
I've traced it back to the bumplight
variable calculated in terrain_common.fs:
vec3 bumplight = max(dot(-sunDir, normal), 0.0) * sunColor;
normal
or v_normal
seem to be the first variables in the shader that cause the flicker behavior.
comment:8 by , 9 years ago
Unfortunately I don't know an easy way to debug the shaders :/ It would be handy to only look at them in the case of decals, and to be able to inspect the variable values.
comment:9 by , 9 years ago
Hacky solution: I modified the shader to use v_normal as the fragment color, to make the different behavior more obvious. Notice how drastically the normal vector changes with a small camera tilt, doesn't seem like it should change at all...
comment:10 by , 9 years ago
Looks like decals aren't even constructing a normal vector to pass into the GLSL shader, so it's just using garbage data... Luckily, the fix isn't too complicated, but this is something that really should throw an error if possible.
comment:11 by , 9 years ago
Milestone: | Backlog → Alpha 18 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:13 by , 9 years ago
Referenced the wrong ticket in r16394, it should have been this obviously.
Scratch the part about
PostEffect
, it happens either way.A similar glitch on field decals: