From 8ad266e192dd129a035492098d18c83c93c79a22 Mon Sep 17 00:00:00 2001 From: Kevin Rushforth Date: Fri, 25 Mar 2005 21:42:54 +0000 Subject: Reorganized 1.4 feature list git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@174 ba19aa83-45c5-6ac9-afd3-db810772062c --- www/j3d1_4/api-changes.html | 27 +++- www/j3d1_4/graph-change-listener.html | 40 +++++ www/j3d1_4/lightweight-canvas3d.html | 27 ++++ www/j3d1_4/picking.html | 31 ++++ www/j3d1_4/proposed-changes.html | 125 +++++++-------- www/j3d1_4/render-texture.html | 32 ++++ www/j3d1_4/shaders.html | 290 +++++++++++++--------------------- www/j3d1_4/stencil.html | 35 ++++ 8 files changed, 360 insertions(+), 247 deletions(-) create mode 100644 www/j3d1_4/graph-change-listener.html create mode 100644 www/j3d1_4/lightweight-canvas3d.html create mode 100644 www/j3d1_4/picking.html create mode 100644 www/j3d1_4/render-texture.html create mode 100644 www/j3d1_4/stencil.html (limited to 'www/j3d1_4') diff --git a/www/j3d1_4/api-changes.html b/www/j3d1_4/api-changes.html index 54ab8c7..0a88c60 100644 --- a/www/j3d1_4/api-changes.html +++ b/www/j3d1_4/api-changes.html @@ -19,8 +19,8 @@ * * NOTE: This file must be edited by hand to avoid Mozilla Composer * putting all preformatted lines into a single line with "
" -* replacing ASCII newlines (which, in turn, causes problems with some -* editors). +* replacing ASCII newlines, making it impossible to do a meaningful +* "diff" operation. * ************************************************************************ --> @@ -84,6 +84,23 @@ I. New/deprecated fields, constructors, methods public static final int ALLOW_PARENT_READ + Sensor + ------ + Deprecated fields: + public static final int PREDICT_NONE + public static final int PREDICT_NEXT_FRAME_TIME + public static final int NO_PREDICTOR + public static final int HEAD_PREDICTOR + public static final int HAND_PREDICTOR + + Deprecated methods: + public void setPredictor(int predictor) + public int getPredictor() + public void setPredictionPolicy(int policy) + public int getPredictionPolicy() + public void getRead(Transform3D read, long deltaT) + + II. Reparented classes NONE @@ -158,6 +175,12 @@ III. New classes and interfaces (in javax.media.j3d) GLSLShaderProgram ----------------- public class GLSLShaderProgram extends ShaderProgram + + +IV. Deprecated classes and interfaces (in javax.media.j3d) + + CompressedGeometry + CompressedGeometryHeader

Page last updated — $Date$ diff --git a/www/j3d1_4/graph-change-listener.html b/www/j3d1_4/graph-change-listener.html new file mode 100644 index 0000000..931d744 --- /dev/null +++ b/www/j3d1_4/graph-change-listener.html @@ -0,0 +1,40 @@ + + + + + Java 3D 1.4: Graph Change Listener + + +

Java 3DTM 1.4: +Graph Change Listener

+

This page describes a proposed Java 3D 1.4 feature to add a +notification mechansim for scene graph structure +changes: additions, deletions, and +moves of branch graphs to/from a live scene graph. We propose +adding add/removeGraphChangeListener(GraphChangeListener) +methods to VirtualUniverse and a new GraphChangeListener +interface with graphAdded, graphRemoved, +and graphMoved methods that get called when any branch +graph is added (attached), +removed (detached), or moved, respectively. +

+

The proposed API is:

+ +

More info here... +

+

Page last updated — +$Date$ +

+ + diff --git a/www/j3d1_4/lightweight-canvas3d.html b/www/j3d1_4/lightweight-canvas3d.html new file mode 100644 index 0000000..1c6479f --- /dev/null +++ b/www/j3d1_4/lightweight-canvas3d.html @@ -0,0 +1,27 @@ + + + + + Java 3D 1.4: Lightweight Canvas3D + + +

Java 3DTM 1.4: +Lightweight Canvas3D

+

A possible feature under consideration for Java 3D 1.4 is a +lightweight JCanvas3D that is similar to +JGLCanvas in JOGL. Adding this into core may be beyond the +scope of 1.4. It probably can be done as a utility, although it +may require some core changes.

+

+

Note: this feature will not +happen +without an someone from the community volunteering +to drive it.

+

More info here... +

+

Page last updated — +$Date$ +

