/** * returns the shaderpath index according to the version of the generator. * This allow to select the higher version of the shader that the generator * can handle * * @param shaderNode the shaderNode being processed * @param type the shaderType * @return the index of the shader path in ShaderNodeDefinition shadersPath * list * @throws NumberFormatException */ protected int findShaderIndexFromVersion(ShaderNode shaderNode, ShaderType type) throws NumberFormatException { int index = 0; List<String> lang = shaderNode.getDefinition().getShadersLanguage(); int genVersion = Integer.parseInt(getLanguageAndVersion(type).substring(4)); int curVersion = 0; for (int i = 0; i < lang.size(); i++) { int version = Integer.parseInt(lang.get(i).substring(4)); if (version > curVersion && version <= genVersion) { curVersion = version; index = i; } } return index; } }
} else if (line.startsWith("Shader ")) { readShaderStatement(statement); shaderNodeDefinition.getShadersLanguage().add(shaderLanguage); shaderNodeDefinition.getShadersPath().add(shaderName); } else if (line.startsWith("Documentation")) {
/** * returns the shaderpath index according to the version of the generator. * This allow to select the higher version of the shader that the generator * can handle * * @param shaderNode the shaderNode being processed * @param type the shaderType * @return the index of the shader path in ShaderNodeDefinition shadersPath * list * @throws NumberFormatException */ protected int findShaderIndexFromVersion(ShaderNode shaderNode, ShaderType type) throws NumberFormatException { int index = 0; List<String> lang = shaderNode.getDefinition().getShadersLanguage(); int genVersion = Integer.parseInt(getLanguageAndVersion(type).substring(4)); int curVersion = 0; for (int i = 0; i < lang.size(); i++) { int version = Integer.parseInt(lang.get(i).substring(4)); if (version > curVersion && version <= genVersion) { curVersion = version; index = i; } } return index; } }
} else if (line.startsWith("Shader ")) { readShaderStatement(statement); shaderNodeDefinition.getShadersLanguage().add(shaderLanguage); shaderNodeDefinition.getShadersPath().add(shaderName); } else if (line.startsWith("Documentation")) {