pobrien11
JGO n00b  Posts: 4
|
 |
«
on:
2010-03-01 20:19:04 » |
|
Hi,
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,
Patrick
|
|
|
|
|
Momoko_Fan
Full Member   Posts: 100 Medals: 3
|
 |
«
Reply #1 on:
2010-03-02 10: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.
|
|
|
|
|
gouessej
JGO Kernel      Posts: 3433 Medals: 26
TUER
|
 |
«
Reply #2 on:
2010-03-02 10:17:17 » |
|
bienator may answer you... Use JOGL and JOCL, it works just fine, you should have a look at Michael's demos. http://github.com/mbien/jocl
|
Julien Gouesse
|
|
|
Games published by our own members! Go get 'em!
|
|
pobrien11
JGO n00b  Posts: 4
|
 |
«
Reply #3 on:
2010-03-02 11:18:21 » |
|
ok cool, i'll do that, thanks!
|
|
|
|
|
bienator
JGO Ninja    Posts: 632 Medals: 1
OutOfCoffeeException
|
 |
«
Reply #4 on:
2010-03-02 12:50:41 » |
|
not so fast  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  realtime or not...?
|
|
|
|
JL235
JGO Ninja    Posts: 660 Medals: 21
|
 |
«
Reply #5 on:
2010-03-02 15: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.
|
|
|
|
pobrien11
JGO n00b  Posts: 4
|
 |
«
Reply #6 on:
2010-03-03 00: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.
|
|
|
|
|
bienator
JGO Ninja    Posts: 632 Medals: 1
OutOfCoffeeException
|
 |
«
Reply #7 on:
2010-03-03 05: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).
|
|
|
|
Roquen
JGO Ninja    Posts: 578 Medals: 17
|
 |
«
Reply #8 on:
2010-03-03 05: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 OpenCL...it no worky.
|
|
|
|
|
|
|
Games published by our own members! Go get 'em!
|
|
pobrien11
JGO n00b  Posts: 4
|
 |
«
Reply #10 on:
2010-03-07 12:15:29 » |
|
thanks for all the info, I'm trying out lwjgl
|
|
|
|
|
gouessej
JGO Kernel      Posts: 3433 Medals: 26
TUER
|
 |
«
Reply #11 on:
2010-03-08 04:26:39 » |
|
thanks for all the info, I'm trying out lwjgl
Why not giving a try with JOGL?  LWJGL has no interoperabily with OpenCL as far as I know.
|
Julien Gouesse
|
|
|
princec
« League of Dukes » JGO Kernel      Posts: 7802 Medals: 77
Eh? Who? What? ... Me?
|
 |
«
Reply #12 on:
2010-03-08 04:51:35 » |
|
Er, how can it not interoperate? Cas 
|
|
|
|
gouessej
JGO Kernel      Posts: 3433 Medals: 26
TUER
|
 |
«
Reply #13 on:
2010-03-08 08:37:57 » |
|
Er, how can it not interoperate? Cas  I was thinking about this : 1 2 3 4
| private cl_mem vboMem;
|
1 2 3 4
| int buffer[] = new int[1]; gl.glGenBuffers(1, IntBuffer.wrap(buffer)); vertexBufferObject = buffer[0]; |
1 2 3 4 5 6
| if (GL_INTEROP) { vboMem = clCreateFromGLBuffer(context, CL_MEM_WRITE_ONLY, vertexBufferObject, null); } |
but finally, you're right, it uses plain OpenGL, it should work with LWJGL too.
|
Julien Gouesse
|
|
|
|