Jogl OS X Port is Nigh :)

Sven // Oct 13, 2011 11:48:16 PM

Since the mouse features were to easy to add and my Android vacation should take a bit longer, our OS X port was a good candidate to burn some hours I don’t have.

What should work for OS X by now:

  • NEWT Top-Level Windowing
  • NEWT Child Window w/ NEWT Parent
  • NEWT Child Window w/ AWT Parent
  • JOGL incl. shared context
  • NEWT works w/ AWT enabled JVM out of the box
  • Method to execute a Runnable on the MainThread
  • The new native Jar loading facility (Application, Applet, Webstart)

The window positioning code was a torture, since the AWT components are not top-level on OS X. Hence we have to calculation the proper screen size position in bottom-left coordination space, even when resizing the window.
Maybe there are still some glitches in case of a NEWT child within an AWT floating Container, but most cases work fine.

Shared or offscreen context destruction was another issue.
We have to run this task on the MainThread, otherwise we experienced a ~10s freeze.

Btw our MainThread semantics have been simplified a lot.
On OS X, it just launches the user main class in a new thread while continuing as the NSApp MainThread.
In short, it is no more required when using an AWT enabled JVM, since it already launches as the NSApp MainThread.

After a few more cleanups, I will prepare the next release and test our new native Jar loading mechanism
and Applets in general.

But be aware that these features will be promoted to the next release RC4,
so you would need to wait or use the autobuilds, see Downloading the latest automatic build.

Note on the side: Motivation for the OS X port was not my liking of the platform, which I don’t, but to just complete our platform independent solution. Hence having NEWT working well on OS X is mandatory here.




New NEWT Mouse Features

Sven // Oct 13, 2011 11:20:48 PM

After doing all the Android work, I thought I need a break and finally
added the NEWT mouse features some are desiring:

  • Visibility
    set pointer visible or invisible
  • Confined
    confine pointer to window, or not
  • Warp
    set mouse position within the window

This is NEWT’s minimal API addition in this regard.

The InputEvent’s modifiers expose the above states confined and invisible
which can be easily queried and reacted upon in the event listener, as shown in GearsES2.

This allows you to have a game-like mouse navigation, where you control the direction w/o pressing the mouse button (which you may need for something else), not seeing the mouse pointer and last but not least,
not leaving the game window.

Tested w/ TestGearsES2NEWT, using
GearsES2.

This is currently impl. for X11 and Windows and I am currently adding these to our OSX port.
Since the default operation for these features are NOP and touchscreen don’t require any of those, there is no work to do on Android in this regard.

But be aware that these features will be promoted to the next release RC4,
so you would need to wait or use the autobuilds, see Downloading the latest automatic build.




Resolution independent curves @ GraphiCon 2011

Rami // Sep 7, 2011 9:01:52 AM

Will be presenting by the end of this month the paper behind the Resolution Independent Fonts, Curve, and UI rendering API added recently to jogl.

Title: Resolution Independent NURBS Curves Rendering using Programmable Graphics Pipeline

Abstract:
Non-Uniform Rational B-Splines (NURBS) are widely used,especially in the design and manufacturing industry, for their precision and ability to represent complex shapes. These properties come at the cost of being computationally expensive for rendering. Many methods have tackled NURBS rendering by view based approximations and/or heavy pre-processing. We present a method for resolution independent rendering of curves and shapes, defined by NURBS, by utilizing the high parallelism of the programmable graphics hardware. The computation of the curve is processed directly on the GPU, without the need for complex pre-processing and/or additional storage of the basis functions as textures. Our method enables rendering of a complex NURBS shape in precise form, by defining only the curve’s hull. We also present a method to enhance the performance of the preprocessing stage, mainly triangulation, that fitsour requirements and speeds up the process. With opti-mized preprocessing and using only the mobile profile of theprogrammable graphics pipeline, we achieve a fast and resolution independent method for rendering NURBS based 2d shapes on desktop and mobile devices.

Conference Program: http://gc2011.graphicon.ru/en/program/scientific#en4

Thanks to Sven Gothel and the Jogamp Community for all the fruitful discussions regarding this topic.

Hope to see you all there!

Update: Paper and slides published on Jogamp.org.




Siggraph 2011 – Vancouver

Rami // Aug 31, 2011 12:25:26 PM

Once again siggraph was great… didnt get time to see Vancouver but it looked nice!

had the pleasure to co-present with Sven the latest development on Jogamp.org, mainly JOGL highlighting the newly added support for embedded devices (linux ARM and Android) and the
new Resolution independent Font and User Interface. In all, it was a great “journey” and the feedback we got was great as well.

