-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup and OpenGL 3 support for TextRenderer #47
base: master
Are you sure you want to change the base?
Conversation
I will go through your pull request and focus on feature duplication and namespace.
Sorry, I don't mean to procrastinate things here .. will keep an eye on it The more your work is 'isolated' in it's own namespace denoting it's own sub-space, |
Thanks!
I'll try to use them. At the time I was originally writing this it was easier to just load them myself since I only needed basic functionality, but I kept ShaderLoader package-protected with the goal of being able to replace it eventually.
The testing utilites I added are used by GlyphRendererTest, QuadPipelineTest, and TextRendererTest in later commits. I just staged them separately to make it more digestible. I wasn't intending for the testing utilities to be public, they just resulted from realizing I was going to have a lot of duplicate code otherwise. I put everything in the awt package because GlyphRenderer and QuadPipeline are package-protected, and I wouldn't be able to test them separately otherwise.
I think everything is broken out pretty well now, so that the changes that would need to be made would be relatively isolated, compared to what was there before at least. However, having talked to Jason it sounds like we probably won't be able to justify spending much money on that. In general I guess we were just intending to keep TextRenderer usable as it was, except with OpenGL 3/4 support. Maybe if we could get the conversion a little more concrete though... Is there a way with the typecast project to rasterize the font into a BufferedImage? |
Ok, finally cleaned up and pushed the commit where I renamed RasterTextRenderer to TextRenderer. I'll work on cleaning up the shader loading, but having done that I'm comfortable in saying this could probably be pulled as is for now considering not much has changed publicly. The only thing I added to its interface was setTransform, since we don't have OpenGL's internal transformation stack in the core profile, and a constructor taking a UnicodeBlock, which is sort of unnecessary but it does allow for some optimization/simplification. |
On 04/23/2012 05:13 PM, Andy Brown wrote:
'com.jogamp.' is public, i.e. intended for public use, where I personally use private/protected/package-protected as well as final In the 'dawn' of a future AWT-less implementation we may prepare the
The latter is AWT as well IMHO. Bottom line, as you said, you replace the previous font renderer Kudos! ~Sven |
Ok, this doesn't exactly inspire confidence but I ran the the test for TextRenderer that was in there before and realized I introduced a NullPointerException when the user calls setUseVertexArrays before beginRendering. Working on fixing that now. |
- Use getShaderInfoLog and getProgramInfoLog instead of getLog - isCompiled uses isShaderStatusValid - isProgramLinked and isProgramValidated use isProgramStatusValid
Ok, fixed the bug with setUseVertexArrays, and one with dispose, too. Cleaned up ShaderLoader a bit, where now we pass it a GL, validate the program, and at least most of the heavy functionality kicks to ShaderUtil. |
Does this text renderer still support OpenGL 1.1? Sorry for my silly question. |
Turns out not so silly... I was sure I saw somewhere that a few of the glPixelStore parameters were only in OpenGL 1.2, so I had a check in there for that, but I just went back to make sure and couldn't find that again. It looks like it was spelled out a little more explicitly in the 1.2 spec though so maybe that's why. Anyway, the short answer is yes (now) it should support 1.1 again. Thanks for asking! |
It would be nice if this pull request was merged as some users are complaining about the inability of using the legacy text renderer with GL3. |
Spent awhile cleaning it up over the weekend. Would like to do a bit more but ran out of time. Monday nights are usually pretty open for me though so I might be able to finish it up tonight. |
- JOGL's GL3 profile will actually return an OpenGL 3.1+ context, so we should actually be using GLSL 1.4, although it's a little surprising it's complaining since it worked before - Can't redclare gl_Position anymore
I'd like to see this pull request in JOGL 2.3.2 or 2.4. I'll talk about it to @sgothel |
Awesome! I have one outstanding change still, which was to use JUnit rules On Wed, Aug 26, 2015 at 10:50 AM, Julien Gouesse notifications@github.com
|
Is this change absolutely necessary? Yes, rather put it into a separate pull request. Please bump Sven on IRC, it would be nice that you talk about your changes to him. In my humble opinion, your code shouldn't be wasted, this is something that I would like to see in JOGL, really. |
On 08/27/2015 03:50 PM, Andy Brown wrote:
Unit tests within our framework would be more than welcome - of course! Further, since Julien seems to jump in here, voting for a merge, If Julien gives me the green light (after manually validating no regression) @julien: Since this is the first commit of Andy,
I know, previous code base had almost no unit tests, Even though this list might seem a bit long, ~Sven |
Hi guys, I think it's @gouessej not @julien (that's me) ;) |
I'm using this version of TextRenderer for GL3 on Mac OSX but I had to fix some bugs:
Then it works perfectly. |
@paolofuse Awesome! Can you make a fork for me to pull in your changes? Or send me some patches from format-patch? Also, can you explain why you don't want to or can't use a VAO with 3? You're not using a core profile I take it? It's been awhile and I don't do a lot of OpenGL anymore but I think the reason it's forcing it is I thought VAOs are required in core. If we do still allow it should we put a check in for core? Can't remember is JOGL GL3 supposed to always be core? I guess GL3bc or something like that extends GL3? |
@paolofuse Is the init method something the user calls on TextRenderer? Or is it on one of the helper classes? |
@adbrown85 GL3bc extends GL2 and GL3, it means "GL3 backward compatible. Therefore, you can get a GL3 instance that isn't core, use GLBase.isGL3core() to check that. Keep in mind that there is a default VAO created under the hood in JOGL. |
Hi all, Feel free to comments my solution. |
@adbrown85 the init method must be call by the user before call beginRenderer. |
@adbrown85 @gouessej what's the status on this? I want to use this because I can't get TextRegionUtil to work properly. |
@jedwards1211 Sorry for the delay. You should ask for help on the forum concerning TextRegionUtil. We'll try to integrate this stuff in JOGL 2.4.0 if we have enough time to fix and test it anew. |
@gouessej okay, thanks. I ended up just using code I copied out of @paolofuse's fork for text. It's serving my needs well enough for now, though I may want geometric text in the future. |
@jedwards1211 Can you fix the conflicts so that we can integrate it faster? |
@gouessej sure! I should have time to do so this weekend. |
Ok let me know when you're ready. |
Sorry, yeah, I've gotten sidetracked... |
Hi! Thank you @adbrown85 for this work! I tested it in Jzy3D and it provides great improvements
In situation where I introduced memory leak by mistake in Jzy3D, I have been able to double the time before a JVM crash occurs when switching to your TextRenderer. My real bug was my own code, but on my way I tried your work and it is really great. I copy pasted your code here and even deployed on my Maven repo for those willing to use at well. That would be nice it was merged on @sgothel branch for a later deployment, otherwise I'll to add it to my JOGL clone if anyday I rebuild JOGL fully. |
Currently all the updates are in RasterTextRenderer, but will just need to do a rename to TextRenderer next. Figured it might be easier to review that way, but also really wanted to get this started today so you could look at it. I'll try to add some more comments about it tomorrow.