The Java 3D API
The Java 3DTM API
Kevin Rushforth
Chien Yang
Sun Microsystems
https://java3d.dev.java.netAgenda
● Java 3D Community Source Project
● Java 3D 1.4 API
● Demo
● Future Releases
● Q&A
Java 3D Community Source Project
● Source code available at
https://java3d.dev.java.net● Three main sub-projects:
● j3d-core – javax.media.j3d package
● Includes native code for Linux, Solaris, Windows
● j3d-core-utils – com.sun.j3d.* packages
● vecmath – javax.vecmath package
● Other sub-projects include:
● j3d-examples – sample programs
● j3d-contrib-utils – user-contributed, optional utilities
● j3d-incubator – place to develop experimental code
JOALMixer under development
Java 3D Community Source Project
● Community is growing:
● 230 registered project members; 15 signed JCAs
● Java 3D 1.3.2 released
● Bug reports & fixes submitted by community members
● Java Webstart via JNLP – moving to new server
● Support for new platforms:
● Linux/amd64, Solaris/amd64, Linux/ia64 (contributed by
community developer), Linux/ppc prototype
● 1.4 under development (more on this later)
● API developed with community involvement
● API specification ratified by JCP
Java 3D Community Source Project
● Help us improve Java 3D:
● Apple port
● Download and test Java 3D 1.4
● Report bugs
● Participate on forum
● Suggest features (better still, help implement them)
Java 3D Community Source Project
● Roadmap:
● 1.3.2 final release—March 2005
● 1.4 API definition is complete
● 1.4.0 early access (build5) just released
● Final javadoc definitions for all API methods
● Many features implemented
● 1.4.0 beta—September 2005
● 1.4.0 final release—November 2005
Java 3D Community Source Project
● Developer Resources:
● Java 3D Forum on javadesktop.org
● Very active: about 60 posts/week
● Java 3D team reads forum regularly
● Cross-posted to interest 'at' java3d.dev.java.net
● Issue tracker on main java3d.dev.java.net page
● File new issues or query existing issues
● Discuss issues on issues 'at' java3d.dev.java.net mailing list
● Developer mailing list – dev 'at' java3d.dev.java.net
● For discussing implementation details of changes
Agenda
● Java 3D Community Source Project
● Java 3D 1.4 API
● Demo
● Future Releases
● Q&A
Java 3D 1.4 API
● Programmable shaders
● Additional core picking methods
● Stencil buffer support
● New rendering attributes / modes
● Other miscellaneous features
● Latest list of features, status at:
https://j3d-core.dev.java.net/j3d1_4/proposed-changes.htmlJava 3D 1.4 API
● Programmable shaders
● Additional core picking methods
● Stencil buffer support
● New rendering attributes / modes
● Other miscellaneous features
● Latest list of features, status at:
https://j3d-core.dev.java.net/j3d1_4/proposed-changes.htmlShader Class Hierarchy
NodeComponent NodeComponent
Appearance Shader
ShaderAppearance SourceCodeShader
NodeComponent NodeComponent
ShaderProgram ShaderAttribute
GLSLShaderProgram ShaderAttributeObject
CgShaderProgram ShaderAttributeValue
ShaderAttributeArray
NodeComponent ShaderAttributeBinding
ShaderAttributeSet
Programmable Shaders
● App creates Shader object for each vertex and
fragment shader
● App creates GLSLShaderProgram (or Cg...) object
to contain vertex and fragment shaders
● App creates ShaderAttribute{Value,Array} objects
and puts them into a ShaderAttributeSet
● App creates ShaderAppearance to bind a
ShaderProgram and a ShaderAttributeSet
● Demo with example code will be shown
Additional Picking Methods
● New methods in Locale and BranchGroup:
● public PickInfo[] pickAll(mode, flags, pickShape)
● public PickInfo[] pickAllSorted(mode, flags, pickShape)
● public PickInfo pickClosest(mode, flags, pickShape)
● public PickInfo pickAny(mode, flags, pickShape)
● New PickInfo class
● Contains computed information about pick intersection
Stencil Buffer Support
● New methods in GraphicsConfigTemplate3D to
set/get stencil size
● New RenderingAttributes:
● Enable/disable stencil
● Set stencil operation, function, and mask
● No multi-pass support in 1.4
● Apps must use OrderedGroup or preRender callback
New Rendering Attributes
● New depth test function attribute:
● ALWAYS, NEVER, EQUAL, NOT_EQUAL, LESS, GREATER,
LESS_OR_EQUAL (default), GREATER_OR_EQUAL
● Additional blending functions:
● BLEND_SRC_COLOR, BLEND_ONE_MINUS_SRC_COLOR,
BLEND_DST_COLOR, BLEND_ONE_MINUS_DST_COLOR
Other Miscellaneous Features
● Method to retrieve geometry data from tessellated
Font3D glyph
● Scene graph structure change listeners
● Name string for all scene graph objects
● Capability to call getParent() on live/compiled
scene graph
● Method to get the Locale to which a node is
attached
DEMO
Java 3D 1.4 API In Action
Agenda
● Java 3D Community Source Project
● Java 3D 1.4 API
● Demo
● Future Releases
● Q&A
Future Releases
● 1.5 API
● Render to texture
● Shadow map support
● Multi-pass rendering
● Other features that app developers need to fully utilize
shader and access other advanced GPU features
● Other possible features:
● Non-power-of-two textures
● Additional texture formats (NIO support, compression, ...)
● Alpha buffers
● Roughly 9 months after 1.4
● We need your help!
Possible Future Releases
● Next minor release (1.6)
● May include features that don't make 1.5
● Major Java 3D release (2.0)
● Could break compatibility
● Opportunity for significant change (RenderBin rewrite ...)
● Features could include:
● Access to the native context (JOGL integration)
● Extensibility
● Plug-in capability
● Some features may not need a major release (could be done in 1.6)
For More Information
● Pavilion
● POD #1208 – Java 3D, JAI, and JOGL
● POD #1106 – Project Looking Glass
● Other BOFs
● BOF #9877 – JOGL, JSR-239 (Tue, 8:30 PM)
● Community Event – Project Looking Glass (Wed, 6 PM,
Argent Hotel)
● URLs
●
https://java3d.dev.java.net●
http://www.javadesktop.org/forums/forum.jspa?forumID=55For More Information
● Recent books, and articles:
● O'Reilly - “Killer Game Programming”
http://www.oreilly.com/catalog/killergame● JDJ - “Star Trek Technology for Java 3D”
http://java.sys-con.com/read/99792.htm● IEEE Computer Graphics (Mar/Apr 2005) - “Jabiru : Harnessing
Java 3D Behaviors for Device and Display Portablility”
http://doi.ieeecomputersociety.org/10.1109/MCG.2005.42