Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Achim

#1
Support / Re: blitting text and images
April 16, 2010, 11:33:07 PM
raft,

using your code now as of recent suggestion by Egon - works great - thanks!

Achim
#2
Support / Re: Any collada support?
April 13, 2010, 10:55:01 PM
and I would be interested in *exporting* an Object3D or tha whole world into collada format...
#3
is there a ready made code snippet and associated texture with numbers and letters which I could use to display simple strings when using the HW renderer?
#4
Hi Egon,
many thanks for the quick reply - I briefly tested the new jpct.jar - it doesn't solve my problem - I have to look closer and check whether some synchronisation helps.
I didn't test the improved error handling yet - I keep you updated on my progress.

btw: I will be presenting tensegrities in general and my tensegrity CAD program at RTT Excite - a conference the Munich-based visualization company holds every year - and will of cause mention jpct.
Achim
#5
an update: in the meantime I have rewritten my app and cleaned up the multithreading model - I now have a main loop doing the jpct rendering, each tensegrity obejct has its own relaxation thread, the user interaction in the awt thread, delegating modifications to the objects to either the main thread or the tensegrity object threads.

This solved the problem - no speed issues any more. However, I still have trouble getting the shadow to work. After setting up the shadow helper, everything looks perfect until I move the camera. After a while, the shadowhelper seems to confuse the camera with the projector - the shadow jumps as if the camera is the shadow-casting light source. This happens faster and more often for big objects - strange.
Also, I notices if you set up the shadow helper while the canvas is not visible yet, the constructor waits indefinitely for an opportunity to paint into the awtgl canvas (jpct1.9 and 2.0 beta). You then have to kill the Java VM process.
#6
Has anybody experimented with the NVIDA 3D drivers to display true 3D images, using their "3D vision discover" mode with anaglyphic rendering?
I would like to know what I would need to do to use this function in an AWTGL canvas.
#7
Support / Re: problems migrating to Windows 7 64 bits
January 09, 2010, 10:45:49 PM
Hi Egon,
I knew there must have been a stupid mistake - I'm still confused though, since this code ran on the old machine when shadowing is turned off. I also am skeptical whether your suggestions would increase the frame rate from the currently 1 fps (for medium complexity objects like the one you showed in the demo reel. Simpler ones are a bit faster).

I will let the problem rest for a while and take a fresh look at it in a couple of days, and also have a closer look at your examples.

Thanks a lot for your help so far.
#8
Support / Re: problems migrating to Windows 7 64 bits
January 09, 2010, 09:21:40 PM
output for the awtgl version (runs like a charm):
Java version is: 1.6.0_17
-> support for BufferedImage
Version helper for 1.2+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Using LWJGL's AWTGLCanvas
Software renderer disposed
Driver is: RDPDD/6.1.7600.16385 on NVIDIA Corporation / GeForce GT 220/PCI/SSE2
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
OpenGL renderer initialized (using 4 texture stages)
Hardware supports textures up to 8192*8192 in size!
Adding Lightsource: 0
Subobject of object 2/object4 compiled using 2400 vertices in 62ms!
Object 2/object4 compiled to 1 subobjects in 101ms!
Subobject of object 0/object2 compiled using 2400 vertices in 19ms!
Object 0/object2 compiled to 1 subobjects in 29ms!
Subobject of object 1/object3 compiled using 48 vertices in 0ms!
Object 1/object3 compiled to 1 subobjects in 0ms!
Additional visibility list (2) created with size: 4096
Additional visibility list (3) created with size: 4096
Compiled 3 display lists!
8
54
60
61
60
61
60
60
61
60
61
61
60
Visibility lists disposed!


my rendering code:

    @Override   
    public void paint(Graphics g) {
        final int millisToPaint = 1000/framesPerSec;   //time interval for new paint (in thread awt)
        long millisSinceLastPaint = System.currentTimeMillis()-lastTimePainted;
        if (millisSinceLastPaint < millisToPaint) {
             try { thread.sleep(millisToPaint - millisSinceLastPaint); }
             catch (Exception e) {
                System.out.println(Thread.currentThread());
                System.out.println("$3 " + e);
             }
        }  else {
        try {
           // System.out.println("paint called at" + System.currentTimeMillis());
            buffer.clear(Color.DARK_GRAY);
            md.synchPositions();
            if (SW_RENDERING) {
//                if (millisSinceLastPaint < millisToPaint) { 
//                    thread.sleep(millisToPaint - millisSinceLastPaint);
//                }
                world.renderScene(buffer);
                world.draw(buffer);
                drawAnnotations();
                buffer.update();
                buffer.display(g);
            } else {
                if (sh != null) {
                     sh.updateShadowMap();
                    sh.drawScene();
                }
                drawAnnotations();
                buffer.update();
                buffer.displayGLOnly();
                canvas.repaint();
            }
        } catch (Exception e) {
            //the SW renderer sometimes produces concurrent access and nullpointer exceptions
            System.out.println(Thread.currentThread());
            System.out.println("$3 " + e + " " + canvas);
        }
        lastTimePainted = System.currentTimeMillis();
         }
    }
#9
Support / Re: problems migrating to Windows 7 64 bits
January 09, 2010, 05:40:53 PM
Perhaps I am doing somthing really stupid - therefore here the code snippet which sets up the shadow map:

   void setupShadowCaster() {
       if (!SW_RENDERING) {
           sh = null;
           if (useShadows) {
               projector = new Projector();
               projector.setPosition(sun.getPosition());
               projector.lookAt(md.getTransformedCenter());        //NOTE: this requires that structure is setup first
               projector.setFOV(0.7f); //set this value large enough so that the complete shadow is casted
               projector.setYFOV(0.7f);
   
               sh = new ShadowHelper(world, buffer, projector, 1024);
               sh.addReceiver(background);
               sh.setAmbientLight(new Color(64, 64, 64)); //sets the color of the shadow
              // sh.setFiltering(true);
           }
       }
   }

when using HW renderer and Shadow map (i.e. SW_RENDERING = false, useShadows=true)

Loading Texture...karoXY.jpg
Loading Texture...karoYZ.jpg
Loading Texture...karoXZ.jpg
Loading Texture...karobw.jpg
Loading Texture...envmap-alu.jpg
Java version is: 1.6.0_17
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Using LWJGL's AWTGLCanvas
Adding Lightsource: 0
Thread[AWT-EventQueue-0,6,main]
Driver is: RDPDD/6.1.7600.16385 on NVIDIA Corporation / GeForce GT 220/PCI/SSE2
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
OpenGL renderer initialized (using 4 texture stages)
Hardware supports textures up to 8192*8192 in size!
Additional visibility list (2) created with size: 4096
Additional visibility list (3) created with size: 4096
Additional visibility list (4) created with size: 4096
Allocating 4194304 bytes of direct memory!
Caching 4194304 bytes of direct memory!
Allocating 262144 bytes of direct memory!
Caching 262144 bytes of direct memory!


>>> Very slow.


Setting useShadows to false: buffer is only cleared, nothing is rendered (but my simulation worker thread is running)

Loading Texture...karoXY.jpg
Loading Texture...karoYZ.jpg
Loading Texture...karoXZ.jpg
Loading Texture...karobw.jpg
Loading Texture...envmap-alu.jpg
Java version is: 1.6.0_17
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Using LWJGL's AWTGLCanvas
Adding Lightsource: 0
Driver is: RDPDD/6.1.7600.16385 on NVIDIA Corporation / GeForce GT 220/PCI/SSE2
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
OpenGL renderer initialized (using 4 texture stages)

no rendering at all after this (buffer is only cleared)....
#10
Support / Re: problems migrating to Windows 7 64 bits
January 09, 2010, 04:03:18 PM
this is the output of your test program above:
\Display0
--> D3DGraphicsConfig[dev=D3DGraphicsDevice[screen=0],pixfmt=0]
Process exited with exit code 0.

The parameters suggested by the lwgl forum had no effect.

terrain demo: inital fps approx. 130, after some flying around 270 ....

I have to look at the shadow maps. Curious thing is though that on my old system with onboard graphics (!) everything worked allright (it was a 3.6 GHz system, though).


#11
Support / Re: problems migrating to Windows 7 64 bits
January 09, 2010, 03:19:33 PM
will try the things you suggested above. In the meantime, here the log of the startup with the new jpct beta:
C:\Oracle\Middleware\jdk1.6.0_17\bin\javaw.exe -server -classpath C:\dev\TensegrityDesign\ClientAppOpenGL\classes;C:\dev\TensegrityDesign\jdom\build\jdom.jar;C:\dev\TensegrityDesign\jpct\lib\lwjgl-2.2.1\jar\lwjgl_util.jar;C:\dev\TensegrityDesign\jpct\lib\lwjgl-2.2.1\jar\lwjgl.jar;C:\dev\TensegrityDesign\jpct\lib\lwjgl-2.2.1\jar\jinput.jar;C:\dev\TensegrityDesign\jpct\lib\lwjgl-2.2.1\jar\lwjgl_util_applet.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-antlr.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-apache-bcel.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-apache-bsf.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-apache-log4j.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-apache-oro.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-apache-regexp.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-apache-resolver.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-commons-logging.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-commons-net.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-jai.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-javamail.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-jdepend.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-jmf.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-jsch.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-junit.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-launcher.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-netrexx.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-nodeps.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-starteam.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-stylebook.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-swing.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-trax.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant-weblogic.jar;C:\Oracle\Middleware\jdeveloper\ant\lib\ant.jar;C:\dev\TensegrityDesign\jpct\lib\lwjgl-2.2.1\native\windows;C:\dev\TensegrityDesign\jpct\lib\jpct_beta\jpct.jar -Djava.library.path=C:\dev\TensegrityDesign\jpct\lib\lwjgl-2.2.1\native\windows\ Tensegrity3DApplet -Xmx1024m
Loading Texture...karoXY.jpg
Loading Texture...karoYZ.jpg
Loading Texture...karoXZ.jpg
Loading Texture...karobw.jpg
Loading Texture...envmap-alu.jpg
Java version is: 1.6.0_17
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Using LWJGL's AWTGLCanvas
Adding Lightsource: 0
Driver is: RDPDD/6.1.7600.16385 on NVIDIA Corporation / GeForce GT 220/PCI/SSE2
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
OpenGL renderer initialized (using 4 texture stages)
Hardware supports textures up to 8192*8192 in size!
Additional visibility list (2) created with size: 4096
Software renderer disposed
Additional visibility list (3) created with size: 4096
Additional visibility list (4) created with size: 4096
Allocating 268435456 bytes of direct memory!
Allocating 268435456 bytes of direct memory!
Allocating 262144 bytes of direct memory!
Caching 262144 bytes of direct memory!

then my output messages start
#12
Support / Re: problems migrating to Windows 7 64 bits
January 08, 2010, 08:31:47 PM
I do have the lates NVIDA driver - version 195.62.
I am not sure though whether that is used automatically for OpenGL (Windows making it more difficult than necessary ?), or whether you would have to change some settings...
#13
Support / Re: problems migrating to Windows 7 64 bits
January 08, 2010, 06:18:14 PM
thanks for your help, Egon.
I am using jdeveloper and installed what I beleived was teh 64bit version - this apparently included the 32bit JDK, however. Now I am traing to find out how one can force jdeveloper to use another, i.e. 64bit JDK (or at least configure the run options for a program to use a difference JVM from the one installed with jdeveloper)
The box demo runs in my current setup, however. I will try the jpcr beta over the weekend.

Update: now running in 64bit JVM. It works now, but very slow (much slower than the SW renderer), and also with shadows. I did System.setProperty("sun.java2d.d3d", "false"); as you suggested some time ago, but this did not have a visible effect.
#14
Support / Re: problems migrating to Windows 7 64 bits
January 08, 2010, 05:24:27 PM
output:

C:\Oracle\Middleware\jdk160_14_R27.6.5-32\bin\javaw.exe -client -classpath "C:\dev\jpctTests\simpleTest\classes;C:\Program Files (x86)\Java\jpct\lib\jpct\jpct.jar;C:\Program Files (x86)\Java\jpct\lib\lwjgl-2.0\jar\jinput.jar;C:\Program Files (x86)\Java\jpct\lib\lwjgl-2.0\jar\lwjgl.jar;C:\Program Files (x86)\Java\jpct\lib\lwjgl-2.0\jar\lwjgl_test.jar;C:\Program Files (x86)\Java\jpct\lib\lwjgl-2.0\jar\lwjgl_util.jar;C:\Program Files (x86)\Java\jpct\lib\lwjgl-2.0\jar\lwjgl_util_applet.jar" MallocTest
Allocating 262144 bytes of direct memory!
Succeded to allocate 262144 bytes!
Allocating 1048576 bytes of direct memory!
Succeded to allocate 1048576 bytes!
Allocating 4194304 bytes of direct memory!
Succeded to allocate 4194304 bytes!
Allocating 16777216 bytes of direct memory!
Succeded to allocate 16777216 bytes!
Allocating 67108864 bytes of direct memory!
Failed to allocate 67108864 bytes!
Allocating 268435456 bytes of direct memory!
Failed to allocate 268435456 bytes!
Process exited with exit code 0.

with -Xmx1024m :

Allocating 262144 bytes of direct memory!
Succeded to allocate 262144 bytes!
Allocating 1048576 bytes of direct memory!
Succeded to allocate 1048576 bytes!
Allocating 4194304 bytes of direct memory!
Succeded to allocate 4194304 bytes!
Allocating 16777216 bytes of direct memory!
Succeded to allocate 16777216 bytes!
Allocating 67108864 bytes of direct memory!
Succeded to allocate 67108864 bytes!
Allocating 268435456 bytes of direct memory!
Succeded to allocate 268435456 bytes!
Process exited with exit code 0.

I also switched off shadow maps - still the same error ...
#15
Support / Re: problems migrating to Windows 7 64 bits
January 06, 2010, 04:06:06 PM
no :-(
I am indeed using shadows, but did not have any problems on my old XP installation. I am also experiencing funy behaviour with SW rendering. Swing components used in a sibling panel (both are components of a frame) are flashed briefly at location 0,0 of the panel with the OpneGL buffer....

Achim