Bug 50135 - Unigine Heaven black stripes and weird shaders
Summary: Unigine Heaven black stripes and weird shaders
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r600 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-19 21:16 UTC by Micael Dias
Modified: 2019-09-18 19:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
day time rendered image 1 (1018.87 KB, image/png)
2012-05-19 21:16 UTC, Micael Dias
Details
day time rendered image 2 (1.71 MB, image/png)
2012-05-19 21:17 UTC, Micael Dias
Details
night time rendered image 1 (351.37 KB, image/png)
2012-05-19 21:18 UTC, Micael Dias
Details
night time rendered image 2 (379.07 KB, image/png)
2012-05-19 21:19 UTC, Micael Dias
Details
[PATCH] st/mesa: expose "force_glsl_extensions_warn" option (977 bytes, patch)
2012-05-19 23:28 UTC, Vadim Girlin
Details | Splinter Review
OgreSampleBrowser - Shadows (1.11 MB, image/png)
2012-09-10 12:44 UTC, Micael Dias
Details
Xonotic with shadow mapping (1.62 MB, image/png)
2013-06-03 13:55 UTC, Simone Scanzoni
Details
Xonotic with shadow mapping, sharp flavour (1.59 MB, image/png)
2013-06-03 13:59 UTC, Simone Scanzoni
Details
Xonotic with stencil shadow volumes (1.65 MB, image/png)
2013-06-03 14:01 UTC, Simone Scanzoni
Details
Xonotic without shadows from realtime world lights (1.65 MB, image/png)
2013-06-03 14:07 UTC, Simone Scanzoni
Details

Description Micael Dias 2012-05-19 21:16:49 UTC
Created attachment 61868 [details]
day time rendered image 1

Black stripes appear across geometry, which appears to be wrongly computed shadows, but I'm not sure (see day_* attachments). And some weird rendering happens when night time is rendered (see night_* attachments)

System:
OS: Arch Linux
Kernel: 3.4 RC7
OpenGL renderer string: Gallium 0.4 on AMD RV670
OpenGL version string: 2.1 Mesa 8.1-devel (git-27b821b)
OpenGL shading language version string: 1.30
Comment 1 Micael Dias 2012-05-19 21:17:36 UTC
Created attachment 61869 [details]
day time rendered image 2
Comment 2 Micael Dias 2012-05-19 21:18:04 UTC
Created attachment 61870 [details]
night time rendered image 1
Comment 3 Micael Dias 2012-05-19 21:19:55 UTC
Created attachment 61871 [details]
night time rendered image 2

A bunch of errors also appear on the console when the app starts rendering night time.
Error sample:

GLShader::loadFragment(): error in "core/shaders/default/mesh/fragment_base_light_omni.shader" file
defines: UNKNOWN,QUALITY_LOW,QUALITY_MEDIUM,MULTISAMPLE_0,USE_INSTANCING,USE_TEXTURE_3D,USE_TEXTURE_ARRAY,USE_ALPHA_FADE,USE_REFLECTION,USE_DEFERRED,USE_PARALLAX,HAS_DEFERRED_COLOR,HAS_DEFERRED_NORMAL,HAS_DEFERRED_PARALLAX,USE_PHONG_RIM,USE_ENVIRONMENT,USE_NORMALIZATION,USE_DIRECTIONAL_LIGHTMAPS,USE_SCATTERING_FALLOFF,USE_SHADOW_KERNEL,OPENGL,USE_PSEUDO_INSTANCING,USE_PSEUDO_TRANSFORM,USE_ARB_BLEND_FUNC_EXTENDED,HAS_ARB_DRAW_INSTANCED,BASE_LIGHT_OMNI,OMNI,SHADOW,PHONG_RIM,OVERLAY_0
0:629(18): error: syntax error, unexpected NEW_IDENTIFIER
Comment 4 Vadim Girlin 2012-05-19 23:28:13 UTC
Created attachment 61874 [details] [review]
[PATCH] st/mesa: expose "force_glsl_extensions_warn" option

I think attached patch might help. It allows to use less strict extension handling to workaround some unigine problems. You'll also need to set "force_glsl_extensions_warn" environment variable to "1" or "true" before running the app:

force_glsl_extensions_warn=1 ./heaven
Comment 5 hadack 2012-05-20 06:02:40 UTC
I see this too on a similar setup:
Slackware-current
kernel 3.4-rc7

OpenGL renderer string: Gallium 0.4 on AMD RV670
OpenGL version string: 2.1 Mesa 8.1-devel
OpenGL shading language version string: 1.30

The patch from Vadim fixes the night-time scenes and the errors are away, but not the wrong rendering of the shadows.
I have the same wrong shadows in HoN too, disabling shadows fixes this.
Comment 6 Micael Dias 2012-05-20 17:08:50 UTC
I confirm that the patch doesn't help with the daylight scenes. They look the same.

