Project

General

Profile

Bug #4143

Antialiasing produces graphical artifacts when used with shader lighting

Added by Andrei Kortunov 7 months ago. Updated 8 days ago.

Status:
Closed
Priority:
Normal
Category:
Rendering
Target version:
Start date:
10/05/2017
% Done:

100%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

White dots and lines are produced on large distance.

GTX 1050, nvidia-drivers 390.42, OSG-3.4.1-scrawl

IIRC, MGE had a similar problem. I do not know if it was fixed.

Screenshot_20171006_213729.jpg View (903 KB) Andrei Kortunov, 10/06/2017 07:44 PM

Screenshot_Pelagiad.jpg View (359 KB) Andrei Kortunov, 03/20/2018 07:18 AM

Associated revisions

Revision b08d7b4a (diff)
Added by Alexei Dobrohotov 9 days ago

Use centroid interpolation for shader lighting (fixes #4143)

History

#1 Updated by scrawl . 7 months ago

How about a full resolution screenshot? I can hardly see anything. Does this affect the terrain only ? Is distant terrain on or off? Also I'm not sure what you mean by 'on large distance' - does this only happen when viewing distance is set higher (and then also to non-distant spots), or does it only occur at set distances regardless of what viewing distance is set to?

There's a well-known phenomenon in rendering (which I forgot the name of) that can produce these small artifacts (or gaps) for non-connecting faces, and many of vanilla Morrowind's meshes also suffer from this issue. This ideally shouldn't affect the terrain, though (that's just a heightmap, so we can lay out the triangles in whatever form we want that's not prone to artifacts).

#2 Updated by scrawl . 7 months ago

There's a well-known phenomenon in rendering

That one should occur regardless of whether or not shaders are used.

#3 Updated by Andrei Kortunov 7 months ago

When a player moves, this white dots are turned to twitchy white lines.

#4 Updated by Andrei Kortunov 7 months ago

Does this affect the terrain only ?

All types of objects are affected (terrain, statics, actors, etc.).

Is distant terrain on or off?

The distant terrain is on, but I have never seen such artifacts on the distant terrain, only the common one is affected.

That one should occur regardless of whether or not shaders are used.

As I mentioned, there are no artifacts if shaders are disabled.
Also I had a similar problem with MGE several years ago on Windows 7 (GT8600 GPU), but not with clean Morrowind.

#5 Updated by AnyOldName 3 7 months ago

If you've got distant terrain on, then it's possible that you're stretching out the depth buffer and then suddenly the lack of resolution could cause problems, so doing a test with it off might be helpful.

#6 Updated by Andrei Kortunov 7 months ago

Tested without Distant Terrain, no difference.

#7 Updated by Alexei Dobrohotov 4 months ago

  • Operating system changed from Linux to Other

I've noticed the same artifacts in similar conditions on Windows. Same video card, 388.13 driver version, latest available Ace's nightly build (so OSG 3.4.1).

#8 Updated by Andrei Kortunov 4 months ago

  • Status changed from New to Confirmed

#9 Updated by Andrei Kortunov about 1 month ago

I attached a screenshot in Pelagiad. You clearly can see a vertical white line on the tower.

#10 Updated by Alexei Dobrohotov 11 days ago

Something similar to this issue is going on here, I think.

I guess normals need to be normalized somewhere in the object_fragment.glsl file instead of object_vertex.glsl (line 61).

#11 Updated by Alexei Dobrohotov 11 days ago

Sorry, not the line 61, my shader files were modified.

#12 Updated by Andrei Kortunov 11 days ago

Take a look at objects_fragment.glsl.
When I completely remove lines 115-119, there are no artifacts (despite objects are too bright).
Any ideas?

#13 Updated by Andrei Kortunov 11 days ago

  • Description updated (diff)

#14 Updated by Alexei Dobrohotov 11 days ago

I tried to add centroid qualifier to lighting vector in objects_fragment.glsl (looks like only per-vertex lighting has the artifacts). It seems to work, though it may be just a cheap workaround.

#if !PER_PIXEL_LIGHTING
centroid varying vec4 lighting;
#else

(line 50)

#15 Updated by Alexei Dobrohotov 11 days ago

  • Subject changed from "Force shaders" setting produces graphics artifacts to Antialiasing produces graphical artifacts when used with per-vertex shader lighting
  • Status changed from Confirmed to Resolved
  • Assignee set to Alexei Dobrohotov
  • Target version set to openmw-0.44
  • % Done changed from 0 to 100

#16 Updated by Andrei Kortunov 10 days ago

looks like only per-vertex lighting has the artifacts

Nope, per-pixel has it too.

#17 Updated by Alexei Dobrohotov 10 days ago

  • Subject changed from Antialiasing produces graphical artifacts when used with per-vertex shader lighting to Antialiasing produces graphical artifacts when used with shader lighting

#18 Updated by Alexei Dobrohotov 8 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF