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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sreiter

Pages: [1]
1
Thanks so much!!!

2
It would be great if you would consider adding something like those static methods!

Thanks for listening to my issues!
Kind regards,
Sebastian

3
Thanks again for your reply,

Quote
With OpenGL you don't unbind a shader, you bind another one (including a null one).

Wouldn't it then be an option to "unbind" a shader when Shader::bind is called on an empty shader? Currently, as far as I understand the code, nothing is done if bind is called on an uninitialized shader.

My concrete suggestion (if you don't mind) is to alter Shader::bind() in a way so that
ensureGlContext();
 
and
glUseProgramObjectARB(...)
 
are either executed before the if-condition is evaluated or in an else branch:

void Shader::bind() const
{
    ensureGlContext();
    // Enable the program
    glCheck(glUseProgramObjectARB(m_shaderProgram));
 
    if (m_shaderProgram)
    {
        // Bind the textures
        bindTextures();
        // Bind the current texture
        if (m_currentTexture != -1)
            glCheck(glUniform1iARB(m_currentTexture, 0));
    }
}
 

This behavior would then be coherent with glUseProgram - at least in my understanding. And it would be of great use for people who use sf::Shader in the way I do it (probably a very small minority though...)

Kind regards,
Sebastian

4
Thank you very much for your fast reply!
First - I want to say thank you for providing such a great library and great support!

glUseProgram seems like a good option, however, I think it's not contained in the default OpenGL distributions for MS Windows - unless one uses extensions. SFML features everything I need beyond basic OpenGL stuff, so it would have been great if I could have circumvented those extensions... which probably isn't a good idea anyways.
I'm sure you had good reasons to remove Shader::unbind - however, it renders shader support of SFML to be somehow a little incomplete (in my opinion and to my knowledge) - which is a pitty, since sf::Shader is a great class.

Again - thank you very much for your reply!

Kind regards,
Sebastian

5
Hi SFML-users,

this is my first post to this forum - hello to everyone.
I'm using SFML since approx. 1 year. Due to problems with ATI cards etc. I switched to SFML2.0 a while back and really like it. I'm doing my own rendering through OpenGL. Still I'm using some sfml classes, e.g. for text rendering and shading. Especially sf::Shader proved to be very useful.

Now here's the problem: sf::Shader used to feature a method Shader::unbind. As I have read, this method has been removed for some reasons in recent versions of sfml. However, when only applying shaders to some parts of a rendered scene, there has to be some means of unbinding the active shader.

Simply using an empty shader and calling bind() on it doesn't work, since bind only executes code if a program has been compiled (at least that's how I read the code).

Is there some other way to unbind the active shader? Since SFML already does all the shading related stuff it would be great if I wouldn't have to directly include and link against glew etc.

Thanks for any advise,
Sebastian

Pages: [1]
anything