+ + diff --git a/www/j3d1_4/picking.html b/www/j3d1_4/picking.html new file mode 100644 index 0000000..cea288d --- /dev/null +++ b/www/j3d1_4/picking.html @@ -0,0 +1,31 @@ + + + + + Java 3D 1.4: Picking Changes + + +

Java 3DTM 1.4: +Picking Changes

+

This page describes proposed picking changes in Java 3D 1.4... +

+

The proposed API is:

+ +

More info here... +

+

Page last updated — +$Date$ +

+ + diff --git a/www/j3d1_4/proposed-changes.html b/www/j3d1_4/proposed-changes.html index 58133fb..d7b088b 100644 --- a/www/j3d1_4/proposed-changes.html +++ b/www/j3d1_4/proposed-changes.html @@ -24,42 +24,41 @@ Java 3D version 1.4 is also available.

This list of high priority features will almost certainly make it into the 1.4 API.

-

1. Programmable shaders

-

The addition of shaders to the Java 3D API is the primary focus -for the 1.4. For more information see the Programmable -Shaders in Java 3D 1.4 page. -

-

2. Scene graph structure change listeners
-

-

We propose to add a notification mechansim for scene graph structure -changes: additions, deletions, and -moves of branch graphs to/from a live scene graph. We propose -adding add/removeGraphChangeListener(GraphChangeListener) -methods to VirtualUniverse and a new GraphChangeListener -interface with graphAdded, graphRemoved, -and graphMoved methods that get called when any branch -graph is added (attached), -removed (detached), or moved, respectively.
-

-

3. Miscellaneous features

-

This is a list of miscellaneous features that we propose to add to -the API. +

1. Proposed API to be added

+

This is a list of features that we propose to add to +the API.

-

4. List of features to deprecate

-

This is a list of miscellaneous features that we propose to +

2. Proposed API to be deprecated

+

This is a list of features that we propose to deprecate in the API.

@@ -68,6 +67,10 @@ the API.
acceptance)
  • Sensor prediction (has never been implemented)
  • +
  • PickPoint (not fully implemented, cannot be used for +geometry-based picking; use PickBounds with +a +BoundingSphere that has a small radius)
  • Note that none of these features will actually be removed. It instead @@ -83,39 +86,13 @@ future major release (e.g., a 2.0 release).
    possible inclusion into the 1.4 API.

    -

    1. Render to texture
    -

    -

    DESCRIPTION -FOR POSSIBLE RENDER-TO-TEXTURE SUPPORT GOES HERE... -

    -

    2. Stencil buffer support
    -

    -

    DESCRIPTION -FOR POSSIBLE STENCIL SUPPORT GOES HERE; NOTE THAT THIS WILL NOT INCLUDE -ANY MULTIPASS EFFECTS for 1.4... -

    -

    3. Move picking into core

    -

    We should consider moving some of the picking utilities (e.g., -PickCanvas and PickResult) -into the core API. Before doing this, we would need to scope out the -effort involved, and assess the -potential benefit.
    -

    -

    4. Lightweight Canvas3D (e.g., JCanvas3D)

    -

    We should consider adding a lightweight JCanvas3D that is similar to -JGLCanvas in JOGL. Adding this into core may be beyond the -scope of 1.4. Probably can be done as a utility, although it -may require some core changes. -Note: this feature will not happen -without an someone from the community volunteering -to drive it. -

    -

    5. Miscellaneous features

    -

    This is a list of miscellaneous features that are being considered +

    1. Possible API to be added

    +

    This is a list of features that are being considered for addition to the API.

    -

    6. List of features to deprecate

    -

    This is a list of miscellaneous features that are being considered +

    2. Possible API to be deprecated

    +

    This is a list of features that are being considered for deprecation in the API.

      -
    • SharedGroup (many bugs, very difficult to -implement -efficiently)
    • +
    • Morph (expensive, picking doesn't work, +can be done +in a utility)

    These are in addition to the API being proposed for deprecation in section I.

    +
    +


    +

    +


    +

    +


    +

    +


    +

    III. Future Features

    Here is an unprioritized list of possible features under consideration for a future (e.g., 1.5/2.0) diff --git a/www/j3d1_4/render-texture.html b/www/j3d1_4/render-texture.html new file mode 100644 index 0000000..6561d73 --- /dev/null +++ b/www/j3d1_4/render-texture.html @@ -0,0 +1,32 @@ + + + + + Java 3D 1.4: Render To Texture + + +

    Java 3DTM 1.4: +Render To Texture

    +

    This page describes the possible render-to-texture feature in +Java 3D 1.4... +

    +

    The proposed API is:

    +
      +
    • New classes
    • +
        +
        public class XXXXX extends YYYYY
        method: setXxxxx()
        +
      +
    • New methods in existing classes:
      +
    • +
        +
        XXXXX
        method: setXxxxx()
        +
      +
    +

    More info here... +

    +

    Page last updated — +$Date$ +

    + + diff --git a/www/j3d1_4/shaders.html b/www/j3d1_4/shaders.html index fadfde0..380b742 100644 --- a/www/j3d1_4/shaders.html +++ b/www/j3d1_4/shaders.html @@ -2,187 +2,117 @@ - Java 3D 1.4 Shaders + http-equiv="content-type"> + Java 3D 1.4: Programmable Shaders -

    Shaders in Java 3DTM 1.4

    -

    Introduction and pointer to discussion forum

    - -

    Here is the latest rough first draft of what we are thinking in -terms of programmable shader support in Java 3DTM for 1.4. We plan to formalize the 1.4 API -specification under the auspices of the Java Community Process -(JCP). However, we very much want to involve the larger community in -API discussions for programmable shaders, so please join in the -discussion. +

    Java 3DTM 1.4: +Programmable Shaders

    +

    This is the latest draft of the proposed Java 3DTM +1.4 API changes for programmable shaders.

    -

    We have created a thread on the Java 3D discussion forum for discussing Java 3D Programmable Shaders. Feel free to + href="http://www.javadesktop.org/forums/thread.jspa?threadID=5056" + target="_blank">Java 3D Programmable Shaders. Feel free to post your comments on our ideas, or post some ideas of your own.

    -

    Class Hierarchy for Shader Objects

    The proposed class hierarchy for programmable shaders in Java 3D is:

      -
    • Abstract shader base classes:
    • -
        -
        public abstract class ShaderProgram extends NodeComponent
        -public abstract class Shader extends NodeComponent
        -
        -
      -
    • Concrete GLSL shader classes:
    • -
        -
        public class GLSLShaderProgram extends ShaderProgram
        -    method: {add/remove/get}Shader(GLSLShader) // set of shader objs
        -    method: {add/remove}ErrorListener(GLSLErrorListener)
        -    method: validate(Canvas3D) ???
        -
        -public abstract class GLSLShader extends Shader
        -    public class GLSLVertexShader extends GLSLShader
        -	method: set/getShaderSource(String)
        -	method: validate(Canvas3D) ???
        -    public class GLSLFragmentShader extends GLSLShader
        -	method: set/getShaderSource(String)
        -	method: validate(Canvas3D) ???
        -
        -
      -
    • Concrete Cg shader classes:
    • -
        -
        public class CgShaderProgram extends ShaderProgram
        -    method: {set/get}VertexShader(CgVertexShader)
        -    method: {set/get}FragmentShader(CgFramentShader)
        -    method: {add/remove}ErrorListener(CgErrorListener)
        -    method: validate(Canvas3D) ???
        -
        -public abstract class CgShader extends Shader
        -    public class CgVertexShader extends CgShader
        -	method: set/getShaderSource(String)
        -	method: validate(Canvas3D) ???
        -    public class CgFragmentShader extends CgShader
        -	method: set/getShaderSource(String)
        -	method: validate(Canvas3D) ???
        -
        -
      -
    • New ShaderAppearance class:
    • -
        -
        public class ShaderAppearance extends Appearance
        -    method: set/getShaderProgram(ShaderProgram)
        -    method: set/getShaderAttributeSet(ShaderAttributeSet)
        -
        +
      • Abstract shader base classes:
      • +
          +
          public abstract class ShaderProgram extends NodeComponent
          public abstract class Shader extends NodeComponent
          +
        +
      • Concrete GLSL shader classes:
      • +
          +
          public class GLSLShaderProgram extends ShaderProgram
          method: {add/remove/get}Shader(GLSLShader) // set of shader objs
          method: {add/remove}ErrorListener(GLSLErrorListener)
          method: validate(Canvas3D) ???

          public abstract class GLSLShader extends Shader
          public class GLSLVertexShader extends GLSLShader
          method: set/getShaderSource(String)
          method: validate(Canvas3D) ???
          public class GLSLFragmentShader extends GLSLShader
          method: set/getShaderSource(String)
          method: validate(Canvas3D) ???
          +
        +
      • Concrete Cg shader classes:
      • +
          +
          public class CgShaderProgram extends ShaderProgram
          method: {set/get}VertexShader(CgVertexShader)
          method: {set/get}FragmentShader(CgFramentShader)
          method: {add/remove}ErrorListener(CgErrorListener)
          method: validate(Canvas3D) ???

          public abstract class CgShader extends Shader
          public class CgVertexShader extends CgShader
          method: set/getShaderSource(String)
          method: validate(Canvas3D) ???
          public class CgFragmentShader extends CgShader
          method: set/getShaderSource(String)
          method: validate(Canvas3D) ???
          +
        +
      • New ShaderAppearance class:
      • +
          +
          public class ShaderAppearance extends Appearance
          method: set/getShaderProgram(ShaderProgram)
          method: set/getShaderAttributeSet(ShaderAttributeSet)
          +
        +
      • New ShaderAttributeSet class:
      • +
          +
          public class ShaderAttributeSet extends NodeComponent
          method: put/get(ShaderAttribute)
          ...
          +
      - -
    • New ShaderAttributeSet class:
    • -
        -
        public class ShaderAttributeSet extends NodeComponent
        -    method: put/get(ShaderAttribute)
        -    ...
        -
        -
      - -
    -

    Click on the following link for a current look at the javadoc-generated + href="http://javadesktop.org/java3d/javadoc/1.4.0-latest/index.html">javadoc-generated API definitions for the proposed 1.4 API.

    -

    Example Usage

    This is an example code excerpt showing how one might use the new programmable shader API in a Java 3D program.

      -
      String vertexShaderFile = "my-vertex-shader-file-name";
      -String fragmentShaderFile = "my-fragment-shader-file-name";
      -String vertexShaderSource;
      -String fragmentShaderSource;
      -
      -// Read GLSL vertex and fragment shader source code from text files
      -vertexShaderSource = StringIO.readFully(vertexShaderFile);
      -fragmentShaderSource = StringIO.readFully(fragmentShaderSource);
      -
      -// Create GLSL vertex and fragment shader objects using the given source code
      -GLSLVertexShader vertexShader = new GLSLVertexShader(vertexShaderSource);
      -GLSLFragmentShader fragmentShader = new GLSLFragmentShader(fragmentShaderSource);
      -
      -// Create the GLSL shader program object and attach the vertex and
      -// fragment shader objects; add an error listener
      -GLSLShaderProgram shaderProgram = new GLSLShaderProgram();
      -shaderProgram.setVertexShader(vertexShader);
      -shaderProgram.setFragmentShader(fragmentShader);
      -shaderProgram.addErrorListener(myGLSLErrorListener);
      -
      -// Use GLSL shader program object in appearance
      -shaderAppearance.setShaderProgram(shaderProgram);
      -
      +
      String vertexShaderFile = "my-vertex-shader-file-name";
      String fragmentShaderFile = "my-fragment-shader-file-name";
      String vertexShaderSource;
      String fragmentShaderSource;

      // Read GLSL vertex and fragment shader source code from text files
      vertexShaderSource = StringIO.readFully(vertexShaderFile);
      fragmentShaderSource = StringIO.readFully(fragmentShaderSource);

      // Create GLSL vertex and fragment shader objects using the given source code
      GLSLVertexShader vertexShader = new GLSLVertexShader(vertexShaderSource);
      GLSLFragmentShader fragmentShader = new GLSLFragmentShader(fragmentShaderSource);

      // Create the GLSL shader program object and attach the vertex and
      // fragment shader objects; add an error listener
      GLSLShaderProgram shaderProgram = new GLSLShaderProgram();
      shaderProgram.setVertexShader(vertexShader);
      shaderProgram.setFragmentShader(fragmentShader);
      shaderProgram.addErrorListener(myGLSLErrorListener);

      // Use GLSL shader program object in appearance
      shaderAppearance.setShaderProgram(shaderProgram);

    Shader Parameters

    -

    Programmable shaders define two types of parameters: uniform and varying. As the names imply, uniform parameters are constant (within a primitive), while varying parameters can vary on per-vertex or per-fragment basis.

    -
      - -
    1. Uniform parameters (attributes) are those parameters whose +
    2. Uniform parameters (attributes) are those parameters whose value is constant during the rendering of a primitive. Their values may change from primitive to primitive, but are constant for each vertex (for vertex shaders) or fragment (for fragment shaders) of a single primitive. Examples of uniform parameters include a transformation matrix, a texture map, lights, lookup tables, etc.
      -
      - +
      We have created a new ShaderAttributeSet for allowing applications to specify uniform shader attributes. There are two ways in which values can be specified for uniform attributes: explicitly, by providing a -value; and implicitly, by defining a binding between a Java 3D system +value; and implicitly, by defining a binding between a Java 3D system attribute and a uniform attribute. This functionality is provided by two subclasses of ShaderAttribute: ShaderAttributeObject, which is used to specify explicitly defined attributes; and ShaderAttributeBinding, which is used to specify implicitly defined, automatically tracked attributes. See the javadoc for the new ShaderAttributeSet + href="http://javadesktop.org/java3d/javadoc/1.4.0-latest/javax/media/j3d/ShaderAttributeSet.html">ShaderAttributeSet and ShaderAttribute + href="http://javadesktop.org/java3d/javadoc/1.4.0-latest/javax/media/j3d/ShaderAttribute.html">ShaderAttribute classes for more details.
      -
      - -Issues
      - -
        - -
      • Should j3dAttrName be specified as a type-safe enum or object +
        + Issues
        +
          +
        • Should j3dAttrName be specified as a type-safe enum or object instead of a String? -
          • No; we will use a String
          • -
        • - -
        • How do we handle passing arrays to the shader, especially for +
            +
          • No; we will use a String
          • +
            +
          +
        • +
        • How do we handle passing arrays to the shader, especially for system parameters such as lights? One possibility is: - -
            - "var" - scalar variable "var"
            - "arr[0]" - array element 0 of "arr"
            - "arr[1,3]" - subarray composed of elements 1 through 3 of "arr"
            - "arr[]" - entire array "arr"
            -
          +
            +"var" - scalar variable "var"
            +"arr[0]" - array element 0 of "arr"
            +"arr[1,3]" - subarray composed of elements 1 through 3 of "arr"
            +"arr[]" - entire array "arr"
            +
          Alternatively, an object with a string or type-safe enum, a state (scalar, array element, subarray, or entire array), and indices (as needed). -
          • TBD, but since they will be String objects, we will probably -do something like the first suggestion
          • -
        • -
        - -
        -Automatic variables
        - +
          +
        • TBD, but since they will be String +objects, we will probably +do something like the first suggestion
        • +
          +
        +
      • +
      +
      + Automatic variables
      Depending on the shading language (and profile) being used, several Java 3D state attributes are automatically made available to the shader program as pre-defined uniform attributes. The application @@ -190,65 +120,65 @@ doesn't need to do anything to pass these attributes in to the shader program. The implementation of each shader language (e.g., Cg, GLSL) defines its own mapping from Java 3D attribute to uniform variable name.
      -
      - +
      A partial list of Java 3D attributes that are mapped to shader -attributes follows: -
    3. -
      - - - - + + + + + + + + + + + + + + + + + +
      Java 3D +attributes follows: +
      + + + + - + - + - - - - - - - - - - - - - - - - - -
      Java 3D Attribute
      -
      Cg + Cg shader variable
      -
      GLSL + GLSL shader variable
      -
      ModelViewProjection
      -
      glstate.matrix.mvp
      -
      gl_ModelViewProjectionMatrix
      -
      Light[n] pos
      -
      glstate.light[n].position gl_LightSource[n].position
      ...
      -
      ...
      -
      ...
      -
      -
      -
    4. Varying parameters are those parameters that are specified +
    5. ModelViewProjection
      +
      glstate.matrix.mvp
      +
      gl_ModelViewProjectionMatrix
      +
      Light[n] pos
      +
      glstate.light[n].position + gl_LightSource[n].position +
      ...
      +
      ...
      +
      ...
      +
      +
      +
    6. Varying parameters are those parameters that are specified as per-vertex attributes. They are are interpolated across a primitive similarly to colors and texture coordinates in the fixed function pipeline.
      -
      +
      We need additional API to allow applications to pass in per-vertex -varying parameters...
      TODO: Finish this...
      -
    7. +varying parameters...
      +TODO: Finish this...
      +

    TODO: more info here.

    -

    Page last updated — +

    Page last updated — $Date$ - -

    +

    diff --git a/www/j3d1_4/stencil.html b/www/j3d1_4/stencil.html new file mode 100644 index 0000000..92757af --- /dev/null +++ b/www/j3d1_4/stencil.html @@ -0,0 +1,35 @@ + + + + + Java 3D 1.4: Stencil Buffer + + +

    Java 3DTM 1.4: +Stencil Buffer

    +

    This page describes the proposed API changes for stencil buffer +support in Java 3D +1.4... +

    +

    NOTE: THIS WILL NOT INCLUDE ANY MULTIPASS SUPPORT in 1.4 +

    +

    The proposed API is:

    +
      +
    • New classes
    • +
        +
        public class XXXXX extends YYYYY
        method: setXxxxx()
        +
      +
    • New methods in existing classes:
      +
    • +
        +
        XXXXX
        method: setXxxxx()
        +
      +
    +

    More info here... +

    +

    Page last updated — +$Date$ +

    + + -- cgit v1.2.3