From e4a3b1190ac1ccb5d20c9127ad8ef710a83c0b66 Mon Sep 17 00:00:00 2001 From: Kevin Rushforth Date: Fri, 4 Mar 2005 20:46:33 +0000 Subject: Updated web pages. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@144 ba19aa83-45c5-6ac9-afd3-db810772062c --- www/j3d1_4/shaders.html | 82 ++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 46 deletions(-) (limited to 'www/j3d1_4/shaders.html') diff --git a/www/j3d1_4/shaders.html b/www/j3d1_4/shaders.html index cf6c91e..fadfde0 100644 --- a/www/j3d1_4/shaders.html +++ b/www/j3d1_4/shaders.html @@ -72,30 +72,21 @@ public abstract class CgShader extends Shader -
  • New SystemAttributes class:
  • +
  • New ShaderAttributeSet class:
  • -

    Click on the following link for a preliminary look at the Click on the following link for a current look at the javadoc-generated API definitions for the proposed 1.4 API.

    @@ -111,8 +102,8 @@ String vertexShaderSource; String fragmentShaderSource; // Read GLSL vertex and fragment shader source code from text files -vertexShaderSource = TextFileUtils.readFully(vertexShaderFile); -fragmentShaderSource = TextFileUtils.readFully(fragmentShaderSource); +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); @@ -131,12 +122,6 @@ shaderAppearance.setShaderProgram(shaderProgram);

    Shader Parameters

    -

    NOTE: This section is under construction. For the most up to date -API definition, please see the javadoc for the new ShaderAttributes -class. -

    -

    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 @@ -152,29 +137,31 @@ 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 ShaderAttributes object with following new attributes: - -

    - -See the javadoc for the new ShaderAttributes -class for more details. +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 +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 +and ShaderAttribute +classes for more details.
    +
    Issues
    - Alternatively, an object with a string or type-safe enum, a state (scalar, array element, subarray, or entire array), and indices (as needed). - +
    Automatic variables
    -Several Java 3D state attributes are automatically available -to the shader program as pre-defined uniform parameters. The -application doesn't need to do anything to pass these parameters 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.
    +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 +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: -- cgit v1.2.3