SFML community forums

Help => Graphics => Topic started by: KraHen on August 06, 2013, 05:43:54 pm

Title: SFML Text rendering in a deferred context
Post by: KraHen on August 06, 2013, 05:43:54 pm
I have managed to implement a very simple deferred renderer by going through the interwebs, but it seems to kill my text rendering, which worked well in a forward rendering context. I don`t know what could be causing it, if anyone could give me any insight on this, I would really appreciate it. :) I`m pretty sure it has to do with one or more GL state, but I can`t seem to figure out which one.

It goes something like this . . .(http://imageshack.us/a/img29/3485/afz.png)

And here`s how I try to draw my string :

glBindBuffer(GL_ARRAY_BUFFER, 0);
                glUseProgram(0);
                (*window).pushGLStates();
                (*window).resetGLStates();
                (*FPSText).setString("FPS : " + int2Str((int)FPS));
                (*window).draw(*FPSText);
                (*window).popGLStates();

Any ideas?
Title: Re: SFML Text rendering in a deferred context
Post by: Grimshaw on August 06, 2013, 05:50:49 pm
you need a alpha blending state enabled.. should do the trick
Title: Re: SFML Text rendering in a deferred context
Post by: KraHen on August 06, 2013, 06:18:38 pm
Thanks for the quick reply! Unfortunately that doesn`t solve my problem, or I`m doing something wrong. :( It`s funny though how I can render stuff like shapes without any problem.
Title: Re: SFML Text rendering in a deferred context
Post by: Laurent on August 06, 2013, 06:18:45 pm
Alpha blending, as well as everything that SFML needs, is set by SFML.

It's hard to say which state you forgot to disable, without seeing them ;)

Maybe a texture problem? Do you have an active texture unit > 0?
Title: Re: SFML Text rendering in a deferred context
Post by: KraHen on August 06, 2013, 06:31:53 pm
A few, for my FBOs, although I thought that pushing/popping states or reseting them would mean that they aren`t interfering with this, and I`d like to keep them active. :) Although every other rendering (sprites, shapes, etc.) works, so I guess I`ll just integrate libRocket now. Thanks for the help. :)
Title: Re: SFML Text rendering in a deferred context
Post by: Laurent on August 06, 2013, 07:01:29 pm
Quote
I thought that pushing/popping states or reseting them would mean that they aren`t interfering with this
It's the other way round: SFML states can't interfere with your own states. I can't handle both ways.
Title: Re: SFML Text rendering in a deferred context
Post by: KraHen on August 06, 2013, 08:25:01 pm
I guess I`m the classic RTFM case. :) Thanks for the clarification!