SFML community forums

Help => Graphics => Topic started by: Mortal on August 03, 2016, 11:02:57 pm

Title: sf::Font with GLSL-program
Post by: Mortal 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)
Title: Re: sf::Font with GLSL-program
Post by: Mortal 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.
Title: Re: sf::Font with GLSL-program
Post by: eXpl0it3r 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.
Title: Re: sf::Font with GLSL-program
Post by: Mortal 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 (https://github.com/MORTAL2000/Basic3D)