Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Graphical artifacts in Windows 8 (with Radeon HD)  (Read 3715 times)

0 Members and 1 Guest are viewing this topic.

cf

  • Newbie
  • *
  • Posts: 9
    • View Profile
Graphical artifacts in Windows 8 (with Radeon HD)
« on: November 17, 2012, 05:22:52 pm »
Hi,

I just installed Windows 8 and Visual Studio 2012 and am having some problems with SFML 2.0.
In my actual application there's quite a lot of weird graphical artifacts, but I noticed there was a problem with text specifically, so I created a minimal example (from the SFML pong-example code actually) showing it:

#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600, 32), "SFML Pong");

    // Load the text font
    sf::Font font;
    if (!font.loadFromFile("resources/sansation.ttf"))
        return EXIT_FAILURE;

    // Initialize the pause message
    sf::Text pauseMessage;
    pauseMessage.setFont(font);
    pauseMessage.setPosition(20, 20);
    pauseMessage.setColor(sf::Color::White);
    pauseMessage.setString("Welcome to SFML pong!");

    while (window.isOpen())
    {
        // Handle events
        sf::Event event;
        while (window.pollEvent(event))
        {
            // Window closed or escape key pressed: exit
            if ((event.type == sf::Event::Closed) ||
               ((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape)))
            {
                window.close();
                break;
            }
                }

        // Clear the window
        window.clear(sf::Color(50, 200, 50));

                sf::RectangleShape r(sf::Vector2f(10,10));
                r.setPosition(10,10);
                window.draw(r);
                window.draw(r); // Comment out to fix text
                window.draw(pauseMessage);

        // Display things on screen
        window.display();
    }

    return EXIT_SUCCESS;
}

With the second call to draw the RectangleShape commented out, I get this as expected:


But commenting it in yields this:


I've tried a few things to troubleshoot this:
- It does not matter if I'm drawing the same object twice, or two different ones.
- Calling draw on the text again (with another colour or in another location so it doesn't blend in) shows correctly.
- The colour of the rectangle does not matter -- the "text-boxes" are the text's colour.
- Looking at draw(...) in RenderTarget and what it calls, I can't see any state that could've been kept by SFML between drawing the rectangle and text.

This leaves me thinking there must be some error in the graphics driver which doesn't operate OpenGL's state-machine correctly so the state from drawing the second rectangle somehow persists to the next draw call. To further test this, I tried running an old build of my application built by VS2010 in Windows 7 (where it worked fine) and it also shows artifacts there. Other OpenGL-applications works fine though (tested Quake 3 and an OpenGL 3.3-application (i.e. not fixed function pipeline)).

Any suggestions what I could do? Seeing as other OpenGL-applications work fine, I'm 1) not entirely confident it's a problem with OpenGL, and 2) even if it is it seems like a very localized problem so there's probably little hope for a fix any time soon.

I have a Radeon HD6950 and am running the latest driver (Catalyst 12.10).

Edit: Oh, and BTW, this is with the newest snapshot of SFML 2.0 (044eb858). I also tested one from around the start of May since that seems to be when the RC was built (as the working-in-Win7-but-not-Win8-VS2010-build used it) . Same problem.
« Last Edit: November 17, 2012, 05:30:31 pm by cf »

Perde

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Graphical artifacts in Windows 8 (with Radeon HD)
« Reply #1 on: November 17, 2012, 05:40:03 pm »
Oh thank god, I'm not the only one. I posted a video in another thread that showed the same problem (it doesn't add anything useful, so there's no real need to link it).

Happens on Windows 7 x64 as well, with a Mobility Radeon HD5650 (Catalyst 12.10 as well).

cire

  • Full Member
  • ***
  • Posts: 138
    • View Profile

Perde

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Graphical artifacts in Windows 8 (with Radeon HD)
« Reply #3 on: November 17, 2012, 06:41:31 pm »
http://en.sfml-dev.org/forums/index.php?topic=9561.0

Much appreciated, thanks. Updated to 12.11 Beta and everything works as intended.

cf

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Graphical artifacts in Windows 8 (with Radeon HD)
« Reply #4 on: November 17, 2012, 07:33:08 pm »
http://en.sfml-dev.org/forums/index.php?topic=9561.0

Much appreciated, thanks. Updated to 12.11 Beta and everything works as intended.
Yep, for me too.  Thanks for posting.
Great to see AMD not bothering to update it's buggy non-beta-drivers for nearly a month now. ::)