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

Rendertextures still broken on old Intel graphics chips #418

Closed
mattreecebentley opened this Issue Jul 1, 2013 · 7 comments

Comments

Projects
None yet
3 participants
@mattreecebentley

mattreecebentley commented Jul 1, 2013

I'd read that the rendertexture problems with intel graphics chipsets had been solved, they probably have been for newer chipsets.
I checked the following code (see after this statement) with an Asus 1000HA, older intel chipset (works fine for everything else in SFML) and it glitched out on rendertextures. Compiled with latest stable mingw GCC and SFML2, works fine on every other (non intel graphics) machine I've tried it on. The Asus has had no problem with games I've played on it.

/* 
 * File:   main.cpp
 * Author: paulo radtke
 *
 * Created on 2 de Abril de 2013, 00:15
 * http://chienloco.com/blog
 */

#include <cstdlib>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>

using namespace std;

int main(int argc, char** argv) {
    // Create the main window with an arbitrary resolution
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
    window.setMouseCursorVisible(false);
    window.setFramerateLimit(60);
    window.setVerticalSyncEnabled(true);

     // Load a sprite to display and create its texture
    sf::Texture textBackground;
    if (!textBackground.loadFromFile("resources/sfml_logo.png"))
        return EXIT_FAILURE;
    sf::Sprite background(textBackground);  

    // Creates the off screen rendering target with the fixed resolution
    sf::RenderTexture offscreen;
    if(!offscreen.create(1280,720,false))
        return EXIT_FAILURE;

    // We set this texture for smoothing, so it looks good when scaling
    offscreen.setSmooth(true);

    // The offset to draw the texture and creates the scrolling illusion
    int offset=0;   

    // Start the game loop
    while (window.isOpen())
     {
        sf::Event event;

        while (window.pollEvent(event)) {
            // Close window : exit
            if (event.type == sf::Event::Closed || sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
                window.close();
        }

        offscreen.clear();

        // Calculates the offset for the x and y axis and draws the sprites
        int offx = (640.0 * offset)/640.0;
        int offy = (360.0 * offset)/640.0;

        for(int line = 0;line < 3 ; line++)
            for(int column = 0 ; column < 3 ; column++){
                background.setPosition((float)(column*640 - offx), (float)(line*360 - offy));
                offscreen.draw(background);
            }         

                // Flushes the off screen rendering target
        offscreen.display();

        if(++offset >= 640)
            offset=0;

        // Update the window
        window.clear();
        sf::Sprite temp(offscreen.getTexture());

        // Calculates the scale according to the video resolution and the position
        temp.scale(800/1280.0, 450/720.0);
        temp.setPosition(0, 75);
        window.draw(temp);
        window.display();        
    }    
    return EXIT_SUCCESS;
}
@LaurentGomila

This comment has been minimized.

Show comment
Hide comment
@LaurentGomila

LaurentGomila Jul 1, 2013

Member

it glitched out on rendertextures

Can you describe this more precisely, what happens exactly? Maybe you can upload a screen capture or a video?

Member

LaurentGomila commented Jul 1, 2013

it glitched out on rendertextures

Can you describe this more precisely, what happens exactly? Maybe you can upload a screen capture or a video?

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Jul 1, 2013

Member

If it's the same I've had on my Eee PC 1000H, then the render texture just stays in one color IIRC.

Member

MarioLiebisch commented Jul 1, 2013

If it's the same I've had on my Eee PC 1000H, then the render texture just stays in one color IIRC.

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Jul 1, 2013

Member

Just tried your example using the new SFML logo:

Desktop PC with Nvidia GTX 680 with Windows 8:
Desktop

Asus Eee PC 1000H with Windows 7:
Eee PC

This is no still image however, instead it's animated as expected, but the texture appears stretched.

Edit: The oversized render texture isn't the issue here. I've downsized it to 800x600, yet having the same issue.

Member

MarioLiebisch commented Jul 1, 2013

Just tried your example using the new SFML logo:

Desktop PC with Nvidia GTX 680 with Windows 8:
Desktop

Asus Eee PC 1000H with Windows 7:
Eee PC

This is no still image however, instead it's animated as expected, but the texture appears stretched.

Edit: The oversized render texture isn't the issue here. I've downsized it to 800x600, yet having the same issue.

@LaurentGomila

This comment has been minimized.

Show comment
Hide comment
@LaurentGomila

LaurentGomila Jul 1, 2013

Member

Thanks for the test and screenshots.

However it's hard to understand exactly what happens without seeing it in action, could you make a video (or an animated GIF 😄)?

Member

LaurentGomila commented Jul 1, 2013

Thanks for the test and screenshots.

However it's hard to understand exactly what happens without seeing it in action, could you make a video (or an animated GIF 😄)?

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Jul 1, 2013

Member

Might try later, once Windows Update is done (haven't turned it on in over a year). Although it's really just like stretching the topmost (or bottommost?) part of the render texture.

Member

MarioLiebisch commented Jul 1, 2013

Might try later, once Windows Update is done (haven't turned it on in over a year). Although it's really just like stretching the topmost (or bottommost?) part of the render texture.

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Jul 1, 2013

Member

Captured a short video of the window.. As for reference, just use the code above together with the logo PNG from the OpenGL example (think it's been from that one).

Member

MarioLiebisch commented Jul 1, 2013

Captured a short video of the window.. As for reference, just use the code above together with the logo PNG from the OpenGL example (think it's been from that one).

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Oct 31, 2013

Member

Just to note it here as well: Issue is fixed on my Eee PC (Intel GMA 450 I think).

Member

MarioLiebisch commented Oct 31, 2013

Just to note it here as well: Issue is fixed on my Eee PC (Intel GMA 450 I think).

jcowgill added a commit to jcowgill/SFML that referenced this issue Sep 22, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment