Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (116)
games submitted by our members
Games in WIP (563)
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 2597 times)
0 Members and 1 Guest are viewing this topic.
Offline pobrien11

Junior Newbie





« Posted 2010-03-02 01: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
Offline Momoko_Fan

Junior Member


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.

http://github.com/mbien/jocl

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 Member




OutOfCoffeeException


« 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 Member




OutOfCoffeeException


« 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 OpenCL...it no worky.
Offline Momoko_Fan

Junior Member


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: http://www.geeks3d.com/20091221/how-to-enable-opencl-support-on-nvidia-and-amd-platforms/
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 Kernel


Medals: 380
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 :
1  
2  
3  
4  
/**
     * The cl_mem that has the contents of the VBO
     */

    private cl_mem vboMem;


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


1  
2  
3  
4  
5  
6  
if (GL_INTEROP)
        {
            // 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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (30 views)
2014-09-21 02:42:18

BurntPizza (20 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (28 views)
2014-09-20 20:14:06

BurntPizza (32 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!