Giter Club home page Giter Club logo

Comments (4)

ghutchis avatar ghutchis commented on July 30, 2024

Logged In: YES
user_id=1317290
Originator: NO

I don't fully understand why this bug is occurring but I have found something that fixes the transparency problem.

If you add the following code to Painter's begin(GLWidget *widget) method transparency works while the text renderer is enabled:

if(d->textRenderer->isActive())
{
d->textRenderer->end();
}

Its probably a bit of a hacky fix but as I said, I don't understand the underlying code, I just stumbled across this while working on a new tool (more to come about that later). I assume someone else understands the code better and that this hacky fix might clue you in on what might be the underlying cause of the bug.

Hope this helps,
James & Ross

Original comment by: jbunt

from avogadro.

ghutchis avatar ghutchis commented on July 30, 2024

Logged In: YES
user_id=1500648
Originator: NO

  1. I have resolved this issue but it's not the greatest. At this time when TextRenderer is activated it sets up it's OpenGL environment to what i needs by pushing some stuff to the GL stack etc. However, to optimize we don't call ::end until we are ready to render another non-text item. However this causes problems because with our GLPainter::begin and GLPainter::end, we may draw text, change the environment, then draw a sphere, but here is the order of operations,

TextRenderer::begin (push environment)
TextRenderer::drawText
glEnable(GL_BLEND) (new environment, say GL_BLEND)
TextRenderer::end (pop OLD environment, no GL_BLEND)
drawSphere()

So to fix the error i simply call TextRenderer::end after calling ::drawText. This is bad because that means for each call to draw text we are re-setting up our environment. Our painting system is a little off-whack and I think we need to remedy it a bit more. One of the problems is that you can change the GL environment in the rendering code, but actually, things like enabling transparency, etc should be handled by the GLPainter. Also, we can easily make it so you can instanciate your own GLPainter and just use a shared static variable. shrug I have fixed the problem temp but please leave this PR open.

  1. There is no transparency problem, it's just that for EACH unitcell the labels get rendered on the initial molecules coordinates. Multiple calls end up looking like a box around the text but that's not the case. The problem is that when we go to render the unit cell we do a glTranslate which is all well and good except that text rendering is based off what the camera() object thinks is the modelview. So to remedy this we either need the camera to take into consideration the gltranslations (which is bad imo) or we need to make the camera have it's own model view stack and allow us to push and pop that bad boy. This would resolve the problem and i'll look into it more soon.

Original comment by: @milkypostman

from avogadro.

ghutchis avatar ghutchis commented on July 30, 2024

Logged In: YES
user_id=1500648
Originator: NO

This has been resolved.

Original comment by: @milkypostman

from avogadro.

ghutchis avatar ghutchis commented on July 30, 2024

Logged In: YES
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

Original comment by: sf-robot

from avogadro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.