It helped with night time scenes, just like the previous comment says.
Comment 7 Andreas Boll 2012-09-10 12:12:44 UTC
(In reply to comment #6)
> I confirm that the patch doesn't help with the daylight scenes. They look the
> same.
> 
> It helped with night time scenes, just like the previous comment says.

The night time scenes should be fixed with the fixes from Bug 43477 .
You can test the fixes with current mesa git master or with the 9.0 branch.

What's up with the day time issue?
I can't reproduce this issue on my system:

Kernel 3.4
OpenGL renderer string: Gallium 0.4 on AMD RV770
OpenGL version string: 2.1 Mesa 9.1-devel (git-e81ee67)
OpenGL shading language version string: 1.30

Additionally I'm using MESA_EXTENSION_OVERRIDE="-GL_ARB_shader_bit_encoding"
as workaround for Bug 53118 .
Comment 8 Micael Dias 2012-09-10 12:44:16 UTC
Created attachment 66925 [details]
OgreSampleBrowser - Shadows

Appears to be related.

I'd say it looks like a depth precision/bias issue, but I'm not sure.
Comment 9 Simone Scanzoni 2013-02-27 18:54:20 UTC
I still have this problem with Mesa 9.2-devel (git-4deefd9)
( patched with:
 r600g: emit a ps partial flush after CP DMA
 r600g: enable CP DMA on r6xx (v3) )
The night times scenes work better with force_glsl_extensions_warn=true

I saw this problem with Unigine Heaven 3.0, Heroes of Newerth 3.0.3 (also 2.x) and Xonotic 0.6.0 .

I think the last one is interesting because it is under GPL and works fine if I just enable shadows from realtime world lights but shows the problem if I enable "Soft shadows" too. The tooltip of "Soft shadows" is:
[enables use of shadowmapping (depth texture sampling) instead of stencil shadow volumes, requires gl_fbo 1]
The problem in Xonotic can be seen only in a few places with dynamic world lightning, like some rooms with lava in level 6 and the lights behind some big fans in level 8.

HD3850 (RV670) AGP, kernel 3.8.0
Comment 10 Simone Scanzoni 2013-06-03 13:55:06 UTC
Created attachment 80226 [details]
Xonotic with shadow mapping

Bug still present today in Mesa 9.2.0 (git-c754f7a), kernel 3.9.4.

I saw a similar glitch also in Brütal Legend, Stacking and Costume Quest, especially with ambient occlusion, so I suppose all the games using the Buddha engine from Double Fine are affected.


I think the bug title should be changed for the following reasons:

The black stripes problem isn't specific to Unigine but happens with at least 4 different engines: Unigine, Buddha, DarkPlaces and K2.

The 3 people who see the bug here all use an RV670.

There is a workaround for the wrong shaders in the night time scenes.

The black stripes problem seems related to shadows, because disabling them in Xonotic and Heroes of Newerth removes the stripes and disabling ambient occlusion in games using the Buddha engine reduces the stripes slightly.


So I propose to change the title to: Broken shadows on RV670

I'm not sure if it's just a problem with shadow mapping because even if using stencil shadow volumes works in Xonotic the screenshot posted by Micael of the OgreSampleBrowser exhibit a similar problem and the text: "Technique Stencil".


Could the output of any R600_DEBUG setting be useful?


Attached a screenshot of the bug in Xonotic.
Comment 11 Simone Scanzoni 2013-06-03 13:59:41 UTC
Created attachment 80228 [details]
Xonotic with shadow mapping, sharp flavour

The black stripes in Xonotic can be soft or sharp.
Comment 12 Simone Scanzoni 2013-06-03 14:01:49 UTC
Created attachment 80229 [details]
Xonotic with stencil shadow volumes

Stencil shadow volumes work in Xonotic, so you can see how the shadows should be.
Comment 13 Simone Scanzoni 2013-06-03 14:07:51 UTC
Created attachment 80230 [details]
Xonotic without shadows from realtime world lights

Comparing this to the screenshot with stencil shadow volumes you can see which shadows are affected.
Comment 14 Michel Dänzer 2014-08-11 06:20:11 UTC
Is this still an issue with current Mesa?
Comment 15 Micael Dias 2014-08-11 08:48:56 UTC
(In reply to comment #14)
> Is this still an issue with current Mesa?

I no longer have access to the hardware, so I cannot confirm.
Comment 16 Alicia 2014-10-20 22:22:49 UTC
First off, please bear with me if I make some noobish mistakes. I just recently switched to Linux, and this is my first actual report I've made on a bug. This is also my first venture into the depths of the actual GPU hardware.

I have a Radeon HD3650 (RV635, non-mobility) card, and I can verify that the shadow stripes are still present. I don't play HoN, but I am playing the new S2 game, Strife, which uses the same engine. Setting shadows to lowest possible does accomplish the same as Off in HoN as mentioned above.

I'd like to point out that the stripes actually change in size depending on the variability of the setting. Medium shadows have about a 50/50 split of the dark stripe compared to the light stripe. High has mostly full shadows with a very little bit on the lighter stripe.

One last thing, and probably unrelated, but my card also seems to have problems with some transparent shaders, as well. In Strife, it's visible in the launcher quite easily.
http://i.imgur.com/17vq5In.jpg
This is with Shaders on Low. Higher settings result in worse corruption for this. The blue and green boxes seem to change depending on which part they're in. Green for the lightshaft/fog that runs across the center, as well as the gem glow in the top-left. Cyan/blue for the background lighting.

For the record, both of these problems render fine in software mode.

I'm using Xubuntu 14.04, with the obiaf ppa, if it helps, though I can say this issue is present in every version I've tried, including the default drivers on the original 14.04 disc, as well as some of the stuff I managed to get working from 13.10. Therefore, I can assume they're both not regressions, but just missing or otherwise not-fully-working implementations.
Comment 17 Alicia 2014-10-20 23:18:38 UTC
Just searching around, and found this:
https://bugs.freedesktop.org/show_bug.cgi?id=37296
Seems like this bug is similar, and possibly the same problem.

Oh, and before I forget, if anyone needs more info, or wants me to test something, I'm more than willing to help. However, in terms of applying/testing patches, I'd need some guidance since I've never done that before, so probably a how-to or whatever will be needed.
Comment 18 GitLab Migration User 2019-09-18 19:00:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/410.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.