Skip to main content

Java 3D 1.3.2-build5 experimental release

20 replies [Last post]
kcr
Offline
Joined: 2004-03-17

We just released a build of 1.3.2-build5-experimental on j3d-core.dev.java.net in the Documents and Files Area:

https://j3d-core.dev.java.net/servlets/ProjectDocumentList

This release contains a number of bug fixes made since build4, plus the DirectX version of Java 3D 1.3.2 (the DirectX version is not well-tested). We will make 1.3.2-build5 available via JNLP some time next week.

The single Java 3D bundle for Windows now has both OpenGL and DirectX .dll's in the same install bundle. A system property is now used to select between them. Those interested in trying out the DirectX version, can do so as follows (after installing Java 3D 1.3.2-build5):

java -Dj3d.rend=d3d MainProgramClass ...

Let us know if there are any problems.

-- Kevin

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kcr
Offline
Joined: 2004-03-17

>
> Sure, I'd be happy to send you the binaries if it's
> legal :) - the dlls+jars work out to < 4mb IIRC.

As long as you redistrubute it for non-commercial use under terms of the JRL to another JRL licensee, which is pretty much anyone who has ever registered for java.net, then it should be legal. (I say "should be" because I am not an attorney so my statements are not to be interpreted as legal advice )

> OTOH, though, if you really have Ant 1.6.1 and
> VC++6.0, building the binaries is honestly a
> piece-of-cake thanks to the build.xml put together by
> the Support Team. I actually do it from the command
> line:
>
> ant -Dbuild.comp=vc
>
> is all it takes if you have the paths to ant, jdk and
> vc++ set correctly.

Yes, this is certainly easier. Or you can wait until tomorrow, when we put up our first "weekly-or-thereabouts" build.

-- Kevin

pauldb
Offline
Joined: 2003-08-30

Hi Kevin,
do you have a target date for the release of 1.3.2? And will there be a DirectX version?

The OpenGL version of one of the earlier builds seemed to take much longer to start for me, compared to the DirectX 1.3.1. By 'start', I mean draw the canvas for the first time.
-Paul

kcr
Offline
Joined: 2004-03-17

> Hi Kevin,
> do you have a target date for the release of 1.3.2? And will there be a DirectX version?

We are targeting a Beta release of 1.3.2 some time in October. The just-released 1.3.2-build5 has DirectX support (see my first post in this thread for info about how to access it).

> The OpenGL version of one of the earlier builds seemed to take much longer to start for
> me, compared to the DirectX 1.3.1. By 'start', I mean draw the canvas for the first time.

I see the opposite problem on my Windows/XP machine. HelloUniverse takes about 4-5 times as long to start with DirectX as it does with OpenGL.

-- Kevin

mikofclassx
Offline
Joined: 2003-07-02

During my navigation of the java3d sources I noticed the IMPRESSIVE (a nightmare) copyDataToSurfacexxx() function of D3dUtil.cpp used to copy from a direct3d surface to the offscreen buffer.

I suppose that the above function is the bottleneck of Offscreen rendering with Java3D/directx.
The OGL implementation uses readPixels() and therefore it's probably faster due to the ogl implementation.

Why don't reimplement it by using specific hardware-accelerated copy functions of DirectX ?

I found something interesting here: http://www.geocities.com/foetsch/d3d8screenshot/d3d8screenshot.htm

kcr
Offline
Joined: 2004-03-17

> Why don't reimplement it by using specific hardware-accelerated copy functions of DirectX ?
>
> I found something interesting here:
> http://www.geocities.com/foetsch/d3d8screenshot/d3d8screenshot.htm

This sounds like an excellent idea. We don't have the resources (or the inclination, really) to work on the DirectX port of Java 3D in the near term. The only way this is going to get done is if someone in the community steps up to the plate and volunteers to do the work. Ditto for programmable shader support in Java 3D 1.4. Supporting Cg shaders in the DirectX port shouldn't be too hard, but we don't plan to do that work.

-- Kevin

nvaidya
Offline
Joined: 2004-08-03

> Ehi NVaidya would you send me your b6 binaries ?
>
> Alternatively, how to build it from Eclipse with VC++
> 6.00 ?
>
> Cheers,
>
> Mik

Mik,

Sure, I'd be happy to send you the binaries if it's legal :) - the dlls+jars work out to < 4mb IIRC. OTOH, though, if you really have Ant 1.6.1 and VC++6.0, building the binaries is honestly a piece-of-cake thanks to the build.xml put together by the Support Team. I actually do it from the command line:
< ant -Dbuild.comp=vc
is all it takes if you have the paths to ant, jdk and vc++ set correctly.

