|
@@ -59,7 +59,7 @@ import java.util.Map;
|
|
*
|
|
*
|
|
* Also it allows to load the ShaderNodes from a j3md file and build the
|
|
* Also it allows to load the ShaderNodes from a j3md file and build the
|
|
* ShaderNodes list of each technique and the ShaderGenerationInfo needed to
|
|
* ShaderNodes list of each technique and the ShaderGenerationInfo needed to
|
|
- * generate the sahders
|
|
|
|
|
|
+ * generate shaders
|
|
*
|
|
*
|
|
* @author Nehon
|
|
* @author Nehon
|
|
*/
|
|
*/
|
|
@@ -209,9 +209,9 @@ public class ShaderNodeLoaderDelegate {
|
|
* ShaderNodesDefinition This method is used by the j3m loader.
|
|
* ShaderNodesDefinition This method is used by the j3m loader.
|
|
*
|
|
*
|
|
* When loaded in a material, the definitions are not stored as a list, but
|
|
* When loaded in a material, the definitions are not stored as a list, but
|
|
- * they are stores in Shadernodes based onthis definition.
|
|
|
|
|
|
+ * they are stores in Shadernodes based on this definition.
|
|
*
|
|
*
|
|
- * The map is here to map the defintion to the nodes, and ovoid reloading
|
|
|
|
|
|
+ * The map is here to map the definition to the nodes, and ovoid reloading
|
|
* already loaded definitions
|
|
* already loaded definitions
|
|
*
|
|
*
|
|
* @param statements the list of statements to parse
|
|
* @param statements the list of statements to parse
|
|
@@ -222,7 +222,7 @@ public class ShaderNodeLoaderDelegate {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * effectiveliy reads the ShaderNodesDefinitions block
|
|
|
|
|
|
+ * effectively reads the ShaderNodesDefinitions block
|
|
*
|
|
*
|
|
* @param statements the list of statements to parse
|
|
* @param statements the list of statements to parse
|
|
* @param key the ShaderNodeDefinitionKey
|
|
* @param key the ShaderNodeDefinitionKey
|
|
@@ -273,7 +273,7 @@ public class ShaderNodeLoaderDelegate {
|
|
* reads a variable declaration statement <glslType> <varName>
|
|
* reads a variable declaration statement <glslType> <varName>
|
|
*
|
|
*
|
|
* @param statement the statement to parse
|
|
* @param statement the statement to parse
|
|
- * @return a ShaderNodeVariable axtracted from the statement
|
|
|
|
|
|
+ * @return a ShaderNodeVariable extracted from the statement
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
protected ShaderNodeVariable readVariable(Statement statement) throws IOException {
|
|
protected ShaderNodeVariable readVariable(Statement statement) throws IOException {
|
|
@@ -448,7 +448,7 @@ public class ShaderNodeLoaderDelegate {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * searcha variable in the given list and updates its type and namespace
|
|
|
|
|
|
+ * search a variable in the given list and updates its type and namespace
|
|
*
|
|
*
|
|
* @param var the variable to update
|
|
* @param var the variable to update
|
|
* @param list the variables list
|
|
* @param list the variables list
|
|
@@ -531,7 +531,7 @@ public class ShaderNodeLoaderDelegate {
|
|
|
|
|
|
/**
|
|
/**
|
|
* updates the right variable of the given mapping from a UniformBinding (a
|
|
* updates the right variable of the given mapping from a UniformBinding (a
|
|
- * WorldParam) it checks if the unifrom hasn't already been loaded, add it
|
|
|
|
|
|
+ * WorldParam) it checks if the uniform hasn't already been loaded, add it
|
|
* to the maps if not.
|
|
* to the maps if not.
|
|
*
|
|
*
|
|
* @param param the WorldParam UniformBinding
|
|
* @param param the WorldParam UniformBinding
|
|
@@ -559,7 +559,7 @@ public class ShaderNodeLoaderDelegate {
|
|
|
|
|
|
/**
|
|
/**
|
|
* updates the right variable of the given mapping from a MatParam (a
|
|
* updates the right variable of the given mapping from a MatParam (a
|
|
- * WorldParam) it checks if the unifrom hasn't already been loaded, add it
|
|
|
|
|
|
+ * WorldParam) it checks if the uniform hasn't already been loaded, add it
|
|
* to the maps if not.
|
|
* to the maps if not.
|
|
*
|
|
*
|
|
* @param param the MatParam
|
|
* @param param the MatParam
|
|
@@ -622,7 +622,7 @@ public class ShaderNodeLoaderDelegate {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Adds a define to the techniquedef
|
|
|
|
|
|
+ * Adds a define to the technique def
|
|
*
|
|
*
|
|
* @param paramName
|
|
* @param paramName
|
|
*/
|
|
*/
|
|
@@ -767,7 +767,7 @@ public class ShaderNodeLoaderDelegate {
|
|
/**
|
|
/**
|
|
* reads an output mapping
|
|
* reads an output mapping
|
|
*
|
|
*
|
|
- * @param statement1 the staement being read
|
|
|
|
|
|
+ * @param statement1 the statement being read
|
|
* @return the mapping
|
|
* @return the mapping
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
@@ -803,7 +803,7 @@ public class ShaderNodeLoaderDelegate {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Reads alist of ShaderNodes
|
|
|
|
|
|
+ * Reads a list of ShaderNodes
|
|
*
|
|
*
|
|
* @param statements the list of statements to read
|
|
* @param statements the list of statements to read
|
|
* @throws IOException
|
|
* @throws IOException
|
|
@@ -843,7 +843,7 @@ public class ShaderNodeLoaderDelegate {
|
|
* retrieve the leftType corresponding sampler type from the rightType
|
|
* retrieve the leftType corresponding sampler type from the rightType
|
|
*
|
|
*
|
|
* @param leftType the left samplerType
|
|
* @param leftType the left samplerType
|
|
- * @param rightType the right sampler type (can be multiple types sparated
|
|
|
|
|
|
+ * @param rightType the right sampler type (can be multiple types separated
|
|
* by "|"
|
|
* by "|"
|
|
* @return the type or null if not found
|
|
* @return the type or null if not found
|
|
*/
|
|
*/
|
|
@@ -885,7 +885,7 @@ public class ShaderNodeLoaderDelegate {
|
|
/**
|
|
/**
|
|
* store an attribute
|
|
* store an attribute
|
|
*
|
|
*
|
|
- * @param var the variable ot store
|
|
|
|
|
|
+ * @param var the variable to store
|
|
*/
|
|
*/
|
|
public void storeAttribute(ShaderNodeVariable var) {
|
|
public void storeAttribute(ShaderNodeVariable var) {
|
|
storeVariable(var, techniqueDef.getShaderGenerationInfo().getAttributes());
|
|
storeVariable(var, techniqueDef.getShaderGenerationInfo().getAttributes());
|
|
@@ -894,7 +894,7 @@ public class ShaderNodeLoaderDelegate {
|
|
/**
|
|
/**
|
|
* store a vertex uniform
|
|
* store a vertex uniform
|
|
*
|
|
*
|
|
- * @param var the variable ot store
|
|
|
|
|
|
+ * @param var the variable to store
|
|
*/
|
|
*/
|
|
public void storeVertexUniform(ShaderNodeVariable var) {
|
|
public void storeVertexUniform(ShaderNodeVariable var) {
|
|
storeVariable(var, techniqueDef.getShaderGenerationInfo().getVertexUniforms());
|
|
storeVariable(var, techniqueDef.getShaderGenerationInfo().getVertexUniforms());
|
|
@@ -904,7 +904,7 @@ public class ShaderNodeLoaderDelegate {
|
|
/**
|
|
/**
|
|
* store a fragment uniform
|
|
* store a fragment uniform
|
|
*
|
|
*
|
|
- * @param var the variable ot store
|
|
|
|
|
|
+ * @param var the variable to store
|
|
*/
|
|
*/
|
|
public void storeFragmentUniform(ShaderNodeVariable var) {
|
|
public void storeFragmentUniform(ShaderNodeVariable var) {
|
|
storeVariable(var, techniqueDef.getShaderGenerationInfo().getFragmentUniforms());
|
|
storeVariable(var, techniqueDef.getShaderGenerationInfo().getFragmentUniforms());
|
|
@@ -921,7 +921,7 @@ public class ShaderNodeLoaderDelegate {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * find the definiton from this statement (loads it if necessary)
|
|
|
|
|
|
+ * find the definition from this statement (loads it if necessary)
|
|
*
|
|
*
|
|
* @param statement the statement being read
|
|
* @param statement the statement being read
|
|
* @return the definition
|
|
* @return the definition
|
|
@@ -1049,7 +1049,7 @@ public class ShaderNodeLoaderDelegate {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * check the types of a mapping, left type must match right type tkae the
|
|
|
|
|
|
+ * check the types of a mapping, left type must match right type take the
|
|
* swizzle into account
|
|
* swizzle into account
|
|
*
|
|
*
|
|
* @param mapping the mapping
|
|
* @param mapping the mapping
|