Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: WebGL Module for GoogleWebToolkit

  1. #1
    Member Coolcat's Avatar
    Join Date
    Oct 2009
    Location
    NRW, Germany
    Posts
    75

    WebGL Module for GoogleWebToolkit

    When using GoogleWebToolkit (GWT) you can code you WebGL application in Java! GWT does compile your code to JavaScript, so end users will not notice a difference. You gain things like type-safety, class hierarchy, a nice widget system and code optimization though the compiler.

    My module has the boring name 'WebGL Toolkit' (WGT), but provides WebGL support for GWT. This project is part of my Ultimate Conquest project (see below). WGT is licenced under GNU General Public License (Version 3).

    Features
    • WebGL wrapper, including some related overlay types[/*:m:18h67gtc]
    • Canvas2D wrapper, including some related overlay types[/*:m:18h67gtc]
    • Mathlibrary, optimized for computer graphics purpose. Provided classes: BoundingSphere, Matrix22d, Matrix33d, Matrix44d, MatrixStack, Plane, Ray, Vector2d, Vector2i, Vector3d, Vector3i, Vector4d, Vector4i[/*:m:18h67gtc]
    • extendible ResourceManager with JSON-based file format. Provided resources: Library, Mesh, Texture2D, Shader, Simple3D, Sky, CompositeResource[/*:m:18h67gtc]
    • InputManager for mouse and keyboard input[/*:m:18h67gtc]
    • Simple (but extendible) log system.[/*:m:18h67gtc]
    • Simple (but extendible) SceneManager provides visibility detection and software picking.[/*:m:18h67gtc]
    • Point and Line renderer. However, points are not very useful yet since no browser supports points larger than 1 pixel.[/*:m:18h67gtc]


    Requirements
    • GoogleWebToolkit 2.0.0 or later[/*:m:18h67gtc]
    • When ResourceManager class is used a HTTP-Server is required. It will not work on local filesystem since internally HTTP-requests are used to load resources.[/*:m:18h67gtc]
    • Obviously a WebGL capable browser is required.[/*:m:18h67gtc]


    Example
    Together with WGT comes a small example which shows how to use all major classes. It's a simple animated planet scene with Homeworld-style (*) camera system. You can disable the Glow-effect in the options menu.

    >> Try Live demo! <<

    (*) or Ultimate Conquest style... :P



    • To try it make the directory content of wgt-0.1/war available via HTTP. Access using local filesystem will not work. A local HTTP-Server (e.g. Apache) is very helpful during development.[/*:m:18h67gtc]
    • Controls:
      [list:18h67gtc]
    • LMB on Planet : center Camera on Planet[/*:m:18h67gtc]
    • RMB + MouseMove : rotate Camera. If you have problems with the popup menu, try STRG + MouseMove[/*:m:18h67gtc]
    • MouseWheel : zoom Camera[/*:m:18h67gtc]
    • W,S,A,D,Q,E : move Camera[/*:m:18h67gtc]
    • LMB + MouseMove on title: move toolwindow[/*:m:18h67gtc]
    [/*:m:18h67gtc][*] JSON library is located at wgt-0.1/war/r/library.json[/*:m:18h67gtc][*] Sourcecode is located at wgt-0.1/src/example/gwt[/*:m:18h67gtc][*] A look at the JavaDoc documentation at wgt-0.1/javadoc/index.html will also prove helpful.[/*:m:18h67gtc][/list:u:18h67gtc]


    Download
    >> wgt-0.1-091226.zip <<




    Ultimate Conquest
    Ultimate Conquest (UC) is a clone of the popular KDE game “Konquest” in development. WGT is a subproject which does collect all components that are general enough to be useful in other projects. UC is closed source, but WGT is available under GPLv3.


  2. #2
    Member Coolcat's Avatar
    Join Date
    Oct 2009
    Location
    NRW, Germany
    Posts
    75

    Re: WebGL Module for GoogleWebToolkit

    Sorry, "STRG" key is "CTRL" in english.
    For some reason it is not possible to edit posts here...

  3. #3

    Re: WebGL Module for GoogleWebToolkit

    I'm very interested in using this library. I am able to run the 091214 flawlessly on both WebKit and Minefield. However, when I try to run the 091226 version, I receive the following errors (in both browsers):

    15:05:22.897 Error while compiling shader 'default.lib/glow-blur.fs':
    ERROR: 0:7: 'array of float' : array type not supported here in glsl < 120
    ERROR: 0:7: 'array of float' : constructor not supported for type
    ERROR: 0:9: 'array of float' : no matching overloaded function found
    ERROR: 0:7: 'const float' : cannot declare arrays of this type
    ERROR: 0:7: 'gaussFilter' : redefinition
    ERROR: 0:15: 'expression' : left of '[' is not of type array, matrix, or vector
    15:05:22.898 Error while compiling shaders 'glow.vs' and 'glow-blur.fs' in library 'default.lib'

    Is this something you're aware of? Also, do you have a public GIT (or other) for this project? I'd very much like to use WGT in my current project and help out with future releases. Thanks again for your contributions.

    Thanks,
    Mike

  4. #4

    Re: WebGL Module for GoogleWebToolkit

    Disregard this, this is a problem on my side. Looks like my graphics card doesn't support float arrays. Nothing wrong with the new version.

  5. #5
    Member Coolcat's Avatar
    Join Date
    Oct 2009
    Location
    NRW, Germany
    Posts
    75

    Re: WebGL Module for GoogleWebToolkit

    Looks like my graphics card doesn't support float arrays. Nothing wrong with the new version.
    Correctly, float arrays are part of the GLSL ES spec. If have switched in that version to an new/better/faster blur shader used for the glow effect.

    Also, do you have a public GIT (or other) for this project? I'd very much like to use WGT in my current project and help out with future releases. Thanks again for your contributions.
    I have switched from using simple TAR-balls to GIT a week ago or so. However, currently the repository is just locally on my hard disk and does contain only UC/WGT as single project.

    I'm not really experienced in using GIT. Actually this is my first project using GIT. Is it possible to maintain multiple projects that share parts, where only the some parts (WGT, WGT-Example) are public? In that case we could both have our projects locally and develop WGT together.

    (P.S.: What kind of project do you have in mind? )

  6. #6
    Junior Member
    Join Date
    Jan 2010
    Posts
    2

    Re: WebGL Module for GoogleWebToolkit

    Wow! I'm very excited to see people working on this topic. I'm a heavy Java user and would love to be able to do more OpenGL on the web. So far I've been using JOGL2 for this, but the concept of plugin-less deployment with WebGL is a big draw for me, and being able to continue developing in Java kinda essential

    My only concern is that there seem to be 3 distinct projects already now trying to do the same thing, ie bring WebGL to GWT, although this project looks the most mature thus far. Hopefully everyone can pull together to really make this work.

    Is there any chance of using the same API that JOGL2 is using for their ES2 binding? That would make migrating code from the Java+OpenGL world to Java+WebGL world so much easier. Or even allow developers to target web and desktop from the almost the same codebase.

    As far as I know JOGL uses gluegen to autogenerate the binding based on the OpenGL headers. Maybe a similar approach could be used here? Ideally with the core binding layer as a seperate package from all the nice utilities and effects engines etc. So we'd have a single binding, and then a number of additions libs offering extra functions that can co-exist depending on what a project needs.

    I was tempted to have a go myself until I came across this group

  7. #7

    Re: WebGL Module for GoogleWebToolkit

    I finally successfully deployed the example project and ran it (after removing the Glow shader effect from code). So, far things are looking alright. Obviously, at 1920x1200, I was suffering from poor framerates (< 15 FPS). This was on a nVidia 8600M GT, so nothing too old. At 1280x1024, I was working at a steady 60+ FPS.

    It doesn't seem like the frame rate should be suffering that much, since there isn't much on the screen, but WebGL is not bare to the metal like native OpenGL apps. I'll do some profiling to see what the bottlenecks are.

    As for GIT, I haven't used it either, myself. I've been using Assembla (SVN + tickets + time management) for any of my personal projects, but GIT has been gaining support in the Open Source community, so I figured it might be a better place for it. From what I understand, most implementations of a public/private repository have multiple branches, one public branch and a bunch of private branches that merge into the public as code becomes stable. I believe this is possible with both GIT and SVN.

    As for my personal project(s), I'm primarily working on a project for the smallish company I work for. I'm doing a little research into interfaces to display information to customers in unique and interesting ways. Unfortunately, I can't say too much more than that until I get further along in the project. But, anything I add to WGT would obviously belong to the WGT library.

    But, in my free time, I'm an indie game developer at heart. I'm currently working on an action/adventure game using Torque, but what I really would like to use WGT/WebGL for is my smaller experimental game projects. I've, for the most part, worked with 2D games, but 3D is also something I'd like the pursue.

    I really think WebGL is going to open up many doors for game developers. Personally, I'm not the biggest fan of Flash, but for the longest time, it's been a great medium for getting games out there in front of people easily. Once browsers get WebGL integrated into their public releases, we'll see many more developers choosing WebGL over Flash.

  8. #8

    Re: WebGL Module for GoogleWebToolkit

    @Cork: I was in the same boat. There were two other libraries that had put up Google Code pages, but seemed like they had given up or hadn't updated in a while. Coolcat's seemed like the only one with life in it. After looking at the code, it's coded very well and isn't very difficult to understand. Coolcat's done a great job so far, in my opinion.

    As far as JOGL, that's out of my realm of experience.

    Mike

  9. #9
    Member Coolcat's Avatar
    Join Date
    Oct 2009
    Location
    NRW, Germany
    Posts
    75

    Re: WebGL Module for GoogleWebToolkit

    After looking at the code, it's coded very well and isn't very difficult to understand. Coolcat's done a great job so far, in my opinion.
    Thanks
    I think I will create an public GIT repo as soon as I find time to do that.

    Coolcat's seemed like the only one with life in it.
    I can work on UC/WGT only in my sparse free time, so I can't guarantee it will stay alive, especially because I have also some other projects.

    As far as JOGL, that's out of my realm of experience.
    I have also never worked with JOGL. Most of the time I'm developing with C++/OpenGL on Linux.

    I've, for the most part, worked with 2D games, but 3D is also something I'd like the pursue.
    Doing 2D with WebGL might be also a good idea, since the 2D canvas has no hardware acceleration yet.

  10. #10
    Member Coolcat's Avatar
    Join Date
    Oct 2009
    Location
    NRW, Germany
    Posts
    75

    Re: WebGL Module for GoogleWebToolkit

    Ok, I have created an project at sourceforge:
    https://sourceforge.net/projects/wgt/files/

    GIT repository:
    git://wgt.git.sourceforge.net/gitroot/wgt/wgt

Page 1 of 2 12 LastLast

Similar Threads

  1. OpenCL module for OpenCV
    By bitwangyaoyao in forum OpenCL
    Replies: 4
    Last Post: 08-22-2012, 02:15 PM
  2. DV module?
    By notnot in forum OpenML Coding & Technical Issues
    Replies: 1
    Last Post: 03-14-2004, 02:21 AM

Posting Permissions

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