The Source for Java Technology Collaboration


Home | Changes | Index | Search | Go

Java3DInternalDevelopment

Welcome to the Java 3D Knowledge Base Wiki page for Internal Developers (that is, those developers who will be building or modifying the internals of Java 3D). All Java 3D Community Members are welcome to contribute to this Wiki! Please read Java3DWikiInfo before making any changes to this page.

Table of Contents

Adding New API to Java 3D

Click here for notes on adding new API to Java 3D.

Using Java 3D With NetBeans 4.x

Placeholder for info about using Java 3D with NetBeans 4.x

Compiling D3D? version of Java 3D with MinGW / gcc

Placeholder for info about compiling D3D? version of Java 3D with MinGW / gcc

Useful Java 3D test programs filed in Issue Tracker

JCanvas3D? Information

Click here for JCanvas3D Notes -- notes on JCanvas3D? issues and implementation

Cg Shader Notes

Here are some quick notes regarding the current Cg Shader implementation for OpenGL, and what it will take to port it to D3D?.

To build a version of Java 3D with Cg support:

ant -Dbuild.cg=1 ...

To run a Java 3D program that uses a CgShaderProgram object, you need to set the global shading language to Cg as follows:

java -Dj3d.shadingLanguage=Cg ...

The following files need to be ported from ogl to d3d:

CgShaderProgram.c Implementation of native CgShaderProgramRetained methods
CgWrapper.c Code to set up wrapper pointers to Cg functions (loaded in a separate DLL)
CgWrapper.h Header file containing CgWrapper definitions

The d3d/build-windows-i586-vc.xml file will need to be modified to create a second .dll file, j3dcore-d3d-cg.dll, that includes a single CgWrapper.obj file, and links with the NVIDIA Cg libraries.

The d3d/Canvas3D.cpp file will need to be modified in a similar manner to ogl/Canvas3D.c (do a search for "cg" in the file). The checkCgShaderExtensions() method in CgShaderProgram.c, which is called from getPropertiesFromCurrentContext() in Canvas3D?.c, should be called by the similar function in Canvas3D?.cpp. Notice that a new cgLibraryAvailable flag is now passed into Canvas3D?.createQueryContext() and Canvas3D?.createNewContext(). This flag should be used to determine whether to make any Cg calls in a manner similar to the ogl code. Don't forget to set the Canvas3D?.shadingLanguageCg field in the setupCanvasProperties() method.

Issues

  1. The OpenGL implementation of the shader attribute functions are incomplete.
  2. The VertexAttribute interface is not yet done. When it is, that will need to be ported to D3D? as well (most of the code will be in GeometryArrayRetained).

Topic Java3DInternalDevelopment . { Edit | Ref-By | Printable | Diffs r7 < r6 < r5 < r4 < r3 | More }
 XML java.net RSS

Revision r7 - 23 Jun 2006 - 20:26:24 - Main.kcr
Parents: Java3D