Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glowmaps fail on open-source Radeon driver #711

Closed
Luomu opened this issue Oct 21, 2011 · 7 comments
Closed

Glowmaps fail on open-source Radeon driver #711

Luomu opened this issue Oct 21, 2011 · 7 comments

Comments

@Luomu
Copy link
Member

Luomu commented Oct 21, 2011

Got a report on IRC from an Arch Linux user.
Couple of screenshots that show the situation quite well:

Looks like glowmap (only used on the new buildings) is somehow bound on texture slot 0, which is why it appears on the eagle as well.

It apparently works with the proprietary driver.

The driver version is.
xf86-video-ati
6.14.2-2

@Luomu
Copy link
Member Author

Luomu commented Oct 22, 2011

I now reproduced the situation in Ubuntu/gallium driver.

@robn
Copy link
Member

robn commented Oct 28, 2011

I've also managed to reproduce this on VMware Workstation 8 running Windows 7 64-bit (on Linux x86_64 with proprietary NVidia drivers). This was after starting the game and returning to the menu:

Amusingly I may have known about this for a while. The models have always been "black" under VMware, but I always assumed that was due to deficiencies in its drivers. Perhaps we're actually doing something slightly wrong that some drivers can cope with (like the Radeon HDR shader thing we had a while back)?

@Luomu
Copy link
Member Author

Luomu commented Oct 31, 2011

I poked at this for a while. If you want to workaround this, comment out lines

if ( useglow )
    emission = texture2D(texGlow, gl_TexCoord[0].st);

in data/shaders/model.frag.glsl and at least you'll have textures back. I did not, however, manage to fix this. Just sampling that second texture messes up the result, and it seems like a branching problem as well. That if(useGlow) bit is always run. Setting the condition "if (false)" works - but it could be that it's then optimized out.

So, problems with multiple textures perhaps. HDR mode doesn't work either on these drivers, but it's a bit more complicated. Even basic multitexturing like this doesn't work:

uniform sampler2D Texture0;
uniform sampler2D Texture1;

void main(void)
{
   vec4 one = texture2D(Texture0, gl_TexCoord[0].st);
   vec4 two = texture2D(Texture1, gl_TexCoord[0].st);
   gl_FragColor = mix(one, two, 0.5); // equivalent to (one * 0.5) + (two * 0.5)
}

I always get only the second texture.

Things to do:

  • try bleeding edge drivers
  • come up with a shader organization where we can turn off individual graphical features without relying on branching - turning off shaders entirely is a bit of an excessive workaround.

@jaj22
Copy link
Contributor

jaj22 commented Nov 25, 2011

While testing various stupid ideas on VMware, I discovered that this only happens when the main texture is bound to texture unit 0. Other combinations such as tex 1, glow 0 or tex 1, glow 2 work fine.

I'm not happy to put this down to a driver bug when there are so many that exhibit the same symptoms, but I'm struggling to think of any way that Pioneer could cause it.

jaj22 pushed a commit to jaj22/pioneer that referenced this issue Nov 25, 2011
@Luomu
Copy link
Member Author

Luomu commented Nov 25, 2011

I tried to reduce the test case even further: 3c6afef672c019e016bee10331e14d1ed195e22c

Blending a red & blue texture, on FGLRX it works (disregard the blue tint, it came from the compiz screenshot tool):

On whatever free drivers Ubuntu offers by default, GLSL works but only one texture is visible:

After the workaround above, using texture units 1 & 2 it blends OK:

Weird.

jaj22 pushed a commit to jaj22/pioneer that referenced this issue Nov 25, 2011
@jaj22
Copy link
Contributor

jaj22 commented Nov 25, 2011

That's now four days I've wasted tracking down bugs (this is the second) in that goddamn multi-line #define.

@robn
Copy link
Member

robn commented Nov 25, 2011

Do you know where tomm lives? :)

@robn robn closed this as completed Nov 25, 2011
robn added a commit to robn/pioneer that referenced this issue Nov 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants