Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (593)
Games in Android Showcase (168)
games submitted by our members
Games in WIP (646)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  java, gpu and the web  (Read 2919 times)
0 Members and 1 Guest are viewing this topic.
Offline pobrien11

Junior Newbie

« Posted 2010-03-02 01:19:04 »


    My question basically deals with the best approach to doing a fluid sim on the web using the GPU so that web users can interact with it. I currently have a fluid sim running on the gpu using openGL and GLSL. Its a multi pass approach using framebuffers to capture data from the GPU and feed it into the next pass as input. I have been doing some research, and have read about jogl, javaCL, processing, and webGL. I'm looking for some guidance on what would be the best approach (mostly in terms of performance). I need to be able to use the gpu for acceleration purposes, and it would be great to be able to leverage some of my existing code. My concern with webGL is it is so new and is only in preview builds of browsers. I tried using processing, but there aren't many resources out there for getting help. I appreciate any responses. Thanks,

Offline Momoko_Fan

Junior Devvie

Medals: 2

« Reply #1 - Posted 2010-03-02 15:07:30 »

Whats the problem with just using Java + OpenGL (with either LWJGL or JOGL as binding)? Most people have java, and all the user has to do is to accept a confirmation dialog. WebGL is still somewhat of a prototype rather than a functional product, so I would not recommend using it.
From my experience Java is the best platform on the web for hardware accelerated 3D.
Offline gouessej
« Reply #2 - Posted 2010-03-02 15:17:17 »

bienator may answer you... Use JOGL and JOCL, it works just fine, you should have a look at Michael's demos.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline pobrien11

Junior Newbie

« Reply #3 - Posted 2010-03-02 16:18:21 »

ok cool, i'll do that, thanks!
Offline bienator

Senior Devvie


« Reply #4 - Posted 2010-03-02 17:50:41 »

not so fast Wink web + OpenCL is currently a bit risky. Drivers are not yet very stable especially if you want buffer sharing with GL.

At the end it really depends what you want to do if you say "fluid sim".
2D? use plain java and a handfull threads.
3D+focusing on pseudo-realistic graphical effects? OpenGL + GLSL (maybe OpenCL if you want to be cool, look at Apples demos)
3D+physical simulation of fluids, forget anything webgl except you want to render on the server Wink
realtime or not...?

Offline JL235

JGO Coder

Medals: 10

« Reply #5 - Posted 2010-03-02 20:39:09 »

There are also no plans for WebGL to be implemented in IE, and it's only supported in the nightly builds of FireFox, Chrome and Safari. If you use WebGL then practically no one will be able to run your app.

Offline pobrien11

Junior Newbie

« Reply #6 - Posted 2010-03-03 05:03:24 »

Hi bienator,

    I will be doing 2d. I'm using the lattice boltzmann method which scales well on the gpu. What do you guys think of wljgl? My concern with threads is it won't allow the parallel processing that the gpu does.
Offline bienator

Senior Devvie


« Reply #7 - Posted 2010-03-03 10:24:22 »

you can use LWJGL for the job too. Both JOGL and LWJGL expose GLSL. And shaders are the parallelization vehicle what you are asking for. Although there were initially designed for graphics exclusively, they are sometimes abused for general purpose algorithms (esp. before CUDA, OpenCL etc. was available).

Offline Roquen
« Reply #8 - Posted 2010-03-03 10:40:53 »

Also, more people will be able to run a shader version than OpenCL, et al.  As an example, on one of my machines I've a DX10 Nvidia card, update-to-date drivers and Nvidia's no worky.
Offline Momoko_Fan

Junior Devvie

Medals: 2

« Reply #9 - Posted 2010-03-03 14:25:35 »

Right now OpenCL probably won't work on many machines, since it requires specialized drivers and/or modifications.
See this page:
I do not recommend relying heavily on OpenCL unless it becomes standard across all machines and gpus.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline pobrien11

Junior Newbie

« Reply #10 - Posted 2010-03-07 17:15:29 »

thanks for all the info, I'm trying out lwjgl
Offline gouessej
« Reply #11 - Posted 2010-03-08 09:26:39 »

thanks for all the info, I'm trying out lwjgl
Why not giving a try with JOGL?  Huh LWJGL has no interoperabily with OpenCL as far as I know.

Offline princec

« JGO Spiffy Duke »

Medals: 545
Projects: 3
Exp: 16 years

Eh? Who? What? ... Me?

« Reply #12 - Posted 2010-03-08 09:51:35 »

Er, how can it not interoperate?

Cas Smiley

Offline gouessej
« Reply #13 - Posted 2010-03-08 13:37:57 »

Er, how can it not interoperate?

Cas Smiley
I was thinking about this :
     * The cl_mem that has the contents of the VBO

    private cl_mem vboMem;

// Create the vertex buffer object
        int buffer[] = new int[1];
        gl.glGenBuffers(1, IntBuffer.wrap(buffer));
        vertexBufferObject = buffer[0];

            // Create OpenCL buffer from GL VBO
            vboMem = clCreateFromGLBuffer(context, CL_MEM_WRITE_ONLY,
                vertexBufferObject, null);

but finally, you're right, it uses plain OpenGL, it should work with LWJGL too.

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

deepthought (36 views)
2015-06-30 15:39:44

deepthought (39 views)
2015-06-30 15:39:09

deepthought (52 views)
2015-06-30 15:36:52

Za\'Anzabar (21 views)
2015-06-29 05:44:54

TritonDreyja (40 views)
2015-06-24 17:10:40

CopyableCougar4 (36 views)
2015-06-23 00:34:45

BurntPizza (41 views)
2015-06-21 20:36:46

cookiecompiler (84 views)
2015-06-11 15:42:53

cookiecompiler (47 views)
2015-06-11 15:41:14

NegativeZero (76 views)
2015-06-11 09:49:18
How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!