Let us know if you have any problems.

--Vaidya

mikofclassx
Offline
Joined: 2003-07-02

Thanks very much NVaidya,

I managed to compile the new Java3D. The Canvas3D works as expected now.

Cheers,

Mik
--

nvaidya
Offline
Joined: 2004-08-03

> The off-screen bug (Issue 72) is fixed.
>
> -- Kevin

Grabbed the latest source from CVS and compiled it with VC++6.0. This got me 1.3.2-build6-experimental.

Works Great ! No NPEs, and no missing geometry/texture (Issue 18, Chien please note) with many of the things I've tested as of now.

Surely everyone here must be very enthused by the recent excellent progress.

Thanks

--Vaidya

mikofclassx
Offline
Joined: 2003-07-02

Ehi NVaidya would you send me your b6 binaries ?

Alternatively, how to build it from Eclipse with VC++ 6.00 ?

Cheers,

Mik

kcr
Offline
Joined: 2004-03-17

> Alternatively, how to build it from Eclipse with VC++ 6.00 ?

If you have Visual C++ installed, you should be able to build it from a command shell by typing the following in the j3d-core directory:

ant -Dbuild.comp=vc dist

Btw, we plan to start posting periodic builds (probably weekly, but maybe more frequently) as soon as we get our build system going. In any case, we'll put one on our web site today or, more likely, tomorrow.

-- Kevin

mikofclassx
Offline
Joined: 2003-07-02

Nice to hear from you KCR.

Please post the new build asap!

Mik

nvaidya
Offline
Joined: 2004-08-03

> > Hmmm....took some time off to track the exception
> > below. Looks like this exception could be
> triggered
> > by invoking Canvas3D.setOffScreenBuffer(..) at the
> > construction time of an OffScreenCanvas3D...
>
> Thanks for the additional info. We tracked this down
> to a problem with the fix for Issue 18. The problem
> occurs when you set the off-screen buffer before the
> off-screen Canvas3D has been added to the view. We
> will file a new issue for this (and we already have a
> fix that I will putback later today).

You sure have the community all fired up :). Much appreciate the help to say the least.

>
> > It also appears that using a custom
> > GraphicsConfigTemplate3D triggers a "Canvas3D
> created
> > with null graphics configuration" warning, as
> opposed
> > to one obtained from
> > SimpleUniverse.getPreferredConfiguration().
>
> This means that you are getting a null graphics
> configuration returned from
> GraphicsDevice.getBestConfiguration(). I am not aware
> of any changes that were made to the
> GraphicsConfiguration selection code between build4
> and build5. Are you running with exactly the same
> environment on 1.3.2-build4 and 1.3.2-build5 and
> seeing the problem only on build5? What values are
> you setting in the GraphicsConfigTemplate3D?
>

OK ! I need to take back some of what I said - looks like I'm running into the same null config. issue with both build 4 and 5, if I try to use a custom GraphicsConfigTemplate3D with depthSize specified to be 32; value of 16 works without any complaints w/ both the builds. I do have the WinXP control panel settings to "color quality highest(32 bit)". Is there a way to query the depthSize used by a Java3D app. from the GraphicsConfiguration handle returned by SimpleUniverse.getPreferredConfiguration() ? In a brief escapade, I got myself hopelessly entangled in a catch-22 loop trying to follow GraphicsEnvironment() -> DefaultScreenDevice -> GraphicsConfigTemplate3D ...blahblahblah. Will probably give it a second look again later today.

Will checkout the CVS and give the build 5 a whirl.

Thanks

--Vaidya

Message was edited by: NVaidya
OK ! on the depthsize note above, the getPreferredConfiguration() uses default value of 16. What I actually was trying to figure was that if there were a way to get a handle on the GraphicsConfigTemplate3D from the GraphicsConfiguration returned by SimpleUniverse so that I could query it for the depthSize and other properties.

nvaidya
Offline
Joined: 2004-08-03

Hmmm....took some time off to track the exception below. Looks like this exception could be triggered by invoking Canvas3D.setOffScreenBuffer(..) at the construction time of an OffScreenCanvas3D like so:

[code]
OffScreenCanvas3D(GraphicsConfiguration graphicsConfiguration,
boolean offScreen) {

super(graphicsConfiguration, offScreen);
int width = 512, height = 512;
BufferedImage bImage =
new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);

ImageComponent2D buffer =
new ImageComponent2D(ImageComponent.FORMAT_RGBA, bImage);

setOffScreenBuffer(buffer);
}
[/code]

