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

Author Topic: SFML 2.3 depth testing issue  (Read 2755 times)

0 Members and 1 Guest are viewing this topic.

zerrer

  • Newbie
  • *
  • Posts: 9
    • View Profile
SFML 2.3 depth testing issue
« on: July 06, 2015, 09:52:25 pm »
Hello,
I have noticed that there is an issue with depth testing in sfml 2.3:

Here is a scene rendered using SFML 2.3 lib:
http://i.imgur.com/sfQNwNb.png

with SFML 2.2 :
http://i.imgur.com/00Fi2Yt.png

thanks

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: SFML 2.3 depth testing issue
« Reply #1 on: July 06, 2015, 09:59:51 pm »
And the problem is?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.3 depth testing issue
« Reply #2 on: July 06, 2015, 10:19:50 pm »
Have you tried to explicitly request a depth-buffer in the context settings when you create the window? As far as I remember, the context selection algorithm has changed, and may lead to contexts without depth-buffer by default.
Laurent Gomila - SFML developer

zerrer

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: SFML 2.3 depth testing issue
« Reply #3 on: July 06, 2015, 10:21:05 pm »


And the problem is?

Well you can see in the first picture that the faces are not sorted correctly. ( some faces far are rendered after faces near )

Here is my opengl configuration ( same for 2 pictures ):
   glEnable(GL_CULL_FACE);
   glEnable(GL_DEPTH_TEST);

   glCullFace(GL_BACK);
   glFrontFace(GL_CCW);

   glEnable(GL_BLEND);
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 

and before rendering:



   glClearColor(63.0f / 255.0f, 203 / 255.0f, 213.0f / 255.0f, 1.0f);
   glClearDepth(1.0f);
   glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 

zerrer

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: SFML 2.3 depth testing issue
« Reply #4 on: July 06, 2015, 10:33:33 pm »
Have you tried to explicitly request a depth-buffer in the context settings when you create the window? As far as I remember, the context selection algorithm has changed, and may lead to contexts without depth-buffer by default.

That was it problem solved after specifying depth bits etc.. in context settings. I was using default context settings.

thanks