Shaders not working in Second Life with Mesa + Radeon
Linux - GamesThis forum is for all discussion relating to gaming in Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Shaders not working in Second Life with Mesa + Radeon
I'm a user of the Second Life virtual space platform. So far the SL viewer worked flawlessly for me under Linux. Yesterday however, I decided to dump the proprietary ATI driver (fglrx) and let Linux switch back to the free Radeon driver and Mesa. This completely broke GLSL shaders for the Second Life viewer, although Mesa is clearly capable to support them. fglrx is problematic and I'm not going back to it, and I really need to get SL working properly again. Can anyone help and tell me what I should do?
My Linux distribution is openSUSE 13.1, KDE 4.11.2. X11 1.6.2, MESA 9.2.2, Radeon 7.2.0 (xf86-video-ati) supporting OpenGL <= 3.1. My video card is a Radeon HD 6870. The viewer I use is Firestorm LGPL version 4.5.2. Here is the console output I get when I try to enable shaders while in-world: http://pastebin.com/raw.php?i=z4P1bu91
Update: Someone on IRC asked me to take a full GLSL dump output, to see exactly what's failing in shader compilation. It didn't help clarify the issue, but I thought to post the detailed error here as well in case it might help: http://pastebin.com/raw.php?i=CsHgM1gV
Code:
GLSL source for fragment shader 68:
#version 130
precision mediump int;
precision highp float;
#define DEFINE_GL_FRAGCOLOR 1
#define FXAA_GLSL_130 1
#define ATTRIBUTE in
#define VARYING in
#define VARYING_FLAT flat in
#define texture2D texture
#define textureCube texture
#define texture2DLod textureLod
#define shadow2D(a,b) vec2(texture(a,b))
#define HAS_DIFFUSE_LOOKUP 0
/**
* @file glowExtractF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseMap;
uniform float minLuminance;
uniform float maxExtractAlpha;
uniform vec3 lumWeights;
uniform vec3 warmthWeights;
uniform float warmthAmount;
VARYING vec2 vary_texcoord0;
void main()
{
vec4 col = texture2DRect(diffuseMap, vary_texcoord0.xy);
/// CALCULATING LUMINANCE (Using NTSC lum weights)
/// http://en.wikipedia.org/wiki/Luma_%28video2013-11-14T00:40:35Z WARNING: llrender/llshadermgr.cpp(842) : loadShaderFile: GLSL Compilation Error: (0) in effects/glowExtractF.glsl
2013-11-14T00:40:35Z WARNING: llrender/llshadermgr.cpp(515) : dumpObjectLog: 0:39(1): error: syntax error, unexpected EXTENSION, expecting $end
2013-11-14T00:40:35Z WARNING: llrender/llshadermgr.cpp(869) : loadShaderFile: #version 130
2013-11-14T00:40:35Z INFO: llrender/llshadermgr.cpp(569) : loadShaderFile: Loading file: shaders/class1/effects/glowExtractF.glsl (Want class 1)
2013-11-14T00:40:35Z WARNING: llrender/llshadermgr.cpp(842) : loadShaderFile: GLSL Compilation Error: (0) in effects/glowExtractF.glsl
2013-11-14T00:40:35Z WARNING: llrender/llshadermgr.cpp(515) : dumpObjectLog: 0:39(1): error: syntax error, unexpected EXTENSION, expecting $end
2013-11-14T00:40:35Z WARNING: llrender/llshadermgr.cpp(869) : loadShaderFile: #version 130
2013-11-14T00:40:35Z WARNING: llrender/llshadermgr.cpp(905) : loadShaderFile: Failed to load effects/glowExtractF.glsl
2013-11-14T00:40:35Z WARNING: llrender/llglslshader.cpp(432) : createShader: Failed to link shader: Glow Extract Shader (Post)
2013-11-14T00:40:35Z WARNING: llrender/llglslshader.cpp(437) : createShader: Failed to link using shader level 1 trying again using shader level 0
2013-11-14T00:40:35Z WARNING: llrender/llshadermgr.cpp(576) : loadShaderFile: GLSL Shader file not found: effects/glowExtractV.glsl
2013-11-14T00:40:35Z WARNING: llrender/llshadermgr.cpp(576) : loadShaderFile: GLSL Shader file not found: effects/glowExtractF.glsl
2013-11-14T00:40:35Z WARNING: llrender/llglslshader.cpp(432) : createShader: Failed to link shader: Glow Extract Shader (Post)
2013-11-14T00:40:35Z INFO: newview/lldrawpoolbump.cpp(940) : clear: Clearing dynamic bumpmaps.
2013-11-14T00:40:35Z INFO: newview/lldrawpoolbump.cpp(168) : clear: Clearing standard bumpmaps.
2013-11-14T00:40:35Z INFO: newview/lldrawpoolbump.cpp(168) : clear: Clearing standard bumpmaps.
2013-11-14T00:40:35Z INFO: newview/lldrawpoolbump.cpp(168) : clear: Clearing standard bumpmaps.
2013-11-14T00:40:35Z INFO: newview/lldrawpoolbump.cpp(107) : addstandard: Adding standard bumpmaps.
2013-11-14T00:40:35Z INFO: newview/lldrawpoolbump.cpp(940) : clear: Clearing dynamic bumpmaps.
2013-11-14T00:40:35Z INFO: newview/lldrawpoolbump.cpp(168) : clear: Clearing standard bumpmaps.
2013-11-14T00:40:35Z INFO: newview/lldrawpoolbump.cpp(168) : clear: Clearing standard bumpmaps.
2013-11-14T00:40:35Z INFO: newview/llviewershadermgr.cpp(438) : setShaders:
~~~~~~~~~~~~~~~~~~
Loading Shaders:
~~~~~~~~~~~~~~~~~~
2013-11-14T00:40:35Z INFO: newview/llviewershadermgr.cpp(439) : setShaders: Using GLSL 1.30
2013-11-14T00:40:35Z INFO: llrender/llshadermgr.cpp(569) : loadShaderFile: Loading file: shaders/class1/windlight/atmosphericsVarsV.glsl (Want class 1)
%29
float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
float warmth = smoothstep(minLuminance, minLuminance+1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) );
frag_color.rgb = col.rgb;
frag_color.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
}
GLSL shader 68 failed to compile.
GLSL shader 68 info log:
0:39(1): error: syntax error, unexpected EXTENSION, expecting $end
Another important update: I found a simple way to temporarily fix most of the shaders. I can now enable Basic Shaders followed by Atmospheric Shaders, but Advanced Lighting Model will still not work. Seemingly due to the same issue, but in a form that's not as easy to fix. I would be grateful if someone could use the knowledge I posted up to this point to figure out how to solve those as well.
What fixes the primary shaders is commenting out all #extension lines the from glsl files. To make it easy for everyone to apply the fix, I created a bash script that does it automatically. Create an empty file in SecondLife/app_settings/shaders and paste the code below inside, then save and execute it. Make sure to backup your shaders folder first, this will permanently edit your glsl files!
Code:
#!/bin/bash
files=$(find ./* -type f -name *.glsl)
for f in ${files}
do
echo "Fixing shader file ${f}"
sed -i 's/#extension/\/\/ #extension/g' ${f}
done
you know i had this problem with another card went into settings and set it to use my settings. Instead of the programs settings.
you like to try my builds of SL I keep on bitbucket you are welcome to. The flash on a prim has been broken in the LL code for Linux since 12-8-2012
this caused me to roll back rebuild it under the my prebuilts.
Right now I have the latest builds of Firestorm 32 and 64 bit they work with slackware 13.37 14.0 14.1
the latest beta of firestorm is very sad but the latest builds are pretty good.
the 64 bit requires alien Bob's Multilib for voice. Or your distros multi arch for the 32 bit vivox voice. these are opensim builds.
here is my bucket. https://bitbucket.org/Drakeo/
I keep the latest SL build in 32 bit I hve to do this for video and html5 on a prim.
since your using 4.5.2 you are also building your own viewer ?
you really want to look at the latest beta driver out if your using the latest kernels.
always contact me inworld when I am testing.
I also keep the Latest SL client to test also. you may want to try it because firestorm is about 6 months behind Linden Labs.
I really don't think the latest mesa stuff handles shaders. good news is AMD added some nice firmware to the kernel to help the drivers along. 3.12 kernel
Quote:
Also when switching back you should always reinstall mesa
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.