It also appears that using a custom GraphicsConfigTemplate3D triggers a "Canvas3D created with null graphics configuration" warning, as opposed to one obtained from SimpleUniverse.getPreferredConfiguration().

Above issues are specific to b5; b4 works alright with jdk5.0RC.

Let me know if you need any further info.

--Vaidya

Java 3D pre-release version: 1.3.2-build5-experimental 9/10/04 2:14:20 PM PDT

Exception in thread "main" java.lang.NullPointerException
at javax.media.j3d.Canvas3D.sendCreateOffScreenBuffer(Unknown Source)
at javax.media.j3d.Canvas3D.setOffScreenBuffer(Unknown Source)
at OffScreenCanvas3D.(OffScreenCanvas3D.java:59)
at PrintCanvas3D$AppPanel.createCanvas3D(PrintCanvas3D.java:232)
at PrintCanvas3D$AppPanel.(PrintCanvas3D.java:254)
at PrintCanvas3D$AppPanel.(PrintCanvas3D.java:75)
at PrintCanvas3D.(PrintCanvas3D.java:317)
at PrintCanvas3D.main(PrintCanvas3D.java:323)

Message was edited by: NVaidya
PS:
I've tested the above with the Java 3D demo PrintCanvas3D - simply change the constructor of OffScreenCanvas3D as shown above.

kcr
Offline
Joined: 2004-03-17

> Hmmm....took some time off to track the exception
> below. Looks like this exception could be triggered
> by invoking Canvas3D.setOffScreenBuffer(..) at the
> construction time of an OffScreenCanvas3D...

Thanks for the additional info. We tracked this down to a problem with the fix for Issue 18. The problem occurs when you set the off-screen buffer before the off-screen Canvas3D has been added to the view. We will file a new issue for this (and we already have a fix that I will putback later today).

> It also appears that using a custom
> GraphicsConfigTemplate3D triggers a "Canvas3D created
> with null graphics configuration" warning, as opposed
> to one obtained from
> SimpleUniverse.getPreferredConfiguration().

This means that you are getting a null graphics configuration returned from GraphicsDevice.getBestConfiguration(). I am not aware of any changes that were made to the GraphicsConfiguration selection code between build4 and build5. Are you running with exactly the same environment on 1.3.2-build4 and 1.3.2-build5 and seeing the problem only on build5? What values are you setting in the GraphicsConfigTemplate3D?

-- Kevin

kcr
Offline
Joined: 2004-03-17

The off-screen bug (Issue 72) is fixed.

-- Kevin

_uj
Offline
Joined: 2006-02-17

I'm so happy Java3D is being actively maintained again, thank you :).

kcr
Offline
Joined: 2004-03-17

> I always get this error with the new version. No problems with the official 1.3.1WIN both OGL or DX.
>
> java.lang.NullPointerException at javax.media.j3d.Canvas3D.sendCreateOffScreenBuffer(Unknown Source)
> at javax.media.j3d.Canvas3D.setOffScreenBuffer(Unknown Source)
> at it.classx.util.java3d.PictureGrabberCanvas3D.(Unknown Source)

We haven't seen this error. What operating environment are you using? Can you run the PrintCanvas3D or OffScreenTest example programs (in j3d-examples)? They work fine for us on Windows/XP. Linux has a known problem (Issue 20) that we are working on:

https://java3d.dev.java.net/issues/show_bug.cgi?id=20

-- Kevin

mikofclassx
Offline
Joined: 2003-07-02

from the java3d 1.3.1
PrintCanvas3D
OffScreenCanvas3D

They both work fine with the new Java3d.
I'm on a Matrox P650 / Win2k / jdk1.5rc

here's my grabber src:

----
package it.classx.util.java3d;

import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsEnvironment;
import java.awt.image.BufferedImage;

import javax.media.j3d.Canvas3D;
import javax.media.j3d.GraphicsConfigTemplate3D;
import javax.media.j3d.ImageComponent2D;
import javax.media.j3d.Raster;
import javax.vecmath.Point3f;

import sun.misc.Perf;
import sun.misc.PerformanceLogger;

import com.sun.j3d.utils.universe.SimpleUniverse;

/**
* PictureGrabber is designed to be used as an offscreen canvas which can take a
* picture of a model with an alpha masked background. This is done by reading
* the canvas into a raster with a depth componant, and then checking which
* pixels were written too and which were not.
*
*/

public class PictureGrabberCanvas3D extends Canvas3D
{
private int width;
private int height;
private ImageComponent2D offscreenBuffer;
private BufferedImage pic;

// construct the grabber
public PictureGrabberCanvas3D(GraphicsConfiguration config, int width, int height)
{
super(config, true);

this.width = width;
this.height = height;

this.getScreen3D().setPhysicalScreenWidth(0.0254 / 90.0 * width);
this.getScreen3D().setPhysicalScreenHeight(0.0254 / 90.0 * height);
this.getScreen3D().setSize(width, height);

// create the offscreen buffer
pic = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
offscreenBuffer = new ImageComponent2D(ImageComponent2D.FORMAT_RGB, pic, true, false);
this.setOffScreenBuffer(offscreenBuffer);
offscreenBuffer.setCapability(ImageComponent2D.ALLOW_IMAGE_READ);

}

private static GraphicsConfiguration getOffscreenGraphicsConfig()
{
GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
template.setDoubleBuffer(GraphicsConfigTemplate3D.UNNECESSARY);
template.setSceneAntialiasing(GraphicsConfigTemplate3D.PREFERRED);
GraphicsConfiguration gcfg = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getBestConfiguration(template);
return gcfg;
}

/**
* This will take the picture immediately by forcing a frame draw. This is
* only acceptable if the canvas is an offscreen canvas.
*/
public BufferedImage takePicture()
{
long f = Perf.getPerf().highResFrequency();
long c = Perf.getPerf().highResCounter();
renderOffScreenBuffer();
waitForOffScreenRendering();
System.out.println((Perf.getPerf().highResCounter()-c)*1000/f);
return pic;
}
}

mikofclassx
Offline
Joined: 2003-07-02

I always get this error with the new version. No problems with the official 1.3.1WIN both OGL or DX.

java.lang.NullPointerException
at javax.media.j3d.Canvas3D.sendCreateOffScreenBuffer(Unknown Source)
at javax.media.j3d.Canvas3D.setOffScreenBuffer(Unknown Source)
at it.classx.util.java3d.PictureGrabberCanvas3D.(Unknown Source)

Cheers,

mik

herkules
Offline
Joined: 2003-06-12

Works with FlyingGuns, just issue https://java3d.dev.java.net/issues/show_bug.cgi?id=5 is still present on all windows boxes I tested on....

This issue now has it's D3D counterpart:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7271866
Function=[Unknown.]
Library=D:\DRTS\projects\threed\java3d\bin\j3dcore-d3d.dll

NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.

Current Java thread:
at javax.media.j3d.Canvas3D.endDisplayList(Native Method)
at javax.media.j3d.DisplayListRenderMethod.buildIndividualDisplayList(Unknown Source)
at javax.media.j3d.RenderBin.updateDirtyDisplayLists(Unknown Source)
at javax.media.j3d.Renderer.doWork(Unknown Source)
at javax.media.j3d.J3dThread.run(Unknown Source)

