Very strange terrain flickering...

Very strange terrain flickering...

Postby Wuzzy » 06 Apr 2014, 19:25

Oh, well. I experience some really weird behaviour in Stunt Rally.
Under some really strange conditions, parts of the layers start to flicker heavily. This flickering consists mostly of black pixels or short vertical lines or something like that. I already mentioned that in another thread.

They flicker heavily on the screen, which you of course can not see on a screenshot.

Here is an example: On this track, there are three layers. Look closely! There is one texture where there is no flicker. This is layer 3. It has a tick on “highest elevation”, the other two haven’t.
Image

The same image in test mode:
Image

Note how the blue part fits to the flicker-free part of the 1st image. And it does not flicker in test mode at all.

The weirdest thing about this bug are not the ares which flicker but the areas which do not flicker.

Here is another test. Again, there are three layers (1 to 3), only layer 3 has “Highest slopes” ticked.
Image

Here you see a very steep mountain. Note the camera is facing north.

Now I turn off test mode and turn on flicker mode ;) :
Image
Look closely. Very closely. Note how only the areas which are steep are flicker-free. Additionally to that, only the East and West side are flicker-free, but the North and South sides of the mountain do flicker. I also played around with layer angles. They don’t seem to affect at all the flicker-free zone. It seems the minimum steepness required to be flicker-free is a fixed number.

Some conclusions
It seems, the flickering almost certainly appears (at least for me) if these conditions are met:
  • Layers 1, 2 and 3 are active.
  • The other layers are not active.
  • Layer 3 has highest elevation ticked.
  • All other active layers haven’t “Highest slopes” ticked.
  • Graphics settings: Terrain detail is set to “High”.
  • Graphics settings: Triplanar is set to “max 2”.

If the conditions are met, layers 1 and 2 will flicker, but parts of layer 3 won’t flicker. A section is flicker-free if it is on layer 3, on a steep hill and either on an East or a West side hill.

Can anyone reproduce this?

OS: GNU/Linux, Linux 3.12.9
Graphics card: NVIDIA GeForce GTX 460
Graphics driver: NVIDIA 331.38
Stunt Rally: as of commit 5fb442254b0c7e59db3cc38df3f9ac81c3fca234.
User avatar
Wuzzy
 
Posts: 989
Joined: 28 May 2012, 23:13

Re: Textures flicker under very strange conditions

Postby CryHam » 06 Apr 2014, 21:53

Right. Good that you found that all out.
Now I know it most probably comes from my commit
https://github.com/stuntrally/stuntrall ... 036c368867
But why the hell I don't know, i.e. why sampling texture with yx should do sth like this on GL.
And I since that fixed wrong triplanar mapping (in this area where is doesn't flicker) I don't want to revert this just fix it somehow else.
Or maybe it is sth else because of having since then, 2 triplanar layers possible.
I'll edit that shader file and attach it for you to test.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Textures flicker under very strange conditions

Postby CryHam » 06 Apr 2014, 23:07

Could you btw try if this hapens also (and does it look anyhow different)
with different antialiasing setting (0), different anisotropy, and with terrain triplanar option Any (all).
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Textures flicker under very strange conditions

Postby CryHam » 08 Apr 2014, 18:16

Ok could you try this file instead, replace data/materials/terrain.shader with it
http://pastie.org/9004006
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Textures flicker under very strange conditions

Postby CryHam » 08 Apr 2014, 20:18

We tried it with scrawl, and we have no ideas.
Very strange bug. Doesn't happen always. And it doesn't matter what is in terrain.shader.
These blinking black pixels are in screen space.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Textures flicker under very strange conditions

Postby CryHam » 24 Apr 2014, 07:10

I've build yesterday under Kubuntu 14.04 from sources. Yay :cool:
And I didn't have this bug. :(
I had totally black terrain, due to few shader compile errors (seen in ogre.log).
I've fixed those, it's on master. I suspect they don't relate to this, since it wasn't terrain.shader.
Anyway, can you check if you have this bug still ?

What do we do now, do we release ? Honestly this is the only thing that is holding the 2.3 release.
I'm unable to reproduce this bug (I don't have it) on both Kubuntu and Windows7. Thus I can't do anything to fix it.
Except maybe an idea how to guide somebody having it, but that's IMO quite time consuming since this bug doesn't always happen.
That would require editing terrain.shader and reverting the newest things that were added (specular power, normals scale etc.), since I assume this didn't happen before them. Not sure though.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Very strange terrain flickering...

Postby Wuzzy » 24 Apr 2014, 16:23

Just a quick note: I roughly tested it today and was not able to reproduce any flickering. However, the testing was short. I don’t have much time today, hopefully I can do more testing tomorrow.
User avatar
Wuzzy
 
Posts: 989
Joined: 28 May 2012, 23:13

Re: Very strange terrain flickering...

Postby Wuzzy » 26 Apr 2014, 13:13

Damn it! I just noticed some flickering on D15-CityWall … :-(
It took a while until it finally happened, though. What a nasty bug!
(version: 85eb52ca3a …)

This bug is slightly annoying but if you can’t find a fix anymore, it is not too bad if you release anyways, since you can work around this by selecting something else than High terrain detail with “max 2” for triplanar setting.
By the way, does anyone else here in this forum ever experience this bug so far?
User avatar
Wuzzy
 
Posts: 989
Joined: 28 May 2012, 23:13

Who is online

Users browsing this forum: No registered users and 1 guest