Java3D for DTV apps

Hi everybody.

I’m investigating Java3D in order to see if it can be used in a 3D titling and effects desktop video application.
After some testing I have the impression that Java3D lacks of at least two important points:

  • it does a poor scene antialiasing (edges appear jagged, even when antialiasing is on).

  • it does not handle background alpha channel. This makes impossible to draw a scene on a bufferedimage, save it as TGA (with alpha) and blend the image on other graphics.
    I know there are some ways to “extract” the alpha mask from a rendered scene frame, buf the results are really ugly and they are not usable for DTV applications.

Does anyone know if the new Java3D 1.3 has some improvements/solutions of the above points ?

Cheers,
Javazoid (Mik)

I’m not an expert in Java3D but these problems are common regardless of 3D API.

You’ll get good scene antialiasing if you render your image in double size then scale the image down to the desired size.

Several years ago I used the following algorithm (if I remember it correctly ;)) to get an image with the alpha channel:

  1. Render the scene on black background, lighting off, texturing off (actually I used alpha channel of textures as the color texture to keep the “holes”), geometry color is set to desired alpha value. Grab the result - you’ve got the alpha channel.
  2. Render the scene as usual and grab the result - you’ve got the color channels.
  3. Combine the channels into one image.
    This algorithm combined with the scene antialiasing produces good result.

Hope this helps! 8)

Isn’t the application you’re describing typically something not realtime?
Java3D is designed for realtime 3d graphics.
I can imagine java3d being used in such an app to do some previewing of the scene and then render it in high quality.

Erik

Thanks for the hins alexz. Of course I would really like to see the results you achieved.

Thanks erikd, but once you have the scene, how to render the high quality version ? Do you mean that I have to render it with something else than Java3D ? Which renderes is supposed to support the Java3D scenegraph structure/format ?

Cheers,

(Mik)

I don’t think any renderer supports the java3d structure.
I just guessing here since I don’t have much experience with java3d but I suppose you could do it the other way around and import an existing format of a renderer to java3d.
I guess POV could be a good choice since it’s free, got lots of tools available, the output can be of very high quality and the file format is easy to understand (it’s a script language).
Then again, POV (like all renderers) can also output to fast, low quality for previewing so I’m not sure if importing to java3d will be worth the effort.
Some not free renderers like 3ds-max even have realtime preview functions built in…

Bottomline is that you can’t expect the output from java3d to be of the highest quality possible. It’s an api designed for realtime 3d graphics and just not designed for high quality rendering.

My aim is to find a good middlepoint between graphics quality and performance. The output of Java3D is not that bad for DTV. Antialiasing can be an issue, but I could get some nicer output with 4x resampling (even if it can be a little expensive in terms of speed and memory).

Maybe the worst point of Java3D is the lack of a true alpha channel for the background. Maybe I should consider GL4Java but I have little (if no) experience with OpenGL.

Cheers,

(Mik)