More:
The journey to Siggraph (the story)
JOGL Embedded Devices (the status)

The presentation well be posted to jogamp.org by next week, we need to add snapshots to it…etc)

The Pictures: (courtesy of Justin)

Setting up

Setting up the presentation and devices

Starting

Left to right: projector problems, goodmorning...

Talking..

Talking..




JogAmp @ Siggraph2011

Rami // Jun 15, 2011 5:35:11 PM

Cross posting announcement with Sven Gothel.
++++++++++++++++++++++++++++++++++++++++++++++++++++++

Jogamp will be at Siggraph this year after the great success of last year’s BOF.

JogAmp: 2D/3D & Multimedia Across Devices

Tuesday, 9 August | 2:30 pm – 4:30 pm | Vancouver Convention Centre
JogAmp provides JOGL (OpenGL), JOCL (OpenCL) across devices on top of Java.
Showcasing Resolution Independent Curve, Font and UI GPU Rendering on desktop and mobile (Android, etc).

Jogamp Community
sgothel (at) jogamp.org

Our goal is to

  • recapitulate last year progress and discuss our directions
  • demonstrate JogAmp Modules (JOGL, JOCL, ..) on multiple devices, PC (Windows, Linux, ..) and Mobile (Android, Linux.
  • showcase our new resolution Independent Curve rendering, utilized shapes, fonts and UI. We also like to discuss it’s usability and how to accomplish a complete UI toolkit
  • showcase user contributions and applications / use-cases

If you would like to showcase some tool/demo that uses jogl please contact us asap.

all our results will be visible as usual via jogamp.org.

Hope to see you there….

Cheers,




GPU based User Interface – WIP

Rami // Apr 8, 2011 5:49:34 PM

One the goals behind the work done in GPU based Curve Rendering, was the ability to investigate the
possibilities regarding GPU based user interface in a 2D/3D scene – ontop of jogl.

As a test, pushed to repo a testcase for rendering a button with a label, using the Resolution Independent Region/Text Renderer.

https://github.com/rsantina/jogl/commit/e6de1dcd253ef4d6ba9f584b4ed3540c85c66d2c

Screenshots: (click to view)

Resolution Independent Button

Resolution Independent Button

Resolution Independent Button - rotated

Resolution Independent Button - rotated

Resolution Independent Button - zoom in

Resolution Independent Button - closeup

Resolution Independent Button - closeup

Resolution Independent Button - clicked

Cheers,




GPU based Resolution Independent Font & Curve Rendering – initial Release

Rami // Apr 1, 2011 5:58:21 PM

Below is about the latest project done by Sven Gothel and myself, which is now published/merged in JogAmp – Jogl Project.

The story: At first we started this project as an idea, started with a chat with Sven on possible ways to by pass the Microsoft patent on GPU Curve Rendering. So after digging into the math of Loop/Blinn patent, devised a way to solve the problem with a different approach than the one used in the patent, the math behind the new approach will be published here soon (need to type them, currently on a notebook with too many scrabble).

After making sure the math works in theory, moved into developing a prototype for the algorithm. While doing this, developed a tessellation utility to provide Delaunay based triangulation of the curved outlines, mainly to avoid using a hack on GLU tessellation to get the triangles and not to have a slow solution. After having a working version of the demo, we went into the “harder” part, getting good quality AA on the ever so tiny fonts. After lots of discussions and fighting the small dimples in the curves, we were able to devise a method that provided the best output of all the others we tried and sharp quality Anti Aliasing.

At that point, we moved from building a prototype (proof of concept) to building an API so that we can add it to JOGL API, which was a great experience by it self, thinking of all the ways the user might wanna use it.  We looked into making it more generic, usable, readable, and stable for a user. Not to forget making sure all the code is BSD license clean.

Yesterday, we reached to a point where we agreed that its “clean” and good for an initial public release, merge with jogl project.  More than enjoying the results and outcomes the best part was the collaboration and the discussion held during the project development.  In short it was a great experience, and lots of fun!

As for the tech part: first some new snapshots,

(click image to view)

Text with two pass AA

Text with two pass AA

Font Set showing all the glyphs in two pass rendering

Font Set showing all the glyphs in two pass rendering

Manually Defined Region - One Pass

Manually Defined Region - One Pass

Small text string - Two Pass Rendering

Small text string - Two Pass Rendering

…as a continuation to the earlier post, we have cleaned up the repository of the curve rendering module, and now merged into jogamp.org – jogl project. (git sub-tree merge ).
The text and region renderer, have two rendering types defining the rendering Technique (SINGLE_PASS or TWO_PASS).

Single Pass: the region with no AA for the straight edges and general shape, where only the curved regions have implicit AA function embedded in the calculations in the relevant fragment shader. This type of rendering is useful for most cases where AA quality on very small fonts/regions is not important. Example usage would be having text scattered around in a 3D scene. The developer is then free to use/plug in his post processing or just use MSAA which gives good results in most cases.

Two Pass: (check the pictures above) render the region to an FBO and then in a second pass attach it to the Bounding Box of the String and do a variant of a Gaussian blur on the text/region. Giving the ever sharp effect on the text that can’t be accomplished in a single pass rendering (at least all the other approaches that I tried). The sharpness of the final shape is dependent on the variable texture size for the first pass (giving the user a way to play with the effect: blurry to sharp). Note: later this will be available in an automatic manner. (hopefully not too later)

To see details on how to use it you can take a look at the unit tests, and demos also pushed to the jogl repository.

https://github.com/sgothel/jogl
https://github.com/rsantina/jogl

Having said all that, download the latest jogl build and try the demos,
would love hearing your feedback and ideas.

Cheers




GPU Resolution Independent Curve Rendering – Brief

Rami // Mar 15, 2011 3:31:31 PM

In the past couple of weeks, I worked on developing a new technique to create an API for resolution independent curve bounded regions and text in general.  The main goal of this project was to move out of the Microsoft Patent Loop/Blinn approach which uses Bezier (Quadratic/Cubic) curve rendering to solve the problem.

To by-pass the Microsoft patent, developed the functions and parameters based on nurbs blending functions. The result of this approach gives great results especially in the region of injection points which where a main concern as well.  The next problem approached was Anti aliasing for the rendered curves especially targeting small fonts, since MSAA on small fonts will give a blurry non-sharp effect.

Below are some snapshots from demos created to use the new text/curve renderer API (where the algorithm is implemented). Later on,  will publish the detailed algorithm with a review of the AA techniques used and tested. But first will work in the upcoming week or so to polish the API before pushing to jogl repository.

Click on image to view original size (all images are in png format to preserve quality)

Rendered string with AA
- A text string rendered with AA.

small sized string with high zoom out.
- Rendering a small text using the same algorithm with AA.

Zoomed in Resolution Independent with AA
- Zoom in to the text showing Resolution independence.

Rendered string with AA
- Rotated text in a 3D scene.

Rendered string with AA
- A general curve bounded region rendered.




Git in Enterprise – Part 2

Rami // Jan 2, 2011 10:00:33 AM

Continuation of Git in Enterprise – part 1

Setting up a git as the source control management (scm)  in a company is about setting up your development process. Git is powerful since it distributed in nature and  gives each user the ability to change anything without worrying of the consequences. You might say no that wont be good for me, well sure it is unless you wanna get paranoid from the idea that a developer might have changed something to the one and only central repository.

So how to set it up, well there is no one way to do that but here ill describe a way that works well.

Git SCM enterprise setup

The above is a sample server scm setup. In the above illustration we have 5 repositories with different branches and the one in blue being the master branch. Each developer has the master branch (preferable) and the branches he/she is working on.

On the left, we have the central repository which is actually the master repository of the project. This repository holds the latest stable, merged, and tested code of all the development tracks (branches). You can assign a maintainer or couple of maintainers to handle merging into the master repository. Currently in git you cant specify access rights on branches (guess its a coming feature) so if you wanna assign a maintainer to a branch, verbal understanding should be enough.

On the right you see the developers (the hard-workers),  each has the master branch and the branch(s) if any he/she is working on. These repositories have write access to the developer only and read to all others. Now that we have the setup, the process that brings this all togther might look like.

Setup steps:

  1. Each developer clones the master repository and pushes to his repository
  2. Each developer fetches the branch he is to work on (if not master) and pushes it to his repository.

Process:

  • Developers: commit changes to the code and push to his repository
  • “Sr.” Developer: Review developer(s) changes, and merges the changes with his repo and pushes to his repository. Which the Developers pulls after the merge.
  • Master repository Branch Maintainer: (could be one of the above)  Review and pull changes after all looks good, and pushes to the central repository.

In this process,  changes that don’t look good can be simply ignored, reverted, or followed with another commit. And when adding a continuous build server to the master repository branches you can insure that everything is always on the right track.

Credits: most of the ideas in this post are from discussions with Sven Gothel, and JogAmp.org setup.