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

Author Topic: SFML 2.0 RC: sf::RenderTexture: bug or bad use?  (Read 2015 times)

0 Members and 1 Guest are viewing this topic.

webshinra

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
SFML 2.0 RC: sf::RenderTexture: bug or bad use?
« on: May 08, 2012, 05:02:21 pm »
Hi there,
i start a project months ago, and it finally go far enough to build a GUI.
But after a moment and after a lot of optimisation, a visual artefact appear.

http://www.pasteall.org/pic/show.php?id=31433 (screen-shoot)

I will rapidly explain the rendering process:
voxel of the world are generated by a coherent noise generator and saved with semantic information in a octree.
After that, the 2D renderer run through the octree, adding sprite to many sf::RenderTexture to buffer a "zone" and after it, sf::RenderTexture are put on the main vue (as sprites) to show the world.
the sf::RenderTexture is cleared with sf::Color::Transparent, but, when put on each other sf::RenderTexture seam to keep (black) color from the background and when transparent sprite are on a border we can see a black/gray gradien.
( sf::Color::Transparent is a black transparent but if i use (255,255,255,0) as background color the border look white instead of black)

Maybe I made a mistake using RenderTexture but it look like a bug from the lib.

What's your point of vue?
« Last Edit: May 08, 2012, 05:19:13 pm by webshinra »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 RC: sf::RenderTexture: bug or bad use?
« Reply #1 on: May 08, 2012, 06:53:48 pm »
Hmm, it's hard to see what's wrong. Would you be able to write a complete and minimal app that reproduces this problem, so that I can test it?
Laurent Gomila - SFML developer

webshinra

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: SFML 2.0 RC: sf::RenderTexture: bug or bad use?
« Reply #2 on: May 08, 2012, 07:23:30 pm »
hum, i don't see how to write a 'simple' app which present this problem but I can give you access to repository and a little more explications.

https://gitorious.org/dyasb/pages/Home (wiki, for dependencies)
https://gitorious.org/dyasb/dyasbo (git repository)

the most important file is https://gitorious.org/dyasb/dyasbo/blobs/master/src/Map2dDisplay.cpp
the run() function create a array of renderTexture https://gitorious.org/dyasb/dyasbo/blobs/master/src/Map2dDisplay.cpp#line63
those rendertextures are built by "build from tree" https://gitorious.org/dyasb/dyasbo/blobs/master/src/Map2dDisplay.cpp#line217
and then displayer in the right order https://gitorious.org/dyasb/dyasbo/blobs/master/src/Map2dDisplay.cpp#line179

(if you take the time to compile the project, at the first run you will see a black screen, you should zoom back using "-" to get see the earth and then you can zoom in an navigate using the mouse)


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 RC: sf::RenderTexture: bug or bad use?
« Reply #3 on: May 08, 2012, 07:27:22 pm »
Sorry but I don't have the time to explore your project :P

Can't you write a very simplified version of what you do? If it's just drawing to render-textures which cause problems, then it's not hard to try that in a minimal main() with a window and a drawing loop.
Laurent Gomila - SFML developer

webshinra

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: SFML 2.0 RC: sf::RenderTexture: bug or bad use?
« Reply #4 on: May 08, 2012, 08:14:54 pm »
hum, i think it's the same problem as in this minimal app:
http://webshinra.fr/dyasbo.tar.gz

webshinra

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: SFML 2.0 RC: sf::RenderTexture: bug or bad use?
« Reply #5 on: May 15, 2012, 10:23:12 am »
up?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 RC: sf::RenderTexture: bug or bad use?
« Reply #6 on: May 15, 2012, 10:42:58 am »
Sorry, I didn't have the time to test it yet.
Laurent Gomila - SFML developer