Dynamic libraries:
0x00400000 - 0x0040B000 C:\j2sdk1.4.2_05\jre\bin\java.exe
0x7C910000 - 0x7C9C7000 C:\WINDOWS\system32\ntdll.dll
0x7C800000 - 0x7C906000 C:\WINDOWS\system32\kernel32.dll
0x77DA0000 - 0x77E4A000 C:\WINDOWS\system32\ADVAPI32.dll
0x77E50000 - 0x77EE1000 C:\WINDOWS\system32\RPCRT4.dll
0x77BE0000 - 0x77C38000 C:\WINDOWS\system32\MSVCRT.dll
0x08000000 - 0x08139000 C:\j2sdk1.4.2_05\jre\bin\client\jvm.dll
0x77D10000 - 0x77DA0000 C:\WINDOWS\system32\USER32.dll
0x77EF0000 - 0x77F36000 C:\WINDOWS\system32\GDI32.dll
0x76AF0000 - 0x76B1E000 C:\WINDOWS\system32\WINMM.dll
0x76330000 - 0x7634D000 C:\WINDOWS\system32\IMM32.DLL
0x62E10000 - 0x62E19000 C:\WINDOWS\system32\LPK.DLL
0x75790000 - 0x757FB000 C:\WINDOWS\system32\USP10.dll
0x10000000 - 0x10007000 C:\j2sdk1.4.2_05\jre\bin\hpi.dll
0x003B0000 - 0x003BE000 C:\j2sdk1.4.2_05\jre\bin\verify.dll
0x003C0000 - 0x003D9000 C:\j2sdk1.4.2_05\jre\bin\java.dll
0x003E0000 - 0x003ED000 C:\j2sdk1.4.2_05\jre\bin\zip.dll
0x02C80000 - 0x02D92000 C:\j2sdk1.4.2_05\jre\bin\awt.dll
0x72F70000 - 0x72F96000 C:\WINDOWS\system32\WINSPOOL.DRV
0x774B0000 - 0x775EC000 C:\WINDOWS\system32\ole32.dll
0x5B0F0000 - 0x5B128000 C:\WINDOWS\system32\uxtheme.dll
0x02FF0000 - 0x03041000 C:\j2sdk1.4.2_05\jre\bin\fontmanager.dll
0x736D0000 - 0x73719000 C:\WINDOWS\system32\ddraw.dll
0x73B30000 - 0x73B36000 C:\WINDOWS\system32\DCIMAN32.dll
0x738B0000 - 0x73980000 C:\WINDOWS\system32\D3DIM700.DLL
0x07250000 - 0x07257000 C:\Programme\Logitech\MouseWare\System\LgWndHk.dll
0x75250000 - 0x7527E000 C:\WINDOWS\system32\msctfime.ime
0x07260000 - 0x07265000 C:\j2sdk1.4.2_05\jre\bin\jawt.dll
0x07270000 - 0x072CA000 D:\DRTS\projects\threed\java3d\bin\j3dcore-d3d.dll
0x6DE90000 - 0x6DFB8000 C:\WINDOWS\system32\d3d8.dll
0x6DE80000 - 0x6DE86000 C:\WINDOWS\system32\d3d8thk.dll
0x77BD0000 - 0x77BD8000 C:\WINDOWS\system32\VERSION.dll
0x5D450000 - 0x5D4E7000 C:\WINDOWS\system32\COMCTL32.dll
0x69500000 - 0x698C1000 C:\WINDOWS\system32\nvoglnt.dll
0x07DC0000 - 0x07DF5000 C:\WINDOWS\system32\D3DREF8.DLL
0x07F40000 - 0x07F4B000 C:\Programme\Gemeinsame Dateien\Logitech\Scrolling\LgMsgHk.dll
0x76020000 - 0x76085000 C:\WINDOWS\system32\MSVCP60.dll
0x07FD0000 - 0x07FEE000 C:\j2sdk1.4.2_05\jre\bin\jpeg.dll
0x0C510000 - 0x0C533000 C:\j2sdk1.4.2_05\jre\bin\cmm.dll
0x07FF0000 - 0x07FFB000 D:\DRTS\projects\threed\java3d\bin\j3dutils.dll
0x07F50000 - 0x07F72000 C:\j2sdk1.4.2_05\jre\bin\dcpr.dll
0x0C960000 - 0x0C984000 C:\j2sdk1.4.2_05\jre\bin\jsound.dll
0x72C90000 - 0x72C99000 C:\WINDOWS\system32\wdmaud.drv
0x76BF0000 - 0x76C1E000 C:\WINDOWS\system32\WINTRUST.dll
0x77A50000 - 0x77AE5000 C:\WINDOWS\system32\CRYPT32.dll
0x77AF0000 - 0x77B02000 C:\WINDOWS\system32\MSASN1.dll
0x76C50000 - 0x76C78000 C:\WINDOWS\system32\IMAGEHLP.dll
0x72C80000 - 0x72C88000 C:\WINDOWS\system32\msacm32.drv
0x77BB0000 - 0x77BC5000 C:\WINDOWS\system32\MSACM32.dll
0x77BA0000 - 0x77BA7000 C:\WINDOWS\system32\midimap.dll
0x59DD0000 - 0x59E71000 C:\WINDOWS\system32\DBGHELP.dll
0x76BB0000 - 0x76BBB000 C:\WINDOWS\system32\PSAPI.DLL

Heap at VM Abort:
Heap
def new generation total 2432K, used 1040K [0x10010000, 0x102b0000, 0x104f0000)
eden space 2176K, 39% used [0x10010000, 0x100e7320, 0x10230000)
from space 256K, 70% used [0x10270000, 0x1029d050, 0x102b0000)
to space 256K, 0% used [0x10230000, 0x10230000, 0x10270000)
tenured generation total 31704K, used 21848K [0x104f0000, 0x123e6000, 0x14010000)
the space 31704K, 68% used [0x104f0000, 0x11a46168, 0x11a46200, 0x123e6000)
compacting perm gen total 11264K, used 11201K [0x14010000, 0x14b10000, 0x18010000)
the space 11264K, 99% used [0x14010000, 0x14b006d0, 0x14b00800, 0x14b10000)

Local Time = Mon Sep 13 18:50:28 2004
Elapsed Time = 54
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode)
#
# An error report file has been saved as hs_err_pid3516.log.
# Please refer to the file for further information.
#

Message was edited by: Herkules