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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Zapfyr

Pages: [1]
1
Graphics / Updating texture data, very slow on Intel graphics.
« on: January 31, 2013, 10:18:19 am »
Hi,

I have been playing around with the Intel NUC (DC3217IYE to be specific) which uses Intel HD 4000 graphics. And for some reason updating a sf::Texture is painfully slow compared to Nvidia or AMD graphics. After some googling I found these:

http://www.opengl.org/discussion_boards/showthread.php/175501-glTexSubImage-still-unacceptable-slow
http://forums.inside3d.com/viewtopic.php?t=2465

This is the code that updates the actual texture in SFML:
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
 

If it were to be changed to:
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
 

it would improve performance a lot (on, some, Intel graphics). Now I do not exactly know if some thing else have to be changed to make this work, I just though I should tell you about my findings. :)

I have tried this when streaming video to a texture using GStreamer, so I know that it makes a LOT of difference on Intel hardware and that it does not impact performance on Nvidia or AMD hardware. The streaming has been done with both PBOs and just a simple glTexSubImage2D call and both methods become significantly faster when using GL_BGRA and GL_UNSIGNED_INT_8_8_8_8_REV.

// Zap

2
Graphics / AMD CCC 12.10/12.11 beta + RenderTexture = BSOD
« on: December 13, 2012, 10:47:48 am »
Hi,

I'm using a AMD HD7870 Eyefinity edtion card with the 12.11 beta driver. I have built the latest version of SFML for Win32 and I am using Visual Studio 2010 Pro.

The problem:
While things work pretty nice while running the actual program (execpt for the issue when clearing it http://en.sfml-dev.org/forums/index.php?topic=9350.msg63358#msg63358, which I still got) I get some BSOD when exiting the application, it some times happens many times in a row and some time very infrequently. This seems to happen more often when using the 12.10 driver than the 12.11 beta driver and it seems that it never happens when not using a RenderTexture. I would roll back the driver even further but I want to make use of Eyefinity, for 6 screens, (I get BSOD with and without Eyefinity enabled) which doesn't work that great with older drivers.

Test program:
static bool useRenderTexture = true;

main(int argc, char *argv[])
{
    sf::VideoMode desktopVideoMode = sf::VideoMode::getDesktopMode();
    sf::VideoMode selectedMode     = desktopVideoMode;

    sf::ContextSettings contextSettings;
    contextSettings.antialiasingLevel = 8;

    sf::RenderWindow window(selectedMode, "Test", sf::Style::Fullscreen, contextSettings);
    window.setFramerateLimit(60);

    sf::Sprite        renderSprite;
    sf::RenderTexture renderTexture;
    if (useRenderTexture)
    {
        renderTexture.create(selectedMode.width, selectedMode.height);
        renderSprite.setTexture(renderTexture.getTexture(), true);
    }

    sf::RectangleShape rectangeShape;
    rectangeShape.setSize(sf::Vector2f(selectedMode.width / 2.0f, selectedMode.height / 2.0f));
    rectangeShape.setPosition(50.f, 50.f);
    rectangeShape.setFillColor(sf::Color::Red);

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

        if (useRenderTexture)
        {
            renderTexture.clear();
            renderTexture.draw(rectangeShape);
            renderTexture.display();

            window.clear();
            window.draw(renderSprite);
            window.display();
        }
        else
        {
            window.clear();
            window.draw(rectangeShape);
            window.display();
        }
    }
}
 

// Zap

3
General discussions / GStreamer SDK and SFML
« on: October 09, 2012, 03:23:02 pm »
Hi,

Using  GStreamer SDK (http://gstreamer.com/, i.e. GStreamer that is cross-platform) together with SFML would be cool. I.e. it would be pretty awesome to use it to decode a movie to a texture and use it in a sprite in SFML. As I am pretty new to both SFML and GStreamer SDK it would be awesome if someone with a bit more experience could give me hint or two how I could achieve the whole decode a movie to a texture and render it trough a sprite-process. :)

// Zap

4
Graphics / RenderTexture won't clear properly
« on: October 08, 2012, 03:50:39 pm »
Hello,

I'm using SFML 2.0 (compiled from the source files) on windows and I am trying to use the rendertexture. Which works fine as long as I do not move anything around, when I animated a sprite to move I got the following effect:


The code for this is a bit complex, however the core of it is the following:
renderTexture->clear();

/// Draw everything!
RenderingManager::RenderObjects(renderTexture);

renderTexture->display();

// Clear screen
window->clear();

window->draw(*renderSprite);

// Update the window
window->display();

RenderingManager::ClearRenderList();
 

Which is built around the example code for rendertexture usage:
 // Create a new render-window
 sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

 // Create a new render-texture
 sf::RenderTexture texture;
 if (!texture.create(500, 500))
     return -1

 // The main loop
 while (window.isOpen())
 {
    // Event processing
    // ...

    // Clear the whole texture with red color
    texture.clear(sf::Color::Red);

    // Draw stuff to the texture
    texture.draw(sprite);  // sprite is a sf::Sprite
    texture.draw(shape);   // shape is a sf::Shape
    texture.draw(text);    // text is a sf::Text

    // We're done drawing to the texture
    texture.display();

    // Now we start rendering to the window, clear it first
    window.clear();

    // Draw the texture
    sf::Sprite sprite(texture.getTexture());
    window.draw(sprite);

    // End the current frame and display its contents on screen
    window.display();
 }
 

I am running this on a AMD HD7870 Eyefinity card on 2 monitors with the latest drivers installed.

// Zap

5
Graphics / SFML 2.0 Missing text characters in Linux.
« on: October 02, 2012, 11:51:13 am »
Hi,

I have downloaded the latest SFML source and built it on both Linux and Windows. On Linux some characters; å, ä and ö (from the Swedish alphabet) are missing and a box is drawn instead of the character.

When drawing large texts boxes around the characters appear, I read some where that is a known bug, will that be solved soon?

// Zap

Pages: [1]
anything