Results 1 to 5 of 5

Thread: glEnable(GL_BLEND); is really necessary?

  1. #1

    glEnable(GL_BLEND); is really necessary?

    Hello im using openGL to 2d drawning on my framework and im typing to much ->

    glEnable(GL_BLEND);

    // stuff

    glDisable(GL_BLEND);


    its really necessary :?:

    or i can just enable it at the openGL setup?
    From brazil (:

    Pascal pownz!

  2. #2

    glEnable(GL_BLEND); is really necessary?

    I have it always enabled on my projects. Why disable it? It is needed for alpha channeled textures that are farely common.

  3. #3

    glEnable(GL_BLEND); is really necessary?

    Quote Originally Posted by User137
    I have it always enabled on my projects. Why disable it? It is needed for alpha channeled textures that are farely common.
    disable it so that you save the gpu from using unneccesary alpha calc. when unneeded.. perhaps to speed things up?
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  4. #4

    glEnable(GL_BLEND); is really necessary?

    Quote Originally Posted by Delfi
    Quote Originally Posted by User137
    I have it always enabled on my projects. Why disable it? It is needed for alpha channeled textures that are farely common.
    disable it so that you save the gpu from using unneccesary alpha calc. when unneeded.. perhaps to speed things up?
    i will let it enabled at the begining, 80% of blits uses alpha...
    From brazil (:

    Pascal pownz!

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    glEnable(GL_BLEND); is really necessary?

    A trick I use to get rid of some artifacts caused by displaying scaled or rotated transparent textures in my 2D games is as follows.

    [pascal] glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glDisable(GL_ALPHA_TEST);[/pascal]

    This is just so much better than playing with Alpha Test. Especially when you are using a pre-rendering method of creating sprites.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •