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

Author Topic: sf::Font with GLSL-program  (Read 2801 times)

0 Members and 1 Guest are viewing this topic.

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
sf::Font with GLSL-program
« on: August 03, 2016, 11:02:57 pm »
hello

i'm trying to draw some letters on screen by using sf::Font and opengl-glsl shader, for some reasons the character appear as solid block. after searching for a solution, it turns that i have to enable" blend test" and use blend function but when i used it, the block disappeared as being blend totally with background color.

how to solve this?

here the code i used to draw single letter on screen:
(click to show/hide)
« Last Edit: August 04, 2016, 08:22:01 am by Mortal »

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: sf::Font with GLSL-program
« Reply #1 on: August 04, 2016, 08:31:37 am »
i discovered silly mistake with  texture size i have fixed it along with clean up code. but still the problem persist. i couldn't find solution for it.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: sf::Font with GLSL-program
« Reply #2 on: August 05, 2016, 11:39:51 am »
Any reasons you're not just using the SFML shader implementation? Since you use custom OpenGL are you resetting the GL states properly? I never see you call reset-, push-, or popGLStates.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: sf::Font with GLSL-program
« Reply #3 on: August 05, 2016, 02:01:48 pm »
Any reasons you're not just using the SFML shader implementation?
i used glm library for transformation. i can't use it with sf::Shader or other drawable classes.

i'm working to implement 3D rendering engine. i thought that glm library might help for long run rather than using SFML transform or re-implement transform class for this engine. but yeah, at least, i gave it a try, i'm thinking to use SFML transform instead, we will see, how it is going.

Since you use custom OpenGL are you resetting the GL states properly? I never see you call reset-, push-, or popGLStates.

in this particular code, this is no Opengl states with sf::Window. however i already made basic 3D rendering engine by using sf::RenderWindow and yes, i used [pop/push]GLStates() as shown here