[0.15.x] Weird line artifacts in radar-world view

This subforum contains all the issues which we already resolved.
Post Reply
r0mai
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Feb 28, 2017 8:26 pm
Contact:

[0.15.x] Weird line artifacts in radar-world view

Post by r0mai »

The lines are stationary, but they have the same "vibrating" effect as the rest of the radar screen.

It does not happen in non radar-world views.
It looks the same with and without vsync enabled.
The lines have been there since the first 0.15 release.

Spec:
OS: OS X 10.11.6
GPU: Intel Iris Pro 1536 MB

This is how it looks like (zoom in for better views):
Image

Graphics settings:
Image

Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by Aeternus »

Turn off "wait for vsync" and try again? Looks like the grain overlay is causing this.

r0mai
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Feb 28, 2017 8:26 pm
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by r0mai »

Yes, that was my first guess too, but:
r0mai wrote: [...]
It looks the same with and without vsync enabled.
[...]

Harkonnen
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Sep 02, 2016 9:23 am
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by Harkonnen »

We use this function for radar-view noise
return frac(sin(a * 12.9898 + b) * 43758.5453);

So I'd guess it is low precision 'sin' implementation inside Intel Iris or maybe bad tolerance for argument wrapped around 2*pi many times. Do those lines stay at the same place relatively to monitor edges when you scroll?

r0mai
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Feb 28, 2017 8:26 pm
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by r0mai »

yes, they stay at the same place relative to the monitor edges regardless of where I move or zoom the camera.

r0mai
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Feb 28, 2017 8:26 pm
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by r0mai »

If that helps, I'm happy to compile and run some C++ code, to aid debugging this GPU.

Harkonnen
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Sep 02, 2016 9:23 am
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by Harkonnen »

You can play with Factorio/data/core/graphics/shaders/zoom-to-world.glsl

r0mai
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Feb 28, 2017 8:26 pm
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by r0mai »

I played with it a bit. I reproduced the problem on a constant color background and timer uniform's value hardcoded. I used the following noise function:

Code: Select all

vec3 getnoise3(vec2 p)
{
  return vec3(
    0.0,
    fract(sin(p.x + 50.0) * 10.0),
    0.0
  );
}
The issue is clearly visible, if you increase the 50.0 constant to let's say 50000000.0 (at least on my GPU).

In other words it only happens if timer value is too large (in the millions range). A quick workaround could be to reduce the domain to let's say [0, 50000]:

Code: Select all

vec3 getnoise3(vec2 p)
{
  return vec3(hash3(p.x, p.y, floor(mod(timer, 50000.0) / 3.)));
}
I hope this helps.

Harkonnen
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Sep 02, 2016 9:23 am
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by Harkonnen »

Thanks, we'll check that :) Sorry for late reply with important thing, you can also start factorio with "--shader=runtime-reload" parameter - this way shaders will be reloaded with every frame, no need to restart the game. Though with directx version it will reload .cso, so you will have to run compile.bat after every attempt, or work directly with glsl version - it's reloaded by game from source without any intemediates. I.e. edit .glsl - hit Ctrl-S (or command-S probably in Mac), immediately see result. For that in case of windows start factorio with "--force-opengl" key, in case of mac/linux it's opengl anyway.

Harkonnen
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Sep 02, 2016 9:23 am
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by Harkonnen »

I couldn't reproduce those lines in my GTX570M, but issue is clear - you had that being long into the game (big tick count) while I tested from the start. So if Intel decided to use half-precision for floats or something, that would lead to this kind of problems.

What if you use original shader code with a single change of

Code: Select all

return vec3(hash3(p.x, p.y, floor(mod(timer, 50000.0) / 3.)));
for noise function? if that solves the problem - we will put it this way into next release.

r0mai
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Feb 28, 2017 8:26 pm
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by r0mai »

Oh --shader=runtime-reload is good to know :)

What is timer equal to? Number of ticks since map start? Indeed the lines don't appear on a newly generated map.

Harkonnen
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Sep 02, 2016 9:23 am
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by Harkonnen »

Yes, looks like a tick number (actually posila wrote this code)

Harkonnen
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Sep 02, 2016 9:23 am
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by Harkonnen »

Should be fixed in 0.15.21

r0mai
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Feb 28, 2017 8:26 pm
Contact:

Re: [0.15.x] Weird line artifacts in radar-world view

Post by r0mai »

Thanks, I don't see the lines anymore!

Post Reply

Return to “Resolved Problems and Bugs”