diff --git a/sdk/jme3-glsl-support/build.xml b/sdk/jme3-glsl-support/build.xml deleted file mode 100644 index 6f9e53ce8..000000000 --- a/sdk/jme3-glsl-support/build.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - Builds, tests, and runs the project net.java.nboglpack.glsleditor. - - - diff --git a/sdk/jme3-glsl-support/license.txt b/sdk/jme3-glsl-support/license.txt deleted file mode 100644 index 5f7c82192..000000000 --- a/sdk/jme3-glsl-support/license.txt +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2007, Michael Bien, Mathias Henze - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the organization nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sdk/jme3-glsl-support/manifest.mf b/sdk/jme3-glsl-support/manifest.mf deleted file mode 100644 index b4da2c289..000000000 --- a/sdk/jme3-glsl-support/manifest.mf +++ /dev/null @@ -1,14 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module: net.java.nboglpack.glsleditor -OpenIDE-Module-Implementation-Version: 0 -OpenIDE-Module-Layer: net/java/nboglpack/glsleditor/layer.xml -OpenIDE-Module-Localizing-Bundle: net/java/nboglpack/glsleditor/Bundle.properties - -Name: net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataLoader.class -OpenIDE-Module-Class: Loader - -Name: net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataLoader.class -OpenIDE-Module-Class: Loader - -Name: net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataLoader.class -OpenIDE-Module-Class: Loader diff --git a/sdk/jme3-glsl-support/nbproject/build-impl.xml b/sdk/jme3-glsl-support/nbproject/build-impl.xml deleted file mode 100644 index 4950dbe5c..000000000 --- a/sdk/jme3-glsl-support/nbproject/build-impl.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - You must set 'suite.dir' to point to your containing module suite - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdk/jme3-glsl-support/nbproject/genfiles.properties b/sdk/jme3-glsl-support/nbproject/genfiles.properties deleted file mode 100644 index d6f2cdcd3..000000000 --- a/sdk/jme3-glsl-support/nbproject/genfiles.properties +++ /dev/null @@ -1,8 +0,0 @@ -build.xml.data.CRC32=a85cd232 -build.xml.script.CRC32=bcb3cbef -build.xml.stylesheet.CRC32=79c3b980 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=7f14124d -nbproject/build-impl.xml.script.CRC32=d103b190 -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.67.1 diff --git a/sdk/jme3-glsl-support/nbproject/project.properties b/sdk/jme3-glsl-support/nbproject/project.properties deleted file mode 100644 index ffd095cc8..000000000 --- a/sdk/jme3-glsl-support/nbproject/project.properties +++ /dev/null @@ -1,6 +0,0 @@ -javac.compilerargs=-Xlint -Xlint:-serial -javac.source=1.5 -license.file=license.txt -nbm.homepage=http://kenai.com/projects/netbeans-opengl-pack -nbm.module.author=Mathias Henze, Michael Bien, Dany Rioux -spec.version.base=3.1.0 diff --git a/sdk/jme3-glsl-support/nbproject/project.xml b/sdk/jme3-glsl-support/nbproject/project.xml deleted file mode 100644 index c2dbbe825..000000000 --- a/sdk/jme3-glsl-support/nbproject/project.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - org.netbeans.modules.apisupport.project - - - net.java.nboglpack.glsleditor - - - - org.netbeans.modules.editor.completion - - - - 1 - 1.40.1.2 - - - - org.netbeans.modules.editor.lib - - - - 3 - 3.49.2.22.43 - - - - org.netbeans.modules.languages - - - - 0-1 - 1.117.1.2 - - - - org.netbeans.modules.lexer - - - - 2 - 1.59.1.1 - - - - org.openide.filesystems - - - - 8.12.1 - - - - org.openide.loaders - - - - 7.57.2 - - - - org.openide.nodes - - - - 7.39.1 - - - - org.openide.text - - - - 6.62.2 - - - - org.openide.util - - - - 8.39.1 - - - - org.openide.util.lookup - - - - 8.25.1 - - - - org.openide.windows - - - - 6.71.1 - - - - - net.java.nboglpack.glsleditor - net.java.nboglpack.glsleditor.dataobject - net.java.nboglpack.glsleditor.glsl - net.java.nboglpack.glsleditor.lexer - net.java.nboglpack.glsleditor.vocabulary - - - - diff --git a/sdk/jme3-glsl-support/nbproject/suite.properties b/sdk/jme3-glsl-support/nbproject/suite.properties deleted file mode 100644 index 29d7cc9bd..000000000 --- a/sdk/jme3-glsl-support/nbproject/suite.properties +++ /dev/null @@ -1 +0,0 @@ -suite.dir=${basedir}/.. diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/Bundle.properties b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/Bundle.properties deleted file mode 100644 index c442c39c6..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/Bundle.properties +++ /dev/null @@ -1,28 +0,0 @@ -OpenIDE-Module-Display-Category=jMonkeyEngine -OpenIDE-Module-Long-Description=\ - Provides syntax highlighting and code completion with documentation for jME3 GLSL shader files. -OpenIDE-Module-Name=GLSL Editor -OpenIDE-Module-Short-Description=Editor for jME3 shader files - -text/x-glsl-fragment-shader=GLSL Fragment Shader -text/x-glsl-vertex-shader=GLSL Vertex Shader -text/x-glsl-geometry-shader=GLSL Geometry Shader - -#Layer.xml entries for fonts & colors in Options window: -NetBeans=NetBeans -glsl-keyword=Keyword -glsl-name=Name -glsl-brace=Brace -glsl-value=Value -glsl-curly-brace=Curly brace -glsl-string-value=String value -glsl-comment=Comment -glsl-ml-comment=Multiline comment -glsl-separator=Separator -glsl-function=Function -glsl-whitespace=Whitespace -glsl-end-of-line=EOL -glsl-build-in-var=Build in variable -glsl-build-in-func=Build in function -glsl-preprocessor=Preprocessor directive - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/GlslCompletionProvider.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/GlslCompletionProvider.java deleted file mode 100644 index 17da20435..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/GlslCompletionProvider.java +++ /dev/null @@ -1,322 +0,0 @@ -package net.java.nboglpack.glsleditor; - -import java.util.Map.Entry; -import java.util.Set; -import org.netbeans.api.editor.completion.Completion; -import org.openide.ErrorManager; -import org.netbeans.editor.BaseDocument; -import org.netbeans.spi.editor.completion.CompletionDocumentation; -import org.netbeans.spi.editor.completion.CompletionItem; -import org.netbeans.spi.editor.completion.CompletionProvider; -import org.netbeans.spi.editor.completion.CompletionResultSet; -import org.netbeans.spi.editor.completion.CompletionTask; -import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; -import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; -import javax.swing.Action; -import javax.swing.text.BadLocationException; -import javax.swing.text.Document; -import javax.swing.text.Element; -import javax.swing.text.JTextComponent; -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.event.KeyEvent; -import java.net.URL; -import java.util.Iterator; -import net.java.nboglpack.glsleditor.dataobject.GlslFragmentShaderDataLoader; -import net.java.nboglpack.glsleditor.dataobject.GlslGeometryShaderDataLoader; -import net.java.nboglpack.glsleditor.dataobject.GlslVertexShaderDataLoader; -import net.java.nboglpack.glsleditor.glsl.Glsl; -import net.java.nboglpack.glsleditor.vocabulary.GLSLElementDescriptor; -import org.netbeans.spi.editor.completion.support.CompletionUtilities; - -/** - * Completion provider for the OpenGL Shading Language editor. - * - * @author Mathias Henze - * @author Michael Bien - */ -public class GlslCompletionProvider implements CompletionProvider { - - private static final ErrorManager LOGGER = ErrorManager.getDefault().getInstance(GlslCompletionProvider.class.getName()); - private final String mimeType; - - private GlslCompletionProvider(String mimeType) { - this.mimeType = mimeType; - } - - public CompletionTask createTask(int queryType, JTextComponent component) { - return new AsyncCompletionTask(new GlslCompletionQuery(mimeType), component); - } - - public int getAutoQueryTypes(JTextComponent component, String typedText) { - return 0; - } - - public static GlslCompletionProvider createVSCompletionProvider() { - return new GlslCompletionProvider(GlslVertexShaderDataLoader.REQUIRED_MIME); - } - - public static GlslCompletionProvider createGSCompletionProvider() { - return new GlslCompletionProvider(GlslGeometryShaderDataLoader.REQUIRED_MIME); - } - - public static GlslCompletionProvider createFSCompletionProvider() { - return new GlslCompletionProvider(GlslFragmentShaderDataLoader.REQUIRED_MIME); - } - - private static class GlslCompletionQuery extends AsyncCompletionQuery { - - private GlslVocabularyManager vocabulary; - - public GlslCompletionQuery(String mimetype) { - vocabulary = GlslVocabularyManager.getInstance(mimetype); - } - - protected void query(CompletionResultSet completionResultSet, Document document, int pos) { - - fillResultset(completionResultSet, document, pos); - completionResultSet.finish(); - } - - private void fillResultset(CompletionResultSet completionResultSet, Document doc, int pos) { - - Element paragraph = ((BaseDocument) doc).getParagraphElement(pos); - String prefix; - try { - prefix = doc.getText(paragraph.getStartOffset(), pos - paragraph.getStartOffset()); - // daf�r sorgen, dass wir in den meisten f�llen einen korrekten prefix haben - // TODO: besser machen, ist ne hau-ruck-methode - // problem: bei leerzeichen in strings werden auch dort funktoren als autocomplete angeboten... - prefix = prefix.replaceAll(".*?([\\w-\"]*)$", "$1"); - } catch (BadLocationException e) { - LOGGER.notify(e); - prefix = ""; - } - - // add user declared functions first - synchronized (Glsl.declaredFunctions) { - Set> entrySet = Glsl.declaredFunctions.entrySet(); - - for (Entry entry : entrySet) { - - String name = entry.getKey(); - GLSLElementDescriptor desc = entry.getValue(); - - if (name.regionMatches(true, 0, prefix, 0, prefix.length())) { - completionResultSet.addItem(new GlslCompletionItem(name.substring(0, name.indexOf('(')), desc, prefix, pos)); - } - } - } - - - // add core GLSL completion items - Iterator it = vocabulary.getKeys().iterator(); - - while (it.hasNext()) { - - String name = (String) it.next(); - - if (name.regionMatches(true, 0, prefix, 0, prefix.length())) { - - GLSLElementDescriptor[] elements = vocabulary.getDesc(name); - - if (elements != null) { - for (GLSLElementDescriptor element : elements) { - completionResultSet.addItem(new GlslCompletionItem(name, element, prefix, pos)); - } - } - } - - } - } - } - - private static class GlslCompletionItem implements CompletionItem { - - private String key; - private GLSLElementDescriptor content; - private int carretPosition = 0; - private String prefix; - private String leftText; - private String rightText; - private String ARGUMENTS_COLOR = ""; - private String BUILD_IN_VAR_COLOR = ""; - private String KEYWORD_COLOR = ""; - private int priority; - - public GlslCompletionItem(String key, GLSLElementDescriptor content, String prefix, int carretPosition) { - - this.key = key; - this.content = content; - this.prefix = prefix; - this.carretPosition = carretPosition; - - leftText = createLeftText(); - rightText = content.type; - - // low prority is first in completion list - switch (content.category) { - case TYPE: - priority = 10; - break; - case JUMP: - priority = 9; - break; - case SELECTION: - priority = 8; - break; - case ITERATION: - priority = 7; - break; - case KEYWORD: - priority = 6; - break; - case QUALIFIER: - priority = 5; - break; - case BUILD_IN_FUNC: - priority = 4; - break; - case BUILD_IN_VAR: - priority = 3; - break; - } - } - - private String createLeftText() { - - StringBuilder text = new StringBuilder(); - - switch (content.category) { - case TYPE: - case JUMP: - case SELECTION: - case ITERATION: - case KEYWORD: - case QUALIFIER: - text.append(KEYWORD_COLOR); - break; - case BUILD_IN_VAR: - text.append(BUILD_IN_VAR_COLOR); - break; - } - - text.append(""); - text.append(key); - text.append(""); - - if (content.arguments != null) { - text.append(ARGUMENTS_COLOR); - text.append(content.arguments); - text.append(""); - } - return text.toString(); - } - - public void defaultAction(JTextComponent component) { - Completion.get().hideAll(); - // replace prefix with key - try { - component.getDocument().remove(carretPosition - prefix.length(), prefix.length()); - component.getDocument().insertString(carretPosition - prefix.length(), key, null); - } catch (BadLocationException e) { - LOGGER.notify(e); - } - } - - public void processKeyEvent(KeyEvent evt) { - // TODO: if "." then Completion.get().showCompletion() - } - - public int getPreferredWidth(Graphics g, Font defaultFont) { - return CompletionUtilities.getPreferredWidth(leftText, rightText, g, defaultFont); - } - - public void render(Graphics g, Font defaultFont, Color defaultColor, Color backgroundColor, int width, int height, boolean selected) { - - CompletionUtilities.renderHtml(null, leftText, rightText, g, defaultFont, defaultColor, width, height, selected); - - } - - public CompletionTask createDocumentationTask() { - - if (content.doc == null) { - return null; - } - - return new AsyncCompletionTask(new AsyncCompletionQuery() { - - private GlslDocItem item = new GlslDocItem(key, content); - - protected void query(CompletionResultSet completionResultSet, Document document, int i) { - completionResultSet.setDocumentation(item); - completionResultSet.finish(); - } - }); - } - - public CompletionTask createToolTipTask() { - return null; - } - - public boolean instantSubstitution(JTextComponent component) { - defaultAction(component); - return true; - } - - public int getSortPriority() { - return priority; - } - - public CharSequence getSortText() { - return key; - } - - public CharSequence getInsertPrefix() { - return prefix; - } - } - - private static class GlslDocItem implements CompletionDocumentation { - - private String text; - - public GlslDocItem(String item, GLSLElementDescriptor content) { - - StringBuilder sb = new StringBuilder(); - sb.append(""); - if (content.type != null) { - sb.append(content.type); - sb.append(" "); - } - sb.append(""); - sb.append(item); - sb.append(""); - if (content.arguments != null) { - sb.append(content.arguments); - } - sb.append("

"); - sb.append(content.doc); - sb.append("

"); - - text = sb.toString(); - } - - public String getText() { - return text; - } - - public URL getURL() { - return null; - } - - public CompletionDocumentation resolveLink(String link) { - return null; - } - - public Action getGotoSourceAction() { - return null; - } - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/GlslShaderFileObserver.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/GlslShaderFileObserver.java deleted file mode 100644 index 8e18a7857..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/GlslShaderFileObserver.java +++ /dev/null @@ -1,64 +0,0 @@ -package net.java.nboglpack.glsleditor; - -/** - * Created on 26. March 2007, 00:49 - * - */ -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import org.openide.loaders.DataObject; -import org.openide.util.RequestProcessor; - -/** - * Observes an DataObject for document updates and starts compilation automatically. - * @author Michael Bien - */ -public class GlslShaderFileObserver implements DocumentListener { - - private final DataObject observedDao; - private final static RequestProcessor RP = new RequestProcessor("compiler"); - private final RequestProcessor.Task compilerTask; - private boolean runOnDocUpdate = true; - private int compileDelay = 500; - - public GlslShaderFileObserver(DataObject dao) { - observedDao = dao; - - compilerTask = RP.create(new Runnable() { - - public void run() { -// GLSLCompilerService compiler = Lookup.getDefault().lookup(GLSLCompilerService.class); -// compiler.compileShader(new DataObject[] {observedDao}, false); - } - }); - compilerTask.setPriority(Thread.MIN_PRIORITY); - } - - // DocumentListener - public void insertUpdate(DocumentEvent arg0) { - if (runOnDocUpdate) { - runCompileTask(); - } - } - - public void removeUpdate(DocumentEvent arg0) { - if (runOnDocUpdate) { - runCompileTask(); - } - } - - public void changedUpdate(DocumentEvent arg0) { - } - - public final void runCompileTask() { - compilerTask.schedule(compileDelay); - } - - public void setCompileDelay(int compileDelay) { - this.compileDelay = compileDelay; - } - - public void setRunOnDocUpdate(boolean runOnDocUpdate) { - this.runOnDocUpdate = runOnDocUpdate; - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/GlslVocabularyManager.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/GlslVocabularyManager.java deleted file mode 100644 index be15ecf2c..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/GlslVocabularyManager.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * GlslVocabularyManager.java - * - * Created on 12. Februar 2006, 03:37 - * - */ -package net.java.nboglpack.glsleditor; - -import java.io.InputStream; -import java.util.AbstractSet; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import net.java.nboglpack.glsleditor.dataobject.GlslFragmentShaderDataLoader; -import net.java.nboglpack.glsleditor.dataobject.GlslGeometryShaderDataLoader; -import net.java.nboglpack.glsleditor.dataobject.GlslVertexShaderDataLoader; -import net.java.nboglpack.glsleditor.vocabulary.GLSLElementDescriptor; -import net.java.nboglpack.glsleditor.vocabulary.GLSLVocabulary; -import org.openide.ErrorManager; -import org.openide.filesystems.FileObject; -import org.openide.filesystems.FileUtil; - -/** - * - * @author mhenze - * @author Michael Bien - */ -public class GlslVocabularyManager { - - private static final ErrorManager LOGGER = ErrorManager.getDefault().getInstance(GlslVocabularyManager.class.getName()); - private static final HashMap instances = new HashMap(); - private static GLSLVocabulary vocabulary = null; - private final String mimetype; - private final Set keySet; - private final Map vocabularyExtention; - - /** - * Creates a new instance of GlslVocabularyManager - */ - private GlslVocabularyManager(String mimetype) { - - if (!mimetype.equals(GlslFragmentShaderDataLoader.REQUIRED_MIME) - && !mimetype.equals(GlslVertexShaderDataLoader.REQUIRED_MIME) - && !mimetype.equals(GlslGeometryShaderDataLoader.REQUIRED_MIME)) { - throw new IllegalArgumentException(mimetype + " is no GLSL mime type"); - } - - - this.mimetype = mimetype; - - if (vocabulary == null) { - loadVocabulary(); - } - - if (mimetype.equals(GlslFragmentShaderDataLoader.REQUIRED_MIME)) { - vocabularyExtention = vocabulary.fragmentShaderVocabulary; - } else if (mimetype.equals(GlslVertexShaderDataLoader.REQUIRED_MIME)) { - vocabularyExtention = vocabulary.vertexShaderVocabulary; - } else { - vocabularyExtention = vocabulary.geometryShaderVocabulary; - } - - // merges two views - keySet = new AbstractSet() { - - private final Set mainSet = vocabulary.mainVocabulary.keySet(); - private final Set extSet = vocabularyExtention.keySet(); - - public Iterator iterator() { - return new Iterator() { - - Iterator mainIt = mainSet.iterator(); - Iterator extIt = extSet.iterator(); - - public boolean hasNext() { - return mainIt.hasNext() || extIt.hasNext(); - } - - public String next() { - if (mainIt.hasNext()) { - return mainIt.next(); - } else { - return extIt.next(); - } - } - - public void remove() { - throw new UnsupportedOperationException("Not supported yet."); - } - }; - } - - public int size() { - return mainSet.size() + extSet.size(); - } - }; - - } - - public static GlslVocabularyManager getInstance(String mimetype) { - - GlslVocabularyManager instance = instances.get(mimetype); - - if (instance == null) { - instance = new GlslVocabularyManager(mimetype); - instances.put(mimetype, instance); - } - - return instance; - } - - private void loadVocabulary() { - - FileObject vocabularyfile = FileUtil.getConfigFile("Editors/" + mimetype + "/vocabulary.xml"); - - if (vocabularyfile != null) { - - InputStream is = null; - - try { - - is = vocabularyfile.getInputStream(); - - // workaround; nb does not allow usage of jdk's jaxb implementation - // => we have to provide JAXB as library wrapper module and load it via module classloader - JAXBContext jc = JAXBContext.newInstance("net.java.nboglpack.glsleditor.vocabulary", this.getClass().getClassLoader()); - - Unmarshaller unmarshaller = jc.createUnmarshaller(); - vocabulary = (GLSLVocabulary) unmarshaller.unmarshal(is); - - } catch (Exception ex) { - - // create empty vocab - vocabulary = new GLSLVocabulary(); - LOGGER.notify(ex); - - } finally { - - if (is != null) { - try { - is.close(); - } catch (Exception e) { - LOGGER.notify(e); - } - } - - } - - } - - } - - public Set getKeys() { - return keySet; - } - - public GLSLElementDescriptor[] getDesc(String key) { - - GLSLElementDescriptor[] desc = vocabulary.mainVocabulary.get(key); - - if (desc == null) { - desc = vocabularyExtention.get(key); - } - - return desc; - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/Bundle.properties b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/Bundle.properties deleted file mode 100644 index c5e2ea05a..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/Bundle.properties +++ /dev/null @@ -1,11 +0,0 @@ -Services/MIMEResolver/GlslVertexShaderResolver.xml=GLSL Vertex Shader Files -Services/MIMEResolver/GlslFragmentShaderResolver.xml=GLSL Fragment Shader Files -Services/MIMEResolver/GlslGeometryShaderResolver.xml=GLSL Geometry Shader Files - -Templates/OpenGL/VertexShader.vert=GLSL Vertex Shader File -Templates/OpenGL/FragmentShader.frag=GLSL Fragment Shader File -Templates/OpenGL/GeometryShader.geom=GLSL Geometry Shader File - -LBL_glsl_vertex_shader_loader_name=GLSL Vertex Shader Files -LBL_glsl_fragment_shader_loader_name=GLSL Fragment Shader Files -LBL_glsl_geometry_shader_loader_name=GLSL Geometry Shader Files diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataLoader.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataLoader.java deleted file mode 100644 index 45bbae64a..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataLoader.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import java.io.IOException; -import org.openide.filesystems.FileObject; -import org.openide.loaders.DataObjectExistsException; -import org.openide.loaders.MultiDataObject; -import org.openide.loaders.UniFileLoader; -import org.openide.util.NbBundle; - -public class GlslFragmentShaderDataLoader extends UniFileLoader { - - public static final String REQUIRED_MIME = "text/x-glsl-fragment-shader"; - - private static final long serialVersionUID = 1L; - - public GlslFragmentShaderDataLoader() { - super("net.java.nboglpack.glsleditor.dataobject.GlslFragmentShaderDataObject"); - } - - @Override - protected String defaultDisplayName() { - return NbBundle.getMessage(GlslFragmentShaderDataLoader.class, "LBL_glsl_fragment_shader_loader_name"); - } - - @Override - protected void initialize() { - super.initialize(); - getExtensions().addMimeType(REQUIRED_MIME); - } - - protected MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, IOException { - return new GlslFragmentShaderDataObject(primaryFile, this); - } - - @Override - protected String actionsContext() { - return "Loaders/" + REQUIRED_MIME + "/Actions"; - } - -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataLoaderBeanInfo.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataLoaderBeanInfo.java deleted file mode 100644 index 1484e3065..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataLoaderBeanInfo.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import java.awt.Image; -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.SimpleBeanInfo; -import org.openide.loaders.UniFileLoader; -import org.openide.util.ImageUtilities; - -public class GlslFragmentShaderDataLoaderBeanInfo extends SimpleBeanInfo { - - public static final String IMAGE_ICON_BASE = "net/java/nboglpack/glsleditor/resources/FragmentShaderIcon.gif"; - - @Override - public BeanInfo[] getAdditionalBeanInfo() { - try { - return new BeanInfo[]{Introspector.getBeanInfo(UniFileLoader.class)}; - } catch (IntrospectionException e) { - throw new AssertionError(e); - } - } - - @Override - public Image getIcon(int type) { - if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) { - return ImageUtilities.loadImage(IMAGE_ICON_BASE); - } else { - return null; - } - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataNode.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataNode.java deleted file mode 100644 index 7b65c9f10..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataNode.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import org.openide.loaders.DataNode; -import org.openide.nodes.Children; - -public class GlslFragmentShaderDataNode extends DataNode -{ - public GlslFragmentShaderDataNode(GlslFragmentShaderDataObject obj) - { - super(obj, Children.LEAF); - setIconBaseWithExtension(GlslFragmentShaderDataLoaderBeanInfo.IMAGE_ICON_BASE); - } -// /** Creates a property sheet. */ -// protected Sheet createSheet() { -// Sheet s = super.createSheet(); -// Sheet.Set ss = s.get(Sheet.PROPERTIES); -// if (ss == null) { -// ss = Sheet.createPropertiesSet(); -// s.put(ss); -// } -// // TODO add some relevant properties: ss.put(...) -// return s; -// } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataObject.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataObject.java deleted file mode 100644 index d11d65104..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslFragmentShaderDataObject.java +++ /dev/null @@ -1,59 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import net.java.nboglpack.glsleditor.GlslShaderFileObserver; -import java.beans.PropertyChangeEvent; -import java.io.IOException; -import java.beans.PropertyChangeListener; -import javax.swing.text.Document; -import org.openide.filesystems.FileObject; -import org.openide.loaders.DataObjectExistsException; -import org.openide.loaders.MultiDataObject; -import org.openide.nodes.CookieSet; -import org.openide.nodes.Node; -import org.openide.text.CloneableEditorSupport; -import org.openide.text.DataEditorSupport; - -public class GlslFragmentShaderDataObject extends MultiDataObject { - - private final GlslShaderFileObserver observer; - - public GlslFragmentShaderDataObject(FileObject pf, GlslFragmentShaderDataLoader loader) throws DataObjectExistsException, IOException { - - super(pf, loader); - - CookieSet cookies = getCookieSet(); - observer = new GlslShaderFileObserver(this); - - final CloneableEditorSupport support = DataEditorSupport.create(this, getPrimaryEntry(), cookies); - support.addPropertyChangeListener( - new PropertyChangeListenerImpl(support)); - cookies.add((Node.Cookie) support); - } - - @Override - protected Node createNodeDelegate() { - return new GlslFragmentShaderDataNode(this); - } - - private class PropertyChangeListenerImpl implements PropertyChangeListener { - - private final CloneableEditorSupport support; - - public PropertyChangeListenerImpl(CloneableEditorSupport support) { - this.support = support; - } - - public void propertyChange(PropertyChangeEvent event) { - if ("document".equals(event.getPropertyName())) { - if (event.getNewValue() != null) { - support.getDocument().addDocumentListener(observer); - observer.runCompileTask(); - } else if (event.getOldValue() != null) { - // cylab: I think this is never called. - // But I don't know if unregistering the observer makes any difference... - ((Document) event.getOldValue()).removeDocumentListener(observer); - } - } - } - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataLoader.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataLoader.java deleted file mode 100644 index 6b98e854a..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataLoader.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import java.io.IOException; -import org.openide.filesystems.FileObject; -import org.openide.loaders.DataObjectExistsException; -import org.openide.loaders.MultiDataObject; -import org.openide.loaders.UniFileLoader; -import org.openide.util.NbBundle; - - -/** - * @author Michael Bien - */ -public class GlslGeometryShaderDataLoader extends UniFileLoader { - - public static final String REQUIRED_MIME = "text/x-glsl-geometry-shader"; - - private static final long serialVersionUID = 1L; - - public GlslGeometryShaderDataLoader() { - super("net.java.nboglpack.glsleditor.dataobject.GlslGeometryShaderDataObject"); - } - - @Override - protected String defaultDisplayName() { - return NbBundle.getMessage(GlslGeometryShaderDataLoader.class, "LBL_glsl_geometry_shader_loader_name"); - } - - @Override - protected void initialize() { - super.initialize(); - getExtensions().addMimeType(REQUIRED_MIME); - } - - protected MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, IOException { - return new GlslGeometryShaderDataObject(primaryFile, this); - } - - @Override - protected String actionsContext() { - return "Loaders/" + REQUIRED_MIME + "/Actions"; - } - -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataLoaderBeanInfo.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataLoaderBeanInfo.java deleted file mode 100644 index 708b47a63..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataLoaderBeanInfo.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import java.awt.Image; -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.SimpleBeanInfo; -import org.openide.loaders.UniFileLoader; -import org.openide.util.ImageUtilities; - - -/** - * @author Michael Bien - */ -public class GlslGeometryShaderDataLoaderBeanInfo extends SimpleBeanInfo { - - public static final String IMAGE_ICON_BASE = "net/java/nboglpack/glsleditor/resources/GeometryShaderIcon.gif"; - - @Override - public BeanInfo[] getAdditionalBeanInfo() { - try { - return new BeanInfo[] {Introspector.getBeanInfo(UniFileLoader.class)}; - } catch (IntrospectionException e) { - throw new AssertionError(e); - } - } - - @Override - public Image getIcon(int type) { - if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) { - return ImageUtilities.loadImage(IMAGE_ICON_BASE); - } else { - return null; - } - } - -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataNode.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataNode.java deleted file mode 100644 index 9706b7b31..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataNode.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import org.openide.loaders.DataNode; -import org.openide.nodes.Children; -import org.openide.util.Lookup; - - -/** - * @author Michael Bien - */ -public class GlslGeometryShaderDataNode extends DataNode { - - public GlslGeometryShaderDataNode(GlslGeometryShaderDataObject obj) { - super(obj, Children.LEAF); - setIconBaseWithExtension(GlslGeometryShaderDataLoaderBeanInfo.IMAGE_ICON_BASE); - } - GlslGeometryShaderDataNode(GlslGeometryShaderDataObject obj, Lookup lookup) { - super(obj, Children.LEAF, lookup); - setIconBaseWithExtension(GlslGeometryShaderDataLoaderBeanInfo.IMAGE_ICON_BASE); - } - - // /** Creates a property sheet. */ - // protected Sheet createSheet() { - // Sheet s = super.createSheet(); - // Sheet.Set ss = s.get(Sheet.PROPERTIES); - // if (ss == null) { - // ss = Sheet.createPropertiesSet(); - // s.put(ss); - // } - // // TODO add some relevant properties: ss.put(...) - // return s; - // } - -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataObject.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataObject.java deleted file mode 100644 index d0a783385..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslGeometryShaderDataObject.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.IOException; -import javax.swing.text.Document; -import net.java.nboglpack.glsleditor.GlslShaderFileObserver; -import org.openide.filesystems.FileObject; -import org.openide.loaders.DataObjectExistsException; -import org.openide.loaders.MultiDataObject; -import org.openide.nodes.CookieSet; -import org.openide.nodes.Node; -import org.openide.text.CloneableEditorSupport; -import org.openide.util.Lookup; -import org.openide.text.DataEditorSupport; - -/** - * @author Michael Bien - */ -public class GlslGeometryShaderDataObject extends MultiDataObject { - - private GlslShaderFileObserver observer; - - public GlslGeometryShaderDataObject(FileObject pf, GlslGeometryShaderDataLoader loader) throws DataObjectExistsException, IOException { - - super(pf, loader); - - CookieSet cookies = getCookieSet(); - observer = new GlslShaderFileObserver(this); - - final CloneableEditorSupport support = DataEditorSupport.create(this, getPrimaryEntry(), cookies); - support.addPropertyChangeListener(new PropertyChangeListenerImpl(support)); - cookies.add((Node.Cookie) support); - } - - @Override - protected Node createNodeDelegate() { - return new GlslGeometryShaderDataNode(this, getLookup()); - } - - @Override - public Lookup getLookup() { - return getCookieSet().getLookup(); - } - - private class PropertyChangeListenerImpl implements PropertyChangeListener { - - private final CloneableEditorSupport support; - - public PropertyChangeListenerImpl(CloneableEditorSupport support) { - this.support = support; - } - - public void propertyChange(PropertyChangeEvent event) { - if ("document".equals(event.getPropertyName())) { - if (event.getNewValue() != null) { - support.getDocument().addDocumentListener(observer); - observer.runCompileTask(); - } else if (event.getOldValue() != null) { - // cylab: I think this is never called. - // But I don't know if unregistering the observer makes any difference... - ((Document) event.getOldValue()).removeDocumentListener(observer); - } - } - } - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataLoader.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataLoader.java deleted file mode 100644 index 252d55539..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataLoader.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import java.io.IOException; -import org.openide.filesystems.FileObject; -import org.openide.loaders.DataObjectExistsException; -import org.openide.loaders.MultiDataObject; -import org.openide.loaders.UniFileLoader; -import org.openide.util.NbBundle; - -public class GlslVertexShaderDataLoader extends UniFileLoader { - - public static final String REQUIRED_MIME = "text/x-glsl-vertex-shader"; - - private static final long serialVersionUID = 1L; - - public GlslVertexShaderDataLoader() { - super("net.java.nboglpack.glsleditor.dataobject.GlslVertexShaderDataObject"); - } - - @Override - protected String defaultDisplayName() { - return NbBundle.getMessage(GlslFragmentShaderDataLoader.class, "LBL_glsl_vertex_shader_loader_name"); - } - - @Override - protected void initialize() { - super.initialize(); - getExtensions().addMimeType(REQUIRED_MIME); - } - - protected MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, IOException { - return new GlslVertexShaderDataObject(primaryFile, this); - } - - @Override - protected String actionsContext() { - return "Loaders/" + REQUIRED_MIME + "/Actions"; - } - -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataLoaderBeanInfo.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataLoaderBeanInfo.java deleted file mode 100644 index 959d965bb..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataLoaderBeanInfo.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import java.awt.Image; -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.SimpleBeanInfo; -import org.openide.loaders.UniFileLoader; -import org.openide.util.ImageUtilities; - -public class GlslVertexShaderDataLoaderBeanInfo extends SimpleBeanInfo { - - public static final String IMAGE_ICON_BASE = "net/java/nboglpack/glsleditor/resources/VertexShaderIcon.gif"; - - @Override - public BeanInfo[] getAdditionalBeanInfo() { - try { - return new BeanInfo[]{Introspector.getBeanInfo(UniFileLoader.class)}; - } catch (IntrospectionException e) { - throw new AssertionError(e); - } - } - - @Override - public Image getIcon(int type) { - if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) { - return ImageUtilities.loadImage(IMAGE_ICON_BASE); - } else { - return null; - } - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataNode.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataNode.java deleted file mode 100644 index 25ca7e600..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataNode.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import org.openide.loaders.DataNode; -import org.openide.nodes.Children; - -public class GlslVertexShaderDataNode extends DataNode -{ - public GlslVertexShaderDataNode(GlslVertexShaderDataObject obj) - { - super(obj, Children.LEAF); - setIconBaseWithExtension(GlslVertexShaderDataLoaderBeanInfo.IMAGE_ICON_BASE); - } -// /** Creates a property sheet. */ -// protected Sheet createSheet() { -// Sheet s = super.createSheet(); -// Sheet.Set ss = s.get(Sheet.PROPERTIES); -// if (ss == null) { -// ss = Sheet.createPropertiesSet(); -// s.put(ss); -// } -// // TODO add some relevant properties: ss.put(...) -// return s; -// } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataObject.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataObject.java deleted file mode 100644 index 813ee4869..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/dataobject/GlslVertexShaderDataObject.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.java.nboglpack.glsleditor.dataobject; - -import net.java.nboglpack.glsleditor.GlslShaderFileObserver; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.IOException; -import javax.swing.text.Document; -import org.openide.filesystems.FileObject; -import org.openide.loaders.DataObjectExistsException; -import org.openide.loaders.MultiDataObject; -import org.openide.nodes.CookieSet; -import org.openide.nodes.Node; -import org.openide.text.CloneableEditorSupport; -import org.openide.text.DataEditorSupport; - -public class GlslVertexShaderDataObject extends MultiDataObject { - - private GlslShaderFileObserver observer; - - public GlslVertexShaderDataObject(FileObject pf, GlslVertexShaderDataLoader loader) throws DataObjectExistsException, IOException { - - super(pf, loader); - CookieSet cookies = getCookieSet(); - observer = new GlslShaderFileObserver(this); - - final CloneableEditorSupport support = DataEditorSupport.create(this, getPrimaryEntry(), cookies); - support.addPropertyChangeListener( - new PropertyChangeListenerImpl(support)); - cookies.add((Node.Cookie) support); - } - - @Override - protected Node createNodeDelegate() { - return new GlslVertexShaderDataNode(this); - } - - private class PropertyChangeListenerImpl implements PropertyChangeListener { - - private final CloneableEditorSupport support; - - public PropertyChangeListenerImpl(CloneableEditorSupport support) { - this.support = support; - } - - public void propertyChange(PropertyChangeEvent event) { - if ("document".equals(event.getPropertyName())) { - if (event.getNewValue() != null) { - support.getDocument().addDocumentListener(observer); - observer.runCompileTask(); - } else if (event.getOldValue() != null) { - // cylab: I think this is never called. - // But I don't know if unregistering the observer makes any difference... - ((Document) event.getOldValue()).removeDocumentListener(observer); - } - } - } - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/Bundle.properties b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/Bundle.properties deleted file mode 100644 index abf92fabf..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/Bundle.properties +++ /dev/null @@ -1,4 +0,0 @@ -LBL_SYNTAX_ERROR=Syntax error. -LBL_UNEXPECTED_CHARACTER=Unexpected character. -LBL_RESERVED_KEYWORD=Reserved keyword. - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/GLSL_120.nbs b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/GLSL_120.nbs deleted file mode 100644 index cd5ca6d2b..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/GLSL_120.nbs +++ /dev/null @@ -1,316 +0,0 @@ -################################################################################ -# OpenGL Shading Language 1.20 GLF file ######################################## -################################################################################ -# @date 10.09.2007 # -# @author Michael Bien # -# @email mbien@fh-landshut.de # -################################################################################ - -BUNDLE "net.java.nboglpack.glsleditor.glsl.Bundle" - -SKIP:WHITESPACE -SKIP:END_OF_LINE -SKIP:COMMENT -SKIP:ML_COMMENT - -## error highlighting ########################################################## -MARK:ERROR: { - type:"Error"; - message:"LBL_SYNTAX_ERROR"; -} -MARK:error: { - type:"Error"; - message:"LBL_UNEXPECTED_CHARACTER"; -} -MARK:reserved: { - type:"Warning"; - message:"LBL_RESERVED_KEYWORD"; -} - -FOLD:function_body: { - fold_display_name:"{...}"; -} -FOLD:struct_body: { - fold_display_name:"{...}"; -} -FOLD:ML_COMMENT: { - fold_display_name:"/*...*/"; -} - -BRACE "(:)" -BRACE "{:}" -BRACE "[:]" - -COMPLETE "(:)" -COMPLETE "{:}" -COMPLETE "[:]" - -INDENT "(:)" -INDENT "{:}" -INDENT "[:]" -INDENT "\\s*(((if|while)\\s*\\(|else\\s*|else\\s+if\\s*\\(|for\\s*\\(.*\\))[^{;]*)" - -SELECTION ( ["a"-"z" "A"-"Z" "0"-"9" "_"] ) - -NAVIGATOR:global_preprocessor: { - display_name: net.java.nboglpack.glsleditor.glsl.Glsl.createPreprocessorString; - icon: "net/java/nboglpack/glsleditor/resources/preprocessor.png"; - isLeaf: "true"; -} -NAVIGATOR:global_declared_identifier, struct_declarator: { - display_name: net.java.nboglpack.glsleditor.glsl.Glsl.createFieldDeclarationString; - icon: "net/java/nboglpack/glsleditor/resources/field.gif"; - isLeaf: "true"; -} -NAVIGATOR:function: { - display_name: net.java.nboglpack.glsleditor.glsl.Glsl.createFunctionDeclarationString; - icon: "net/java/nboglpack/glsleditor/resources/function.gif"; - isLeaf: "true"; -} -#AST { -# process: net.java.nboglpack.glsleditor.glsl.Glsl.process; -#} -#PROPERTIES { -# traceSteps:"true"; -# printRules:"true"; -# printFirst:"true"; -#} - -##### GLSL 1.2 grammar ######################################################### - -S = declaration*; - - -## constants ################################################################### -type_specifier = "float" - | "int" - | "bool" - | "vec2" - | "vec3" - | "vec4" - | "bvec2" - | "bvec3" - | "bvec4" - | "ivec2" - | "ivec3" - | "ivec4" - | "mat2" - | "mat3" - | "mat4" - | "mat2x2" - | "mat2x3" - | "mat2x4" - | "mat3x2" - | "mat3x3" - | "mat3x4" - | "mat4x2" - | "mat4x3" - | "mat4x4" - | "sampler1D" - | "sampler2D" - | "sampler3D" - | "samplerCube" - | "sampler1DShadow" - | "sampler2DShadow"; - -type_specifier_or_identifier = type_specifier | ; - -type_qualifier = "const"; - -global_type_qualifier = type_qualifier - | "attribute" # Vertex only. - | "varying" - | ("centroid" "varying") - | ("invariant" ["centroid"] "varying") - | "uniform"; - -parameter_declaration_qualifier = "in" | "out" | "inout"; - -boolean_literal = "true" | "false"; # TODO move boolean literal to lexer? - - -assignment_operator = - | - | - | - | - | # reserved - | # reserved - | # reserved - | # reserved - | # reserved - | ; # reserved - -comperator = | | | | | ; - -operator = - | - | - | - | - | - | # reserved - | - | - | # reserved - | # reserved - | # reserved - | ; # reserved - -unary_operator = - | - | - | ; # reserved - -increment_or_decrement_operator = | ; - -reserved = "asm" - | "class" - | "union" - | "enum" - | "typedef" - | "template" - | "this" - | "packed" - | "goto" - | "switch" - | "default" - | "inline" - | "noinline" - | "volatile" - | "public" - | "static" - | "extern" - | "external" - | "interface" - | "long" - | "short" - | "double" - | "half" - | "fixed" - | "unsigned" - | "lowp" - | "mediump" - | "highp" - | "precision" - | "input" - | "output" - | "hvec2" - | "hvec3" - | "hvec4" - | "dvec2" - | "dvec3" - | "dvec4" - | "fvec2" - | "fvec3" - | "fvec4" - | "sampler2DRect" - | "sampler3DRect" - | "sampler2DRectShadow" - | "sizeof" - | "cast" - | "namespace" - | "using"; - - -## declarations ################################################################ -declaration = type_specifier_or_identifier [array_index] (function | (global_identifier_list )); -declaration = "void" function; -declaration = global_type_qualifier struct_declaration ; -declaration = global_type_qualifier global_type_declaration ; -declaration = struct_declaration ; -declaration = global_preprocessor; - -global_identifier_list = global_declared_identifier [array_index] ( global_declared_identifier [array_index])*; -global_declared_identifier = ; -global_preprocessor = ; - -struct_declaration = "struct" struct_body [global_identifier_list]; -struct_body = "{" (local_type_declaration )+ "}"; - -global_type_declaration = type_specifier_or_identifier [array_index] global_identifier_list [ expression]; -type_declaration = type_specifier_or_identifier [array_index] [array_index] ( [array_index])*; - -local_type_declaration = [type_qualifier] type_declaration; - -## function #################################################################### -function = "(" [parameter_declaration_list] ")" (function_body | ); -function_body = code_block; - -parameter_declaration = [type_qualifier] [parameter_declaration_qualifier] type_specifier_or_identifier ((array_index ) | ( [array_index])); -parameter_declaration_list = "void" | (parameter_declaration ( parameter_declaration)*); - -statement = ; -statement = expression_hack ; # statement = local_type_declaration [ expression] ; -statement = conditional_statement; -statement = "return" [expression] ; -statement = "break" ; # break just in loops allowed -statement = "continue" ;# continue just in loops allowed -statement = "discard" ; # Fragment shader only. - -code_block = "{" statement* "}"; - -## expresstions and operations ################################################# -# ternary operator -expression = expression1 ["?" expression1 ":" expression1]; - -expression1 = [unary_operator] expression2 operation_or_comparison*; -expression1 = [unary_operator] "(" expression ")" operation_or_comparison*; - -expression2 = ( [increment_or_decrement_operator] ( | ) (field_access)* [increment_or_decrement_operator] [assignment]) - | ((function_call | constructor_call) (field_access)*) - | - | - | boolean_literal; - - - -expression_hack = unary_operator expression1_hack operation_or_comparison*; -expression_hack = unary_operator "(" expression ")" operation_or_comparison*; -expression_hack = expression1_hack operation_or_comparison*; -expression_hack = "(" expression ")" operation_or_comparison*; - -expression_hack = (field_access)* [increment_or_decrement_operator] [assignment]; -expression_hack = (field_access)* [array_index] ( [array_index])*; -expression_hack = type_specifier (field_access)* [array_index] ( [array_index])*; - -expression1_hack = (increment_or_decrement_operator ( | ) (field_access)* [increment_or_decrement_operator] [assignment]) - | ( (field_access)* [increment_or_decrement_operator] [assignment]) - | ((function_call | constructor_call) (field_access)*) - | - | - | boolean_literal; - - - -assignment = assignment_operator expression; -operation_or_comparison = (comperator | operator) expression; - -field_access = array_index; -field_access = ; - -array_index = "[" [expression] "]"; - -function_call = ( | ) "(" [expression_list] ")"; -# Note constructor call is something like that: vec2(1.0, 2.0) or float[2] (1.0, 2.0) -constructor_call = type_specifier [array_index] "(" [expression_list] ")"; #TODO custom structs - -expression_list = "void" | (expression ( expression)*); - -## code flow ################################################################### -conditional_statement = if_statement - | for_statement - | while_statement - | do_while_statement; - -# TODO if rule not 100% correct, multiple else allowed even before else if -if_statement = "if" condition statement_or_code_block ("else" ["if" condition] statement_or_code_block)*; -while_statement = "while" condition statement_or_code_block; -do_while_statement = "do" statement_or_code_block "while" condition ; -# TODO for rule could be more restrictive -for_statement = "for" "(" [[type_specifier] assignment] [expression] [expression] ")" statement_or_code_block; - -condition = "(" expression ")"; -statement_or_code_block = (statement | code_block); - - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/GLSL_130.nbs b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/GLSL_130.nbs deleted file mode 100644 index 45bb8fae3..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/GLSL_130.nbs +++ /dev/null @@ -1,390 +0,0 @@ -################################################################################ -# OpenGL Shading Language 1.30 GLF file ######################################## -################################################################################ -# @date 10.09.2007 # -# @author Michael Bien # -# @email mbien@fh-landshut.de # -################################################################################ - -BUNDLE "net.java.nboglpack.glsleditor.glsl.Bundle" - -SKIP:WHITESPACE -SKIP:END_OF_LINE -SKIP:COMMENT -SKIP:ML_COMMENT - -## error highlighting ########################################################## -MARK:ERROR: { - type:"Error"; - message:"LBL_SYNTAX_ERROR"; -} -MARK:error: { - type:"Error"; - message:"LBL_UNEXPECTED_CHARACTER"; -} -MARK:reserved: { - type:"Warning"; - message:"LBL_RESERVED_KEYWORD"; -} - -FOLD:function_body: { - fold_display_name:"{...}"; -} -FOLD:struct_body: { - fold_display_name:"{...}"; -} -FOLD:ML_COMMENT: { - fold_display_name:"/*...*/"; -} - -BRACE "(:)" -BRACE "{:}" -BRACE "[:]" - -COMPLETE "(:)" -COMPLETE "{:}" -COMPLETE "[:]" - -INDENT "(:)" -INDENT "{:}" -INDENT "[:]" -INDENT "\\s*(((if|while)\\s*\\(|else\\s*|else\\s+if\\s*\\(|for\\s*\\(.*\\))[^{;]*)" - -SELECTION ( ["a"-"z" "A"-"Z" "0"-"9" "_"] ) - -AST { - process: net.java.nboglpack.glsleditor.glsl.Glsl.process; -} -NAVIGATOR:global_preprocessor: { - display_name: net.java.nboglpack.glsleditor.glsl.Glsl.createPreprocessorString; - icon: "net/java/nboglpack/glsleditor/resources/preprocessor.png"; - isLeaf: "true"; -} -NAVIGATOR:global_declared_identifier: { - display_name: net.java.nboglpack.glsleditor.glsl.Glsl.createFieldDeclarationString; - icon: "net/java/nboglpack/glsleditor/resources/field.gif"; - isLeaf: "true"; -} -NAVIGATOR:function: { - display_name: net.java.nboglpack.glsleditor.glsl.Glsl.createFunctionDeclarationString; - icon: "net/java/nboglpack/glsleditor/resources/function.gif"; - isLeaf: "true"; -} -#PROPERTIES { -# traceSteps:"true"; -# printRules:"true"; -# printFirst:"true"; -#} - -##### GLSL 1.3 grammar ######################################################### - -S = declaration*; - - -## constants ################################################################### -type_specifier = "float" - | "int" - | "uint" - | "bool" - | "vec2" - | "vec3" - | "vec4" - | "bvec2" - | "bvec3" - | "bvec4" - | "ivec2" - | "ivec3" - | "ivec4" - | "uvec2" - | "uvec3" - | "uvec4" - | "mat2" - | "mat3" - | "mat4" - | "mat2x2" - | "mat2x3" - | "mat2x4" - | "mat3x2" - | "mat3x3" - | "mat3x4" - | "mat4x2" - | "mat4x3" - | "mat4x4" - | "sampler1D" - | "sampler2D" - | "sampler3D" - | "samplerCube" - | "sampler1DShadow" - | "sampler2DShadow" - | "sampler1DArray" - | "sampler2DArray" - | "sampler1DArrayShadow" - | "sampler2DArrayShadow" - | "isampler1D" - | "isampler2D" - | "isampler3D" - | "isamplerCube" - | "isampler1DArray" - | "isampler2DArray" - | "usampler1D" - | "usampler2D" - | "usampler3D" - | "usamplerCube" - | "usampler1DArray" - | "usampler2DArray"; - -type_specifier_or_identifier = type_specifier | ; - -type_qualifier = "const"; - -interpolation_type_qualifier = "smooth" - | "flat" - | "noperspective"; - -inout_type_qualifier = "in" | "out"; - -global_type_qualifier = type_qualifier - | (inout_type_qualifier ["invariant"] ["centroid"]) - | (interpolation_type_qualifier ["invariant"] ["centroid"] [inout_type_qualifier]) - | ("centroid" [interpolation_type_qualifier] [inout_type_qualifier]) - | ("invariant" ["centroid"] [inout_type_qualifier]) - | "attribute" # Vertex only. - | "varying" - | ("centroid" "varying") - | ("invariant" ["centroid"] "varying") - | "uniform"; - -parameter_declaration_qualifier = "in" | "out" | "inout"; - -boolean_literal = "true" | "false"; # TODO move boolean literal to lexer? - -precision_qualifier = "highp" - | "mediump" - | "lowp"; - -assignment_operator = - | - | - | - | - | # reserved - | # reserved - | # reserved - | # reserved - | # reserved - | ; # reserved - -comperator = | | | | | ; - -operator = - | - | - | - | - | - | # reserved - | - | - | # reserved - | # reserved - | # reserved - | ; # reserved - -unary_operator = - | - | - | ; # reserved - -increment_or_decrement_operator = | ; - -reserved = "asm" - | "common" - | "partition" - | "active" - | "class" - | "union" - | "enum" - | "typedef" - | "template" - | "this" - | "packed" - | "goto" - | "inline" - | "noinline" - | "volatile" - | "public" - | "static" - | "extern" - | "external" - | "interface" - | "long" - | "short" - | "double" - | "half" - | "fixed" - | "unsigned" - | "superp" - | "input" - | "output" - | "hvec2" - | "hvec3" - | "hvec4" - | "dvec2" - | "dvec3" - | "dvec4" - | "fvec2" - | "fvec3" - | "fvec4" - | "sampler2DRect" - | "sampler3DRect" - | "sampler2DRectShadow" - | "samplerBuffer" - | "filter" - | "image1D" - | "image2D" - | "image3D" - | "imageCube" - | "iimage1D" - | "iimage2D" - | "iimage3D" - | "iimageCube" - | "uimage1D" - | "uimage2D" - | "uimage3D" - | "uimageCube" - | "image1DArray" - | "image2DArray" - | "iimage1DArray" - | "iimage2DArray" - | "uimage1DArray" - | "uimage2DArray" - | "image1DShadow" - | "image2DShadow" - | "image1DArrayShadow" - | "image2DArrayShadow" - | "imageBuffer" - | "iimageBuffer" - | "uimageBuffer" - | "sizeof" - | "cast" - | "namespace" - | "using" - | "row_major"; - - -## declarations ################################################################ -declaration = [precision_qualifier] type_specifier_or_identifier [array_index] (function | (global_identifier_list [assignment2] )); -declaration = "void" function; -declaration = field_declaration ; -declaration = struct_declaration ; -declaration = precision_declaration ; -declaration = global_preprocessor; - -global_identifier_list = global_declared_identifier [array_index] ( global_declared_identifier [array_index])*; -global_declared_identifier = ; -global_preprocessor = ; - -field_declaration = ("in" | "uniform") type_specifier_or_identifier ; -field_declaration = global_type_qualifier struct_declaration; -field_declaration = global_type_qualifier global_type_declaration [assignment2]; - -struct_declaration = "struct" struct_body [global_identifier_list]; -struct_body = "{" (local_type_declaration )+ "}"; - -global_type_declaration = [precision_qualifier] type_specifier_or_identifier [array_index] global_identifier_list [ expression]; -type_declaration = [precision_qualifier] type_specifier_or_identifier [array_index] [array_index] ( [array_index])*; - -local_type_declaration = [type_qualifier] type_declaration; - -precision_declaration = "precision" precision_qualifier type_specifier; - -## function #################################################################### -function = "(" [parameter_declaration_list] ")" (function_body | ); -function_body = code_block; - -parameter_declaration = [type_qualifier] [parameter_declaration_qualifier] [precision_qualifier] type_specifier_or_identifier ((array_index ) | ( [array_index])); -parameter_declaration_list = "void" | (parameter_declaration ( parameter_declaration)*); - -statement = ; -statement = expression_hack ; # statement = local_type_declaration [ expression] ; -statement = conditional_statement; -statement = "return" [expression] ; -statement = "break" ; # break just in loops allowed -statement = "continue" ;# continue just in loops allowed -statement = "discard" ; # Fragment shader only. - -code_block = "{" code_block* "}"; -code_block = "{" statement* "}"; - -## expresstions and operations ################################################# -# ternary operator -expression = expression1 ["?" expression1 ":" expression1]; - -expression1 = [unary_operator] expression2 operation_or_comparison*; -expression1 = [unary_operator] "(" expression ")" operation_or_comparison*; - -expression2 = ( [increment_or_decrement_operator] ( | ) (field_access)* [increment_or_decrement_operator] [assignment]) - | ((function_call | constructor_call) (field_access)*) - | - | - | boolean_literal; - - - -expression_hack = unary_operator expression1_hack operation_or_comparison*; -expression_hack = unary_operator "(" expression ")" operation_or_comparison*; -expression_hack = expression1_hack operation_or_comparison*; -expression_hack = "(" expression ")" operation_or_comparison*; - -expression_hack = (field_access)* [increment_or_decrement_operator] [assignment]; -expression_hack = (field_access)* [array_index] ( [array_index])*; -expression_hack = type_specifier (field_access)* [array_index] ( [array_index])*; - -expression1_hack = (increment_or_decrement_operator ( | ) (field_access)* [increment_or_decrement_operator] [assignment]) - | ( (field_access)* [increment_or_decrement_operator] [assignment]) - | ((function_call | constructor_call) (field_access)*) - | - | - | boolean_literal; - - - -assignment = assignment_operator expression; -assignment2 = expression; -operation_or_comparison = (comperator | operator) expression; - -field_access = array_index; -field_access = ; - -array_index = "[" [expression] "]"; - -function_call = ( | ) "(" [expression_list] ")"; -# Note constructor call is something like that: vec2(1.0, 2.0) or float[2] (1.0, 2.0) -constructor_call = type_specifier [array_index] "(" [expression_list] ")"; #TODO custom structs - -expression_list = "void" | (expression ( expression)*); - -## code flow ################################################################### -conditional_statement = if_statement - | for_statement - | while_statement - | do_while_statement - | switch_statement; - -# TODO if rule not 100% correct, multiple else allowed even before else if -if_statement = "if" condition statement_or_code_block ("else" ["if" condition] statement_or_code_block)*; - -while_statement = "while" condition statement_or_code_block; -do_while_statement = "do" statement_or_code_block "while" condition ; - -# TODO for rule could be more restrictive -for_statement = "for" "(" [[type_specifier] assignment] [expression] [expression] ")" statement_or_code_block; - -switch_statement = "switch" condition "{" case* "}"; -case = ("case" expression ":" statement*) - | ("default" ":" statement*); - -condition = "(" expression ")"; -statement_or_code_block = (statement | code_block); - - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/Glsl.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/Glsl.java deleted file mode 100644 index 55673b3f2..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/glsl/Glsl.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Glsl.java - * - * Created on 24.09.2007, 00:46:53 - * - */ -package net.java.nboglpack.glsleditor.glsl; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.swing.text.AbstractDocument; -import net.java.nboglpack.glsleditor.lexer.GlslTokenId; -import net.java.nboglpack.glsleditor.vocabulary.GLSLElementDescriptor; -import org.netbeans.api.languages.ASTItem; -import org.netbeans.api.languages.ASTNode; -import org.netbeans.api.languages.ASTToken; -import org.netbeans.api.languages.SyntaxContext; -import org.netbeans.api.lexer.Token; -import org.netbeans.api.lexer.TokenHierarchy; -import org.netbeans.api.lexer.TokenSequence; -import org.netbeans.api.lexer.TokenUtilities; - -/** - * Utility methods called from GLSL.nbs. - * @author Michael Bien - */ -public final class Glsl { - - private final static String KEYWORD_FONT_COLOR = ""; - public final static Map declaredFunctions = new HashMap(); - - private Glsl() { - } - - /** - * Assembles a human readable String containing the declaraton of a function. - * Asumes that the current token of the SyntaxContext represents the function name. - */ - public static final String createFunctionDeclarationString(SyntaxContext context) { - - AbstractDocument document = (AbstractDocument) context.getDocument(); - - StringBuilder sb = new StringBuilder(); - - try { - - document.readLock(); - - TokenSequence sequence = TokenHierarchy.get(context.getDocument()).tokenSequence(); - sequence.move(context.getOffset()); - sequence.moveNext(); - - sb.append(""); - - int moved = 0; - while (sequence.movePrevious() && isIgnoredToken(sequence.token())) { - moved++; - } - - String type = sequence.token().toString(); - while (moved-- >= 0) { - sequence.moveNext(); - } - - // append function name - sb.append(sequence.token().text()); - - while (!TokenUtilities.equals(sequence.token().text(), "(")) { - sequence.moveNext(); - } - - sb.append("("); - - Token token; - boolean first = true; - while (sequence.moveNext() && !TokenUtilities.equals(sequence.token().text(), ")")) { - - token = sequence.token(); - - if (!isIgnoredToken(token)) { - - if (first) { - sb.append(KEYWORD_FONT_COLOR); - } else if (token.id() != GlslTokenId.COMMA && token.id() != GlslTokenId.BRACKET && token.id() != GlslTokenId.INTEGER_LITERAL) { - sb.append(" "); - } - - if (!TokenUtilities.equals(token.text(), "void")) { - - moved = 0; - while (sequence.moveNext() && isIgnoredToken(sequence.token())) { - moved++; - } - - if (sequence.token().id() == GlslTokenId.COMMA || TokenUtilities.equals(sequence.token().text(), ")")) { - sb.append(""); - } - - while (moved-- >= 0) { - sequence.movePrevious(); - } - - sb.append(token.text()); - - if (token.id() == GlslTokenId.COMMA) { - sb.append(KEYWORD_FONT_COLOR); - } - } - - first = false; - } - - } - - sb.append("
)"); - - if (!"void".equals(type)) { - sb.append(" : "); - sb.append(KEYWORD_FONT_COLOR); - sb.append(type); - sb.append(""); - } - sb.append(""); - - } finally { - document.readUnlock(); - } - - return sb.toString(); - } - - /** - * Assambles a human readable String containing the declaraton of a field and the field name itself. - * Asumes that the current token of the SyntaxContext represents the field name. - */ - public static final String createFieldDeclarationString(SyntaxContext context) { - - AbstractDocument document = (AbstractDocument) context.getDocument(); - - StringBuilder sb = new StringBuilder(); - - try { - - document.readLock(); - - TokenSequence sequence = TokenHierarchy.get(context.getDocument()).tokenSequence(); - sequence.move(context.getOffset()); - sequence.moveNext(); - - sb.append(""); - sb.append(sequence.token().text()); - sb.append(KEYWORD_FONT_COLOR); - sb.append(" :"); - - int insertIndex = sb.length(); - - // read forward - int moved = 0; - Token token; - while (sequence.moveNext() - && sequence.token().id() != GlslTokenId.SEMICOLON - && sequence.token().id() != GlslTokenId.COMMA - && sequence.token().id() != GlslTokenId.EQ) { - token = sequence.token(); - if (!isIgnoredToken(token)) { - sb.append(token); - } - moved++; - } - while (moved-- >= 0) { - sequence.movePrevious(); - } - - // read backwards throw the declaration - boolean skipToken = false; - - while (sequence.movePrevious() - && sequence.token().id() != GlslTokenId.SEMICOLON - && sequence.token().id() != GlslTokenId.END_OF_LINE) { - - token = sequence.token(); - - if (!isIgnoredToken(token)) { - - // we have a struct declaration; skip everything between { } - if (token.id() == GlslTokenId.BRACE && TokenUtilities.equals(token.text(), "}")) { - movePreviousUntil(sequence, GlslTokenId.BRACE, "}", "{"); - continue; - } - - // skip token in case of an comma seperated identifier list - if (skipToken) { - if (token.id() == GlslTokenId.BRACKET - && TokenUtilities.equals(token.text(), "]")) { - movePreviousUntil(sequence, GlslTokenId.BRACKET, "]", "["); - skipToken = false; - } else { - skipToken = false; - } - continue; - } - - if (token.id() == GlslTokenId.COMMA) { - skipToken = true; - continue; - } - - if (!TokenUtilities.equals(token.text(), "struct")) { - sb.insert(insertIndex, token.text()); - sb.insert(insertIndex, " "); - } - } - - } - - sb.append(""); - } finally { - document.readUnlock(); - } - - - return sb.toString(); - } - - public static final String createPreprocessorString(SyntaxContext context) { - - ASTNode node = (ASTNode) context.getASTPath().getLeaf(); - List children = node.getChildren(); - - String str = null; - - for (ASTItem item : children) { - if (isTokenType(item, GlslTokenId.PREPROCESSOR.name())) { - str = ((ASTToken) item).getIdentifier(); - } - } - - - for (int i = 0; i < str.length(); i++) { - - char c = str.charAt(i); - - if (c != '#' && !Character.isWhitespace(c)) { - for (int j = str.length() - 1; j > i; j--) { - if (!Character.isWhitespace(str.charAt(j))) { - return str.substring(i, j + 1); - } - } - } - - } - - return str; - } - - /** - * Called from withen GLSL_*.nbs each time the document has been modified. - */ - public static void process(SyntaxContext context) { - - AbstractDocument document = (AbstractDocument) context.getDocument(); - try { - document.readLock(); - - // remember all declared functions for auto-completion - synchronized (declaredFunctions) { - declaredFunctions.clear(); - } - - List declarations = context.getASTPath().getLeaf().getChildren(); - - for (ASTItem declaration : declarations) { - - for (ASTItem declarationItem : declaration.getChildren()) { - - if (isNode(declarationItem, "function")) { - - List functionItems = declarationItem.getChildren(); - - if (functionItems.size() < 3) { - break; - } - - ASTItem nameToken = functionItems.get(0); - - if (isTokenType(nameToken, GlslTokenId.FUNCTION.name())) { - - // determine return type - StringBuilder returnType = new StringBuilder(); - for (ASTItem typeItem : declaration.getChildren()) { - - if (isNode(typeItem, "function")) { - break; - } - - if (typeItem instanceof ASTNode) { - returnType.append(((ASTNode) typeItem).getAsText().trim()); - } else if (typeItem instanceof ASTToken) { - final ASTToken t = (ASTToken) typeItem; - returnType.append(t.getIdentifier().trim()); - } - - } - - // determine name and parameter list - StringBuilder name = new StringBuilder(); - - name.append("("); - ASTItem parameterList = functionItems.get(2); - if (isNode(parameterList, "parameter_declaration_list")) { - name.append(((ASTNode) parameterList).getAsText()); - } - name.append(")"); - - GLSLElementDescriptor elementDesc = new GLSLElementDescriptor( - GLSLElementDescriptor.Category.USER_FUNC, - "", - "", - name.toString(), - returnType.toString()); - - name.insert(0, ((ASTToken) nameToken).getIdentifier()); - - synchronized (declaredFunctions) { - declaredFunctions.put(name.toString(), elementDesc); - } - -// System.out.println("|"+returnType.toString()+"|"+name.toString()+"|"); - } - - break; - } - } - } - } finally { - document.readUnlock(); - } - - - } - - private static void movePreviousUntil(TokenSequence sequence, GlslTokenId id, String countToken, String stopToken) { - int counter = 1; - while (sequence.movePrevious() && counter > 0) { - if (sequence.token().id() == id) { - if (TokenUtilities.equals(sequence.token().text(), stopToken)) { - counter--; - } else if (TokenUtilities.equals(sequence.token().text(), countToken)) { - counter++; - } - } - } - } - - private static boolean isIgnoredToken(Token token) { - return token.id() == GlslTokenId.WHITESPACE - || token.id() == GlslTokenId.COMMENT - || token.id() == GlslTokenId.PREPROCESSOR; - } - - private static boolean isNode(ASTItem item, String nodeToken) { - return item != null && item instanceof ASTNode && ((ASTNode) item).getNT().equals(nodeToken); - } - - private static boolean isToken(ASTItem item, String id) { - return item != null && item instanceof ASTToken && ((ASTToken) item).getIdentifier().equals(id); - } - - private static boolean isTokenType(ASTItem item, String type) { - return item != null && item instanceof ASTToken && ((ASTToken) item).getTypeName().equals(type); - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/layer.xml b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/layer.xml deleted file mode 100644 index 320827890..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/layer.xml +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/lexer/Glsl.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/lexer/Glsl.java deleted file mode 100644 index 70404b62a..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/lexer/Glsl.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * VertexLanguage.java - * - * Created on 19.08.2007, 18:25:24 - * - */ -package net.java.nboglpack.glsleditor.lexer; - -import java.util.Collection; -import java.util.EnumSet; -import net.java.nboglpack.glsleditor.GlslVocabularyManager; -import net.java.nboglpack.glsleditor.dataobject.GlslFragmentShaderDataLoader; -import net.java.nboglpack.glsleditor.dataobject.GlslGeometryShaderDataLoader; -import net.java.nboglpack.glsleditor.dataobject.GlslVertexShaderDataLoader; -import org.netbeans.api.lexer.Language; -import org.netbeans.spi.lexer.LanguageHierarchy; -import org.netbeans.spi.lexer.Lexer; -import org.netbeans.spi.lexer.LexerRestartInfo; - -/** - * OpenGL Shading Language. - * @author Michael Bien - */ -public class Glsl extends LanguageHierarchy { - - public static final Glsl VERTEX_LANGUAGE = new Glsl(GlslVertexShaderDataLoader.REQUIRED_MIME); - public static final Glsl GEOMETRY_LANGUAGE = new Glsl(GlslGeometryShaderDataLoader.REQUIRED_MIME); - public static final Glsl FRAGMENT_LANGUAGE = new Glsl(GlslFragmentShaderDataLoader.REQUIRED_MIME); - private final String mimeType; - - private Glsl(String mimeType) { - this.mimeType = mimeType; - } - - @Override - protected String mimeType() { - return mimeType; - } - - @Override - protected Collection createTokenIds() { - return EnumSet.allOf(GlslTokenId.class); - } - - @Override - protected Lexer createLexer(LexerRestartInfo info) { - return new GlslLexer(info, GlslVocabularyManager.getInstance(mimeType())); - } - - public static Language vertexLanguage() { - return VERTEX_LANGUAGE.language(); - } - - public static Language fragmentLanguage() { - return FRAGMENT_LANGUAGE.language(); - } - - public static Language geometryLanguage() { - return GEOMETRY_LANGUAGE.language(); - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/lexer/GlslLexer.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/lexer/GlslLexer.java deleted file mode 100644 index 84949abd7..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/lexer/GlslLexer.java +++ /dev/null @@ -1,339 +0,0 @@ -/* - * GlslLexer.java - * - * Created on 19.08.2007, 18:31:16 - * - */ -package net.java.nboglpack.glsleditor.lexer; - -import net.java.nboglpack.glsleditor.GlslVocabularyManager; -import net.java.nboglpack.glsleditor.vocabulary.GLSLElementDescriptor; -import org.netbeans.api.lexer.Token; -import org.netbeans.spi.lexer.Lexer; -import org.netbeans.spi.lexer.LexerInput; -import org.netbeans.spi.lexer.LexerRestartInfo; -import org.netbeans.spi.lexer.TokenFactory; - -/** - * Lexer for the OpenGL Shading Language. - * @author Michael Bien - */ -public class GlslLexer implements Lexer { - - private final LexerInput input; - private final TokenFactory factory; - private final GlslVocabularyManager manager; - private final StringBuilder stringBuilder; - - public GlslLexer(LexerRestartInfo info, GlslVocabularyManager manager) { - this.input = info.input(); - this.factory = info.tokenFactory(); - this.manager = manager; - this.stringBuilder = new StringBuilder(); - } - - @SuppressWarnings("fallthrough") - public Token nextToken() { - - int character = input.read(); - switch (character) { - case '(': - case ')': - return factory.createToken(GlslTokenId.PAREN); - case '{': - case '}': - return factory.createToken(GlslTokenId.BRACE); - case '[': - case ']': - return factory.createToken(GlslTokenId.BRACKET); - case '.': - return factory.createToken(GlslTokenId.DOT); - case ',': - return factory.createToken(GlslTokenId.COMMA); - case ':': - return factory.createToken(GlslTokenId.COLON); - case ';': - return factory.createToken(GlslTokenId.SEMICOLON); - case '?': - return factory.createToken(GlslTokenId.QUESTION); - case '~': - return factory.createToken(GlslTokenId.TILDE); - case '*': - if (input.read() == '=') { - return factory.createToken(GlslTokenId.MUL_ASSIGN); - } else { - input.backup(1); - return factory.createToken(GlslTokenId.STAR); - } - case '%': - if (input.read() == '=') { - return factory.createToken(GlslTokenId.MOD_ASSIGN); - } else { - input.backup(1); - return factory.createToken(GlslTokenId.PERCENT); - } - case '!': - if (input.read() == '=') { - return factory.createToken(GlslTokenId.NE); - } else { - input.backup(1); - return factory.createToken(GlslTokenId.BANG); - } - case '=': - if (input.read() == '=') { - return factory.createToken(GlslTokenId.EQEQ); - } else { - input.backup(1); - return factory.createToken(GlslTokenId.EQ); - } - case '^': - switch (input.read()) { - case ('^'): - return factory.createToken(GlslTokenId.CARETCARET); - case ('='): - return factory.createToken(GlslTokenId.XOR_ASSIGN); - default: - input.backup(1); - return factory.createToken(GlslTokenId.CARET); - } - case '+': - switch (input.read()) { - case ('+'): - return factory.createToken(GlslTokenId.PLUSPLUS); - case ('='): - return factory.createToken(GlslTokenId.ADD_ASSIGN); - default: - input.backup(1); - return factory.createToken(GlslTokenId.PLUS); - } - case '-': - switch (input.read()) { - case ('-'): - return factory.createToken(GlslTokenId.MINUSMINUS); - case ('='): - return factory.createToken(GlslTokenId.SUB_ASSIGN); - default: - input.backup(1); - return factory.createToken(GlslTokenId.MINUS); - } - case '&': - switch (input.read()) { - case ('&'): - return factory.createToken(GlslTokenId.AMPAMP); - case ('='): - return factory.createToken(GlslTokenId.AND_ASSIGN); - default: - input.backup(1); - return factory.createToken(GlslTokenId.AMP); - } - case '|': - switch (input.read()) { - case ('|'): - return factory.createToken(GlslTokenId.BARBAR); - case ('='): - return factory.createToken(GlslTokenId.OR_ASSIGN); - default: - input.backup(1); - return factory.createToken(GlslTokenId.BAR); - } - case '<': - switch (input.read()) { - case ('<'): - if (input.read() == '=') { - return factory.createToken(GlslTokenId.LEFT_BITSHIFT_ASSIGN); - } else { - input.backup(1); - return factory.createToken(GlslTokenId.LEFT_BITSHIFT); - } - case ('='): - return factory.createToken(GlslTokenId.LE); - default: - input.backup(1); - return factory.createToken(GlslTokenId.LEFT_ANGLE); - } - case '>': - switch (input.read()) { - case ('>'): - if (input.read() == '=') { - return factory.createToken(GlslTokenId.RIGHT_BITSHIFT_ASSIGN); - } else { - input.backup(1); - return factory.createToken(GlslTokenId.RIGHT_BITSHIFT); - } - case ('='): - return factory.createToken(GlslTokenId.GE); - default: - input.backup(1); - return factory.createToken(GlslTokenId.RIGHT_ANGLE); - } - case '/': - int c = input.read(); - if (c == '/') { - readRemainingLine(); - return factory.createToken(GlslTokenId.COMMENT); - } else if (c == '*') { - return tokenizeMLComment(); - } else if (c == '=') { - return factory.createToken(GlslTokenId.DIV_ASSIGN); - } else { - input.backup(1); - return factory.createToken(GlslTokenId.SLASH); - } - case '#': - readRemainingLine(); - return factory.createToken(GlslTokenId.PREPROCESSOR); - case ' ': - case '\t': - do { - character = input.read(); - } while (character == ' ' || character == '\t'); - input.backup(1); - return factory.createToken(GlslTokenId.WHITESPACE); - case '\r': - input.consumeNewline(); - case LexerInput.EOF: - if (input.readLength() == 0) { - return null; - } - case '\n': - return factory.createToken(GlslTokenId.END_OF_LINE); - default: - if (Character.isDigit(character)) { - return tokenizeNumber(); - } else if (Character.isUnicodeIdentifierStart(character)) { - return tokenizeName(); - } else { - return factory.createToken(GlslTokenId.error); - } - } - - } - - @SuppressWarnings("fallthrough") - private void readRemainingLine() { - - int character = input.read(); - - while (character != LexerInput.EOF) { - switch (character) { - case '\r': - input.consumeNewline(); - case '\n': - case LexerInput.EOF: - return; - } - character = input.read(); - } - - } - - private Token tokenizeMLComment() { - - int character = input.read(); - - while (character != LexerInput.EOF) { - if (character == '*' && input.read() == '/') { - return factory.createToken(GlslTokenId.ML_COMMENT); - } - character = input.read(); - } - return factory.createToken(GlslTokenId.ML_COMMENT); - - } - - private Token tokenizeNumber() { - - int character; - - do { - character = input.read(); - } while (Character.isDigit(character)); - - if (character == '.') { - - do { - character = input.read(); - } while (Character.isDigit(character)); - - if (character != 'f' && character != 'F') { - input.backup(1); - } - - return factory.createToken(GlslTokenId.FLOAT_LITERAL); - - } else { - - if (character != 'u' && character != 'U') { - input.backup(1); - } - - return factory.createToken(GlslTokenId.INTEGER_LITERAL); - - } - } - - private Token tokenizeName() { - - if (stringBuilder.length() > 0) { - stringBuilder.delete(0, stringBuilder.length()); - } - - // backup everything read - input.backup(input.readLength()); - - // assamble token - char c; - while (Character.isUnicodeIdentifierPart(c = ((char) input.read()))) { - stringBuilder.append(c); - } - - if (stringBuilder.length() > 0) { - input.backup(1); - } - - // categorise token - GLSLElementDescriptor[] desc = manager.getDesc(stringBuilder.toString()); - - if (desc != null) { - if (desc[0].category != null) { - if (desc[0].category == GLSLElementDescriptor.Category.BUILD_IN_FUNC) { - return factory.createToken(GlslTokenId.BUILD_IN_FUNC); - } - if (desc[0].category == GLSLElementDescriptor.Category.BUILD_IN_VAR) { - return factory.createToken(GlslTokenId.BUILD_IN_VAR); - } - return factory.createToken(GlslTokenId.KEYWORD); - } - } - - // check if token = function name - int tokenEnd = input.readLength(); - int character = input.read(); - - while (true) { - switch (character) { - case ' ': - case '\t': - case '\r': - case '\n': - character = input.read(); - break; - case '(': - input.backup(input.readLength() - tokenEnd); - return factory.createToken(GlslTokenId.FUNCTION); - default: - input.backup(input.readLength() - tokenEnd); - return factory.createToken(GlslTokenId.IDENTIFIER); - } - } - - } - - public Object state() { - // we don't need states - return null; - } - - public void release() { - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/lexer/GlslTokenId.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/lexer/GlslTokenId.java deleted file mode 100644 index 3e18462b8..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/lexer/GlslTokenId.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * GlslTokenId.java - * - * Created on 19.08.2007, 18:09:00 - * - */ - -package net.java.nboglpack.glsleditor.lexer; - -import org.netbeans.api.lexer.TokenId; - -/** - * Enumeration of GLSL token ids. - * @author Michael Bien - */ -public enum GlslTokenId implements TokenId { - - IDENTIFIER("glsl-name"), - INTEGER_LITERAL("glsl-literal"), - FLOAT_LITERAL("glsl-literal"), - FUNCTION("glsl-function"), - KEYWORD("glsl-keyword"), - BUILD_IN_FUNC("glsl-build-in-func"), - BUILD_IN_VAR("glsl-build-in-var"), - COMMENT("glsl-comment"), - ML_COMMENT("glsl-comment"), - - PAREN("glsl-paren"), - BRACE("glsl-brace"), - BRACKET("glsl-bracket"), - LEFT_ANGLE("glsl-angle"), - RIGHT_ANGLE("glsl-angle"), - - SEMICOLON("glsl-separator"), - COMMA("glsl-separator"), - DOT("glsl-separator"), - COLON("glsl-separator"), - - PERCENT("glsl-operation"), - STAR("glsl-operation"), - TILDE("glsl-operation"), - QUESTION("glsl-operation"), - BANG("glsl-operation"), - SLASH("glsl-operation"), - LEFT_BITSHIFT("glsl-operation"), - RIGHT_BITSHIFT("glsl-operation"), - PLUS("glsl-operation"), - PLUSPLUS("glsl-operation"), - MINUS("glsl-operation"), - MINUSMINUS("glsl-operation"), - AMP("glsl-operation"), - AMPAMP("glsl-operation"), - EQ("glsl-operation"), - EQEQ("glsl-operation"), - NE("glsl-operation"), - LE("glsl-operation"), - GE("glsl-operation"), - BAR("glsl-operation"), - BARBAR("glsl-operation"), - CARET("glsl-operation"), - CARETCARET("glsl-operation"), - ADD_ASSIGN("glsl-operation"), - SUB_ASSIGN("glsl-operation"), - MUL_ASSIGN("glsl-operation"), - DIV_ASSIGN("glsl-operation"), - AND_ASSIGN("glsl-operation"), - OR_ASSIGN("glsl-operation"), - XOR_ASSIGN("glsl-operation"), - MOD_ASSIGN("glsl-operation"), - LEFT_BITSHIFT_ASSIGN("glsl-operation"), - RIGHT_BITSHIFT_ASSIGN("glsl-operation"), - - WHITESPACE("glsl-whitespace"), - END_OF_LINE("glsl-end-of-line"), - PREPROCESSOR("glsl-preprocessor"), - - error("glsl-error"); - - private final String primaryCategory; - - private GlslTokenId(String primaryCategory) { - this.primaryCategory = primaryCategory; - } - - public String primaryCategory() { - return primaryCategory; - } - -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/opengl-icon.gif b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/opengl-icon.gif deleted file mode 100644 index f5dce676a..000000000 Binary files a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/opengl-icon.gif and /dev/null differ diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/FragmentShaderIcon.gif b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/FragmentShaderIcon.gif deleted file mode 100644 index 5e79af311..000000000 Binary files a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/FragmentShaderIcon.gif and /dev/null differ diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/FragmentShaderTemplate.frag b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/FragmentShaderTemplate.frag deleted file mode 100644 index d229255d3..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/FragmentShaderTemplate.frag +++ /dev/null @@ -1,8 +0,0 @@ -/* -* fragment shader template -*/ -void main() { - // Set the fragment color for example to gray, alpha 1.0 - gl_FragColor = vec4(0.5, 0.5, 0.5, 1.0); -} - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GeometryShaderIcon.gif b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GeometryShaderIcon.gif deleted file mode 100644 index 37f3defce..000000000 Binary files a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GeometryShaderIcon.gif and /dev/null differ diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GeometryShaderTemplate.geom b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GeometryShaderTemplate.geom deleted file mode 100644 index 9bf537bbb..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GeometryShaderTemplate.geom +++ /dev/null @@ -1,26 +0,0 @@ -/* -* geometry shader template -*/ - -#version 120 -#extension GL_EXT_geometry_shader4 : enable - -// a passthrough geometry shader for color and position -void main(void) { - - for(int i = 0; i < gl_VerticesIn; ++i) { - - // copy color - gl_FrontColor = gl_FrontColorIn[i]; - - // copy position - gl_Position = gl_PositionIn[i]; - - // done with the vertex - EmitVertex(); - - } - - EndPrimitive(); - -} \ No newline at end of file diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslFragmentShaderExample.frag b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslFragmentShaderExample.frag deleted file mode 100644 index 6cd13f106..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslFragmentShaderExample.frag +++ /dev/null @@ -1,28 +0,0 @@ -// ------ Fragment shader ------ // - -#pragma debug(on) - -varying vec3 normal; - -/* -* Toon shader -*/ -void main() { - - float intensity; - vec4 color; - vec3 n = normalize(normal); - - intensity = dot(vec3(gl_LightSource[0].position),n); - - if (intensity > 0.95) - color = vec4(1.0,0.5,0.5,1.0); - else if (intensity > 0.5) - color = vec4(0.6,0.3,0.3,1.0); - else if (intensity > 0.25) - color = vec4(0.4,0.2,0.2,1.0); - else - color = vec4(0.2,0.1,0.1,1.0); - - gl_FragColor = color; -} \ No newline at end of file diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslFragmentShaderResolver.xml b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslFragmentShaderResolver.xml deleted file mode 100644 index 824a55326..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslFragmentShaderResolver.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslGeometryShaderExample.geom b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslGeometryShaderExample.geom deleted file mode 100644 index cf7776827..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslGeometryShaderExample.geom +++ /dev/null @@ -1,26 +0,0 @@ -// ------ Geometry shader ------ // - -#version 120 -#extension GL_EXT_geometry_shader4 : enable - -/* -* a passthrough geometry shader for color and position -*/ -void main() { - - for(int i = 0; i < gl_VerticesIn; ++i) { - - // copy color - gl_FrontColor = gl_FrontColorIn[i]; - - // copy position - gl_Position = gl_PositionIn[i]; - - // done with the vertex - EmitVertex(); - - } - - EndPrimitive(); - -} \ No newline at end of file diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslGeometryShaderResolver.xml b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslGeometryShaderResolver.xml deleted file mode 100644 index 3f3221ed9..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslGeometryShaderResolver.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslVertexShaderExample.vert b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslVertexShaderExample.vert deleted file mode 100644 index a147153ab..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslVertexShaderExample.vert +++ /dev/null @@ -1,29 +0,0 @@ -// ------ Vertex shader ------ // - -#pragma debug(on) - -uniform vec3 LightPosition; -const float SpecularContribution = 0.3; -varying float LightIntensity; - -/* -* main function -*/ -void main() { - - vec3 ecPosition = vec3 (gl_ModelViewMatrix * gl_Vertex); - vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal); - vec3 lightVec = normalize(LightPosition - ecPosition); - vec3 reflectVec = reflect(-lightVec, tnorm); - vec3 viewVec = normalize(-ecPosition); - float diffuse = max(dot(lightVec, tnorm), 0.0); - float spec = 0.0; - - if (diffuse > 0.0) { - spec = max(dot(reflectVec, viewVec), 0.0); - spec = pow(spec, 16.0); - } - - LightIntensity = 0.7 * diffuse + SpecularContribution * spec; - gl_Position = ftransform(); -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslVertexShaderResolver.xml b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslVertexShaderResolver.xml deleted file mode 100644 index 39191a88f..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslVertexShaderResolver.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslVocabulary.xml b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslVocabulary.xml deleted file mode 100644 index b956ddb9e..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/GlslVocabulary.xml +++ /dev/null @@ -1,4724 +0,0 @@ - - - - - pow - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3) - vec3 - - - BUILD_IN_FUNC - (vec4, vec4) - vec4 - - - - - float - - - TYPE - single floating-point scalar - - - - - dot - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2) - float - - - BUILD_IN_FUNC - (vec3, vec3) - float - - - BUILD_IN_FUNC - (vec4, vec4) - float - - - - - gl_MaxFragmentUniformComponents - - - BUILD_IN_VAR - value >= 64 ARB_fragment_shader required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum allowed uniform - components inside the fragment shader.<br> This limit refers to the storage - for the combination of build-in uniform variables and user-defined uniform - variables that are actually used in a fragment shader. This constant can - be also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB</i>. - The minimum value is 64 if <i>ARB_fragment_shader</i> is supported. - </body> -</html> - - const int - - - - - else - - - SELECTION - - - - - gl_BackLightProduct - - - BUILD_IN_VAR - INDEX < gl_MaxLights - [] - uniform gl_LightProducts - - - - - mod - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, float) - vec2 - - - BUILD_IN_FUNC - (vec3, float) - vec3 - - - BUILD_IN_FUNC - (vec4, float) - vec4 - - - - - gl_MaxVertexAttribs - - - BUILD_IN_VAR - value >= 16 ARB_vertex_shader required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum useable vertex attributes - in a vertex shader.<br> This limit consists of the standard (build-in) attributes (these are color, secondary color, normal, vertex position, texture coordinates, and fog coordinates) and the generic attributes left for custom purposes. This constant can be also queried by calling <b>glGetIntegerv</b> - with the symbolic constant <i>GL_MAX_VERTEX_ATTRIBS_ARB</i>. Every OpenGL - implementation is required to support at least 16 vertex attributes in a - vertex shader. - </body> -</html> - - const int - - - - - log - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - texture2DLod - - - BUILD_IN_FUNC - (sampler2D, vec2, float lod) - vec4 - - - - - uvec2 - - - TYPE - a two-component unsigned integer vector - <html> - <head> - - </head> - <body> - a two-component unsigned integer vector - </body> -</html> - - - - - - floor - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - uvec3 - - - TYPE - a three-component unsigned integer vector - <html> - <head> - - </head> - <body> - a three-component unsigned integer vector - </body> -</html> - - - - - - uvec4 - - - TYPE - a four-component unsigned integer vector - <html> - <head> - - </head> - <body> - a four-component unsigned integer vector - </body> -</html> - - - - - - faceforward - - - BUILD_IN_FUNC - (float, float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2, vec2) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3, vec3) - vec3 - - - BUILD_IN_FUNC - (vec4 V, vec4 I, vec4 N) - vec4 - - - - - gl_TextureMatrixTranspose - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform mat4 - - - - - smooth - - - QUALIFIER - perspective correct interpolation - <html> - <head> - - </head> - <body> - <p> - perspective correct interpolation - </p> - </body> -</html> - - - - - - usampler2DArray - - - TYPE - a handle for accessing an unsigned integer 2D array texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 2D array texture - </body> -</html> - - - - - - ceil - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - smoothstep - - - BUILD_IN_FUNC - (float, float, float) - float - - - BUILD_IN_FUNC - (float, float, vec2) - vec2 - - - BUILD_IN_FUNC - (float, float, vec3) - vec3 - - - BUILD_IN_FUNC - (float, float, vec4) - vec4 - - - - - texture2DProjLod - - - BUILD_IN_FUNC - (sampler2D, vec3, float lod) - vec4 - - - BUILD_IN_FUNC - (sampler2D, vec4, float lod) - vec4 - - - - - isampler1D - - - TYPE - a handle for accessing an integer 1D texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 1D texture - </body> -</html> - - - - - - do - - - ITERATION - - - - - texture1DProjLod - - - BUILD_IN_FUNC - (sampler1D, vec2, float lod) - vec4 - - - BUILD_IN_FUNC - (sampler1D, vec4, float lod) - vec4 - - - - - max - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, float) - vec2 - - - BUILD_IN_FUNC - (vec3, float) - vec3 - - - BUILD_IN_FUNC - (vec4, float) - vec4 - - - - - sqrt - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - shadow1DProjLod - - - BUILD_IN_FUNC - (sampler1DShadow, vec4, float lod) - vec4 - - - - - highp - - - QUALIFIER - <html> - <head> - - </head> - <body> - qualifier for high precision - </body> -</html> - - - - - - gl_MaxVertexUniformComponents - - - BUILD_IN_VAR - value >= 512 ARB_vertex_shader required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum allowed uniform - components inside the vertex shader.<br> This limit refers to the storage for - the combination of build-in uniform variables and user-defined uniform - variables that are actually used in a vertex shader. This constant can be - also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB</i>. - The minimum value is 512 if <i>ARB_vertex_shader</i> is supported. - </body> -</html> - - const int - - - - - noise4 - - - BUILD_IN_FUNC - (float) - vec4 - - - BUILD_IN_FUNC - (vec2) - vec4 - - - BUILD_IN_FUNC - (vec3) - vec4 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - clamp - - - BUILD_IN_FUNC - (float, float, float) - float - - - BUILD_IN_FUNC - (vec2, float, float) - vec2 - - - BUILD_IN_FUNC - (vec3, float, float) - vec3 - - - BUILD_IN_FUNC - (vec4, float, float) - vec4 - - - - - sin - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric sine function. Angle in radians. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric sine function. Angle in radians. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric sine function. Angle in radians. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric sine function. Angle in radians. - </body> - </html> - - (vec4) - vec4 - - - - - noise2 - - - BUILD_IN_FUNC - (float) - vec2 - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec2 - - - BUILD_IN_FUNC - (vec4) - vec2 - - - - - noise3 - - - BUILD_IN_FUNC - (float) - vec3 - - - BUILD_IN_FUNC - (vec2) - vec3 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec3 - - - - - noise1 - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - float - - - BUILD_IN_FUNC - (vec3) - float - - - BUILD_IN_FUNC - (vec4) - float - - - - - gl_ProjectionMatrixInverseTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - reflect - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3) - vec3 - - - BUILD_IN_FUNC - (vec4 I, vec4 N) - vec4 - - - - - vec4 - - - TYPE - four component floating-point vector - - - - - cos - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric cosine function. Angle in radians. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric cosine function. Angle in radians. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric cosine function. Angle in radians. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric cosine function. Angle in radians. - </body> - </html> - - (vec4) - vec4 - - - - - centroid - - - QUALIFIER - centroid interpolation on multi-sample varyings - <html> - <head> - - </head> - <body> - Examples: - - <blockquote> - <code><nobr>centroid varying vec4 color;</nobr><br><nobr>centroid varying float value;</nobr></code> - </blockquote> - By definition, varying variables are set per vertex and are interpolated - in a perspective-correct manner over the primitive being rendered. - - <ul> - <li> - If single-sampling, the value is interpolated to the pixel's center, - and the <b>centroid </b>qualifier, if present, is ignored. - </li> - <li> - If multi-sampling, and <b>varying</b> is not qualified with <b>centroid</b>, - then the value must be interpolated to the pixel's center, or anywhere - within the pixel, or to one of the pixel's samples. - </li> - <li> - If multi-sampling and <b>varying </b>is qualified with <b>centroid</b>, - then the value must be interpolated to a point that lies in both the - pixel and in the primitive being rendered, or to one of the pixel's - samples that falls within the primitive. Due to the less regular - location of centroids, their derivatives may be less accurate than - non-centroid varying variables. - </li> - </ul> - <p> - When using the <b>centroid </b>keyword, it must immediately precede the <b>varying - </b>keyword. A fragment shader may read from varying variables and the - value read will be the interpolated value, as a function of the - fragment's position within the primitive. A fragment shader can not - write to a varying variable. - </p> - <p> - The type and presence of the <b>centroid </b>and <b>invariant </b>qualifiers - of varying variables with the same name declared in linked vertex and - fragments shaders must match, otherwise the link command will fail. Only - those varying variables used (i.e. read) in the fragment shader - executable must be written to by the vertex shader executable; declaring - superfluous varying variables in a vertex shader is permissible. - </p> - </body> -</html> - - - - - - texture1D - - - BUILD_IN_FUNC - (sampler1D, float, float bias) - vec4 - - - - - ivec4 - - - TYPE - four component integer vector - - - - - ivec3 - - - TYPE - three component integer vector - - - - - shadow2D - - - BUILD_IN_FUNC - (sampler2DShadow, vec3, float bias) - vec4 - - - - - varying - - - QUALIFIER - output from Vertex shader (READ/WRITE), interpolated, then input to Fragment shader (READ-ONLY) - <html> - <head> - - </head> - <body> - <p> - <b>Deprecated since 1.3, use <i>smooth</i> instead</b> - </p> - <p> - </p> - Varying variables provide the interface between the vertex shader and - geometry shader and also between the geometry shader and fragment shader - and the fixed functionality between them. If no geometry shader is - present, <b>varying</b> variables also provide the interface between the - vertex shader and fragment shader. - - <p> - The vertex, or geometry shader will compute values per vertex (such as - color, texture coordinates, etc) and write them to output variables - declared with the &quot;varying&quot; qualifier (vertex) or &quot;varying out&quot; - qualifiers (geometry). A vertex or geometry shader may also read these - output varying variables, getting back the same values it has written. - Reading an output varying variable in a vertex or geometry shader - returns undefined results if it is read before being written. - </p> - <p> - A geometry shader may also read from an input <b>varying</b> variable - declared with the &quot;varying in&quot; qualifiers. The value read will be the - same value as written by the vertex shader for that <b>varying</b> - variable. Since a geometry shader operates on primitives, each input - varying variable needs to be declared as an array. Each element of such - an array corresponds to a vertex of the primitive being processed. If - the varying variable is declared as a scalar or matrix in the vertex - shader, it will be a one-dimensional array in the geometry shader. Each - array can optionally have a size declared. If a size is not specified, - it inferred by the linker and depends on the value of the input - primitive type. See table 4.3.xxx (GLSL specification) to determine the - exact size. The read-only built-in constant <b>gl_VerticesIn</b> will be - set to this value by the linker. If a size is specified, it has to be - the size as given by table 4.3.xxx, otherwise a link error will occur. - The built-in constant <b>gl_VerticesIn</b>, if so desired, can be used - to size the array correctly for each input primitive type. Varying - variables can also be declared as arrays in the vertex shader. This - means that those, on input to the geometry shader, must be declared as - two- dimensional arrays. The first index to the two-dimensional array - holds the vertex number. Declaring a size for the first range of the - array is optional, just as it is for one-dimensional arrays. The second - index holds the per-vertex array data. Declaring a size for the second - range of the array is not optional, and has to match the declaration in - the vertex shader. - </p> - <p> - By definition, varying variables are set per vertex and are interpolated - in a perspective-correct manner over the primitive being rendered. If - single-sampling, the value is interpolated to the pixel's center, and - the <b>centroid </b>qualifier, if present, is ignored. If - multi-sampling, and <b>varying</b> is not qualified with <b>centroid</b>, - then the value must be interpolated to the pixel's center, or anywhere - within the pixel, or to one of the pixel's samples. If multi-sampling - and <b>varying </b>is qualified with <b>centroid</b>, then the value - must be interpolated to a point that lies in both the pixel and in the - primitive being rendered, or to one of the pixel's samples that falls - within the primitive. Due to the less regular location of centroids, - their derivatives may be less accurate than non-centroid varying - variables. - </p> - <p> - When using the <b>centroid </b>keyword, it must immediately precede the <b>varying - </b>keyword. A fragment shader may read from varying variables and the - value read will be the interpolated value, as a function of the - fragment's position within the primitive. A fragment shader can not - write to a varying variable. - </p> - <p> - The type and presence of the <b>centroid </b>and <b>invariant </b>qualifiers - of varying variables with the same name declared in linked vertex and - fragments shaders must match, otherwise the link command will fail. Only - those varying variables used (i.e. read) in the fragment shader - executable must be written to by the vertex shader executable; declaring - superfluous varying variables in a vertex shader is permissible. - </p> - <p> - Varying variables are declared as in the following examples: - </p> - <blockquote> - <nobr><code>varying vec3 normal;</code></nobr><code><br><nobr>centroid - varying vec2 TexCoord;</nobr><br><nobr>invariant centroid varying vec4 - Color;</nobr><br></code> - </blockquote> - <p> - The <b>varying </b>qualifier can be used only with <b>float</b>, - floating-point vectors, matrices, or arrays of these. Structures cannot - be <b>varying</b>. If no vertex shader executable is active, the fixed - functionality pipeline of OpenGL will compute values for the built-in - varying variables that will be consumed by the fragment shader - executable. Similarly, if no fragment shader executable is active, the - vertex shader executable is responsible for computing and writing to the - varying variables that are needed for OpenGL's fixed functionality - fragment pipeline. Varying variables are required to have global scope, - and must be declared outside of function bodies, before their first use. - </p> - </body> -</html> - - - - - - any - - - BUILD_IN_FUNC - (bvec2) - bool - - - BUILD_IN_FUNC - (bvec3) - bool - - - BUILD_IN_FUNC - (bvec4) - bool - - - - - notEqual - - - BUILD_IN_FUNC - (bvec2, bvec2) - bvec2 - - - BUILD_IN_FUNC - (bvec3, bvec3) - bvec3 - - - BUILD_IN_FUNC - (bvec4, bvec4) - bvec4 - - - - - ivec2 - - - TYPE - two component integer vector - - - - - sampler1DArray - - - TYPE - a handle for accessing a 1D array texture - <html> - <head> - - </head> - <body> - a handle for accessing a 1D array texture - </body> -</html> - - - - - - - sampler2DArrayShadow - - - TYPE - <html> - <head> - - </head> - <body> - a handle for accessing a 2D array depth texture with comparison - </body> -</html> - - - - - - - radians - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts degrees to radians, i.e. pi / 180 * degrees - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts degrees to radians, i.e. pi / 180 * degrees - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts degrees to radians, i.e. pi / 180 * degrees - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts degrees to radians, i.e. pi / 180 * degrees - </body> - </html> - - (vec4) - vec4 - - - - - usamplerCube - - - TYPE - a handle for accessing an unsigned integer cube mapped texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer cube mapped texture - </body> -</html> - - - - - - gl_TextureMatrixInverse - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform mat4 - - - - - texture2D - - - BUILD_IN_FUNC - (sampler2D, vec2, float bias) - vec4 - - - - - sampler1DArrayShadow - - - TYPE - a handle for accessing a 1D array depth texture with comparison - <html> - <head> - - </head> - <body> - a handle for accessing a 1D array depth texture with comparison - </body> -</html> - - - - - - - sign - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - texture2DProj - - - BUILD_IN_FUNC - (sampler2D, vec3, float bias) - vec4 - - - BUILD_IN_FUNC - (sampler2D, vec4, float bias) - vec4 - - - - - shadow1D - - - BUILD_IN_FUNC - (sampler1DShadow, vec3, float bias) - vec4 - - - - - gl_MaxTextureCoords - - - BUILD_IN_VAR - value >= 2 ARB_fragment_program required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum allowed number of - texture coordinate sets.<br>The number of texture coordinate sets defines - the maximum number of texture coordinates that can be attached to a - vertex. A texture coordinate set encompasses vertex texture coordinate attributes, as well as the texture matrix stack and texture generation state. This limit applies regardless of using a vertex shader or - fixed-function pipeline to perform vertex processing. This constant can be - also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_TEXTURE_COORDS_ARB</i>. - Minimum value is 2. - </body> -</html> - - const int - - - - - gl_MaxVertexTextureImageUnits - - - BUILD_IN_VAR - value >= 0 ARB_vertex_shader required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum available texture image - units in a vertex shader.<br> The texture image unit constant specifyes the - number of hardware units that can be used simultaneously for accessing - texture maps. This constant can be also queried by calling <b>glGetIntegerv</b> - with the symbolic constant <i>GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB</i>. - The minimum value is 0. - </body> -</html> - - const int - - - - - vec3 - - - TYPE - three component floating-point vector - - - - - vec2 - - - TYPE - two component floating-point vector - - - - - case - - - KEYWORD - - - - - texture1DLod - - - BUILD_IN_FUNC - (sampler1D, float, float lod) - vec4 - - - - - asin - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc sine. Returns an angle whose sine is x. The range of values returned - by this function is [- Pi / 2 , Pi / 2 ] Results are undefined if |x| &gt; 1. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc sine. Returns an angle whose sine is x. The range of values returned - by this function is [- Pi / 2 , Pi / 2 ] Results are undefined if |x| &gt; 1. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc sine. Returns an angle whose sine is x. The range of values returned - by this function is [- Pi / 2 , Pi / 2 ] Results are undefined if |x| &gt; 1. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc sine. Returns an angle whose sine is x. The range of values returned - by this function is [- Pi / 2 , Pi / 2 ] Results are undefined if |x| &gt; 1. - </body> - </html> - - (vec4) - vec4 - - - - - texture3D - - - BUILD_IN_FUNC - (sampler3D, vec3, float bias) - vec4 - - - - - gl_LightModel - - - BUILD_IN_VAR - uniform gl_LightModelParameters - - - - - bvec2 - - - TYPE - two component boolean vector - - - - - bvec3 - - - TYPE - three component boolean vector - - - - - bvec4 - - - TYPE - four component boolean vector - - - - - normalize - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_MaxCombinedTextureImageUnits - - - BUILD_IN_VAR - value >= 2 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum available combined - texture image units in all shader processing parts of OpenGL.<br>The - texture image unit constant specifys the number of hardware units that can - be used simultaneously for accessing texture maps. This constant can be - also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB</i>. - The minimum value is 2. - - <p> - <b>Note:</b> If a vertex shader and a fragment shader both use the same - texture image unit, that counts as two units against this limit. - </p> - </body> -</html> - - const int - - - - - struct - - - KEYWORD - <html> - <head> - - </head> - <body> - Once a structure is defined, and its type is given a name, a constructor - is available with the same name to construct instances of that structure. - For example: - - <pre><code>struct light { - float intensity; - vec3 position; -}; -<nobr>light lightVar = light(3.0, vec3(1.0, 2.0, 3.0));</nobr></code> - </pre> - <p> - The arguments to the constructor will be used to set the structure's - fields, in order, using one argument per field. Each argument must be - the same type as the field it sets. - </p> - <p> - Structure constructors can be used as initializers or in expressions. - </p> - </body> -</html> - - - - - - all - - - BUILD_IN_FUNC - (bvec2) - bool - - - BUILD_IN_FUNC - (bvec3) - bool - - - BUILD_IN_FUNC - (bvec4) - bool - - - - - shadow2DLod - - - BUILD_IN_FUNC - (sampler2DShadow, vec3, float lod) - vec4 - - - - - precision - - - KEYWORD - <html> - <head> - - </head> - <body> - The precision statement -<pre> -precision precision-qualifier type; -</pre> -can be used to establish a default precision qualifier. The type field can be either int or <b>float</b>, and the -precision-qualifier can be <b>lowp, mediump, or highp</b>. Any other types or qualifiers will result in an error. -If type is float, the directive applies to non-precision-qualified floating point type (scalar, vector, and -matrix) declarations. If type is <b>int</b>, the directive applies to all non-precision-qualified integer type (scalar, -vector, signed, and unsigned) declarations. This includes global variable declarations, function return declarations, -function parameter declarations, and local variable declarations. Non-precision qualified declarations will use the precision qualifier -specified in the most recent precision statement that is still in scope. The <b>precision</b> statement has the same scoping rules as variable -declarations. If it is declared inside a compound statement, its effect stops at the end of the innermost -statement it was declared in. Precision statements in nested scopes override <b>precision</b> statements in outer -scopes. Multiple precision statements for the same basic type can appear inside the same scope, with later -statements overriding earlier statements within that scope. -<p> -The vertex language has the following predeclared globally scoped default - precision statements: -<pre> -precision highp float; -precision highp int; -</pre> -</p> -<p> -The fragment language has the following predeclared globally scoped default - precision statement: -<pre> -precision mediump int; -</pre> -</p> -The fragment language has no default precision qualifier for floating point types. Hence for float, floating -point vector and matrix variable declarations, either the declaration must include a precision qualifier or -the default float precision must have been previously declared. - </body> -</html> - - - - - - gl_BackMaterial - - - BUILD_IN_VAR - uniform gl_MaterialParameters - - - - - uniform - - - QUALIFIER - input to Vertex and Fragment shader from OpenGL or application (READ-ONLY) - <html> - <head> - - </head> - <body> - <nobr>The <b>uniform </b>qualifier is used to declare global variables - whose values are the same across the entire</nobr> <nobr>primitive being - processed. All <b>uniform </b>variables are read-only and are initialized - externally either at link</nobr> <nobr>time or through the API. The link - time initial value is either the value of the variable's initializer, if</nobr> - <nobr>present, or 0 if no initializer is present. Sampler types cannot - have initializers.</nobr><br>Example declarations are: - - <pre> <nobr>uniform vec4 lightPosition;</nobr> - <nobr>uniform vec3 color = vec3(0.7, 0.7, 0.2); // value assigned at link time </nobr></pre> -<p> - <nobr>The <b>uniform </b>qualifier can be used with any of the basic data - types, or when declaring a variable whose</nobr> <nobr>type is a - structure, or an array of any of these.</nobr> <nobr>There is an - implementation dependent limit on the amount of storage for uniforms that - can be used for</nobr> <nobr>each type of shader and if this is exceeded - it will cause a compile-time or link-time error. Uniform</nobr> <nobr>variables - that are declared but not used do not count against this limit. The number - of user-defined</nobr> <nobr>uniform variables and the number of built-in - uniform variables that are used within a shader are added</nobr> <nobr>together - to determine whether available uniform storage has been exceeded.</nobr> - - <p> - <nobr>If multiple shaders are linked together, then they will share a - single global uniform name space. Hence,</nobr> <nobr>the types and - initializers of uniform variables with the same name must match across - all shaders that are</nobr> <nobr>linked into a single executable. It is - legal for some shaders to provide an initializer for a particular</nobr> <nobr>uniform - variable, while another shader does not, but all provided initializers - must be equal.</nobr> - </p> - </body> -</html> - - - - - - matrixCompMult - - - BUILD_IN_FUNC - (mat2, mat2) - mat2 - - - BUILD_IN_FUNC - (mat3, mat3) - mat3 - - - BUILD_IN_FUNC - (mat4, mat4) - mat4 - - - - - gl_BackLightModelProduct - - - BUILD_IN_VAR - uniform gl_LightModelProducts - - - - - equal - - - BUILD_IN_FUNC - (bvec2, bvec2) - bvec2 - - - BUILD_IN_FUNC - (bvec3, bvec3) - bvec3 - - - BUILD_IN_FUNC - (bvec4, bvec4) - bvec4 - - - - - gl_NormalScale - - - BUILD_IN_VAR - uniform float - - - - - gl_ModelViewProjectionMatrixInverse - - - BUILD_IN_VAR - uniform mat4 - - - - - gl_DepthRange - - - BUILD_IN_VAR - uniform gl_DepthRangeParameters - - - - - isampler2DArray - - - TYPE - a handle for accessing an integer 2D array texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 2D array texture - </body> -</html> - - - - - - out - - - QUALIFIER - copied out on return, but not initialized - - - - - noperspective - - - QUALIFIER - linear interpolation - <html> - <head> - - </head> - <body> - <p> - linear interpolation - </p> - </body> -</html> - - - - - - samplerCube - - - TYPE - handle for accessing a cube mapped texture - <html> - <head> - - </head> - <body> - </body> - </html> - - - - - - sampler2DShadow - - - TYPE - handle for accessing a 2D depth texture with comparison - <html> - <head> - - </head> - <body> - </body> - </html> - - - - - - for - - - ITERATION - <html> - <head> - - </head> - <body> - - </body> -</html> - - - - - - break - - - JUMP - - - - - invariant - - - QUALIFIER - ensures all calculations of this variable give identical values across programs - <html> - <head> - - </head> - <body> - To ensure that a particular output variable is invariant, it is necessary - to use the <b>invariant </b>qualifier. It can either be used to qualify a - previously declared variable as being invariant - - <blockquote> - <code><nobr>invariant gl_Position; // make existing gl_Position be invariant</nobr><br><nobr>varying - vec3 Color;</nobr><br><nobr>invariant Color; // make existing Color be invariant</nobr><br></code> - </blockquote> - <p> - or as part of a declaration when a variable is declared - </p> - <blockquote> - <code><nobr>invariant varying vec3 Color;</nobr></code> - </blockquote> - <p> - The invariant qualifier must appear before any storage qualifiers (<b>varying</b>) - when combined with a declaration. Only variables output from a vertex - shader can be candidates for invariance. This includes user-defined - varying variables, the built-in vertex-side varying variables, and the - special vertex variables <i>gl_Position </i>and <i>gl_PointSize</i>. For - varying variables leaving a vertex shader and coming into a fragment - shader with the same name, the <b>invariant </b>keyword has to be used - in both the vertex and fragment shaders. The <b>invariant </b>keyword - can be followed by a comma separated list of previously declared - identifiers. All uses of <b>invariant </b>must be at the global scope, - and before any use of the variables being declared as invariant. - </p> - <p> - To guarantee invariance of a particular output variable across two - programs, the following must also be true: - </p> - <ul> - <li> - The output variable is declared as invariant in both programs. - </li> - <li> - The same values must be input to all shader input variables consumed - by expressions and flow control contributing to the value assigned to - the output variable. - </li> - <li> - The texture formats, texel values, and texture filtering are set the - same way for any texture function calls contributing to the value of - the output variable. - </li> - <li> - All input values are all operated on in the same way. All operations - in the consuming expressions and any intermediate expressions must be - the same, with the same order of operands and same associativity, to - give the same order of evaluation. Intermediate variables and - functions must be declared as the same type with the same explicit or - implicit precision qualifiers. Any control flow affecting the output - value must be the same, and any expressions consumed to determine this - control flow must also follow these invariance rules. - </li> - <li> - All the data flow and control flow leading to setting the invariant - output variable reside in a single compilation unit. - </li> - </ul> - <p> - Essentially, all the data flow and control flow leading to an invariant - output must match. Initially, by default, all output variables are - allowed to be variant. To force all output variables to be invariant, - use the pragma - </p> - <blockquote> - <code>#pragma STDGL invariant(all)</code> - </blockquote> - <p> - before all declarations in a shader. If this pragma is used after the - declaration of any variables or functions, then the set of outputs that - behave as invariant is undefined. It is an error to use this pragma in a - fragment shader. - </p> - <p> - Generally, invariance is ensured at the cost of flexibility in - optimization, so performance can be degraded by use of invariance. - Hence, use of this pragma is intended as a debug aid, to avoid - individually declaring all output variables as invariant. - </p> - </body> -</html> - - - - - - abs - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Returns x if x &gt;= 0, otherwise it returns -x - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Returns x if x &gt;= 0, otherwise it returns -x - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Returns x if x &gt;= 0, otherwise it returns -x - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Returns x if x &gt;= 0, otherwise it returns -x - </body> - </html> - - (vec4) - vec4 - - - - - greaterThanEqual - - - BUILD_IN_FUNC - (ivec2, ivec2) - bvec2 - - - BUILD_IN_FUNC - (ivec3, ivec3) - bvec3 - - - BUILD_IN_FUNC - (ivec4, ivec4) - bvec4 - - - - - gl_NormalMatrix - - - BUILD_IN_VAR - uniform mat3 - - - - - false - - - KEYWORD - boolean value - - - - - gl_ModelViewMatrixInverse - - - BUILD_IN_VAR - uniform mat4 - - - - - gl_ModelViewProjectionMatrix - - - BUILD_IN_VAR - uniform mat4 - - - - - refract - - - BUILD_IN_FUNC - (float, float, float eta) - float - - - BUILD_IN_FUNC - (vec2, vec2, float eta) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3, float eta) - vec3 - - - BUILD_IN_FUNC - (vec4 I, vec4 M, float eta) - vec4 - - - - - dFdx - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - dFdy - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_ModelViewProjectionMatrixInverseTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - lessThanEqual - - - BUILD_IN_FUNC - (ivec2, ivec2) - bvec2 - - - BUILD_IN_FUNC - (ivec3, ivec3) - bvec3 - - - BUILD_IN_FUNC - (ivec4, ivec4) - bvec4 - - - - - usampler1D - - - TYPE - a handle for accessing an unsigned integer 1D texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 1D texture - </body> -</html> - - - - - - not - - - BUILD_IN_FUNC - (bvec2) - bvec2 - - - BUILD_IN_FUNC - (bvec3) - bvec3 - - - BUILD_IN_FUNC - (bvec4) - bvec4 - - - - - gl_ModelViewMatrixInverseTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - greaterThan - - - BUILD_IN_FUNC - (ivec2, ivec2) - bvec2 - - - BUILD_IN_FUNC - (ivec3, ivec3) - bvec3 - - - BUILD_IN_FUNC - (ivec4, ivec4) - bvec4 - - - - - gl_Fog - - - BUILD_IN_VAR - uniform gl_FogParameters - - - - - tan - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric tangent function. Angle in radians. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric tangent function. Angle in radians. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric tangent function. Angle in radians. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric tangent function. Angle in radians. - </body> - </html> - - (vec4) - vec4 - - - - - cross - - - BUILD_IN_FUNC - (vec3, vec3) - vec3 - - - - - gl_ClipPlane - - - BUILD_IN_VAR - INDEX < gl_MaxClipPlanes - [] - uniform vec4 - - - - - textureCube - - - BUILD_IN_FUNC - (samplerCube, vec3, float bias) - vec4 - - - - - const - - - QUALIFIER - constant function input - - - - - gl_MaxTextureUnits - - - BUILD_IN_VAR - value >= 2 since OpenGL 1.3 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum available multitexture - statges.<br>This constant can - be also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_TEXTURE_UNITS</i>. - The minimum value is 2. - </body> -</html> - - const int - - - - - mediump - - - QUALIFIER - <html> - <head> - - </head> - <body> - qualifier for medium precision - </body> -</html> - - - - - - inout - - - QUALIFIER - value initialized on entry, and copied out on return - - - - - switch - - - KEYWORD - - - - - gl_FrontLightModelProduct - - - BUILD_IN_VAR - uniform gl_LightModelProducts - - - - - shadow1DProj - - - BUILD_IN_FUNC - (sampler1DShadow, vec4, float bias) - vec4 - - - - - usampler1DArray - - - TYPE - a handle for accessing an unsigned integer 1D array texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 1D array texture - </body> -</html> - - - - - - gl_EyePlaneT - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - gl_EyePlaneS - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - gl_EyePlaneR - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - distance - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2) - float - - - BUILD_IN_FUNC - (vec3, vec3) - float - - - BUILD_IN_FUNC - (vec4, vec4) - float - - - - - gl_EyePlaneQ - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - sampler1DShadow - - - TYPE - handle for accessing a 1D depth texture with comparison - <html> - <head> - - </head> - <body> - a handle for accessing a 1D depth texture with comparison - </body> -</html> - - - - - - gl_ProjectionMatrix - - - BUILD_IN_VAR - uniform mat4 - - - - - gl_TextureEnvColor - - - BUILD_IN_VAR - INDEX < gl_MaxTextureUnits - [] - uniform vec4 - - - - - length - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - float - - - BUILD_IN_FUNC - (vec3) - float - - - BUILD_IN_FUNC - (vec4) - float - - - - - gl_ModelViewMatrixTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - gl_FrontMaterial - - - BUILD_IN_VAR - uniform gl_MaterialParameters - - - - - sampler2DArray - - - TYPE - a handle for accessing a 2D array texture - <html> - <head> - - </head> - <body> - a handle for accessing a 2D array texture - </body> -</html> - - - - - - - min - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, float) - vec2 - - - BUILD_IN_FUNC - (vec3, float) - vec3 - - - BUILD_IN_FUNC - (vec4, float) - vec4 - - - - - gl_LightSource - - - BUILD_IN_VAR - INDEX < gl_MaxLights - [] - uniform gl_LightSourceParameters - - - - - return - - - JUMP - - - - - void - - - TYPE - for functions that do not return a value - - - - - true - - - KEYWORD - boolean value - - - - - mix - - - BUILD_IN_FUNC - (float, float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2, float) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3, float) - vec3 - - - BUILD_IN_FUNC - (vec4, vec4, float) - vec4 - - - - - texture3DProj - - - BUILD_IN_FUNC - (sampler3D, vec4, float bias) - vec4 - - - - - gl_MaxDrawBuffers - - - BUILD_IN_VAR - value >= 1 ARB_draw_buffers required - min = 1; // proposed ARB_draw_buffers - const int - - - - - gl_ProjectionMatrixTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - lowp - - - QUALIFIER - <html> - <head> - - </head> - <body> - qualifier for low precision - </body> -</html> - - - - - - isamplerCube - - - TYPE - a handle for accessing an integer cube mapped texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer cube mapped texture - </body> -</html> - - - - - - gl_ModelViewMatrix - - - BUILD_IN_VAR - uniform mat4 - - - - - fwidth - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - atan - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y - are used to determine what quadrant the angle is in. The range of values - returned by this function is [-Pi, Pi]. Results are undefined if x and y - are both 0. - </body> - </html> - - (float, float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y - are used to determine what quadrant the angle is in. The range of values - returned by this function is [-Pi, Pi]. Results are undefined if x and y - are both 0. - </body> - </html> - - (vec2, vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y - are used to determine what quadrant the angle is in. The range of values - returned by this function is [-Pi, Pi]. Results are undefined if x and y - are both 0. - </body> - </html> - - (vec3, vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y - are used to determine what quadrant the angle is in. The range of values - returned by this function is [-Pi, Pi]. Results are undefined if x and y - are both 0. - </body> - </html> - - (vec4, vec4) - vec4 - - - - - gl_MaxVaryingFloats - - - BUILD_IN_VAR - value >= 32 - min = 32; // ARB_vertex_shader - const int - - - - - fract - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_Point - - - BUILD_IN_VAR - uniform gl_PointParameters - - - - - texture3DProjLod - - - BUILD_IN_FUNC - (sampler3D, vec4, float lod) - vec4 - - - - - gl_ObjectPlaneS - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - gl_ObjectPlaneT - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - isampler2D - - - TYPE - a handle for accessing an integer 2D texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 2D texture - </body> -</html> - - - - - - exp2 - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_ObjectPlaneR - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - gl_ObjectPlaneQ - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - lessThan - - - BUILD_IN_FUNC - (ivec2, ivec2) - bvec2 - - - BUILD_IN_FUNC - (ivec3, ivec3) - bvec3 - - - BUILD_IN_FUNC - (ivec4, ivec4) - bvec4 - - - - - shadow2DProjLod - - - BUILD_IN_FUNC - (sampler2DShadow, vec4, float lod) - vec4 - - - - - gl_MaxTextureImageUnits - - - BUILD_IN_VAR - value >= 2 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum available texture image - units in a fragment shader.<br> The texture image unit constant specifyes the - number of hardware units that can be used simultaneously for accessing - texture maps. This constant can be also queried by calling <b>glGetIntegerv</b> - with the symbolic constant <i>GL_MAX_TEXTURE_IMAGE_UNITS_ARB</i>. The - minimum value is 2. - </body> -</html> - - const int - - - - - gl_FrontLightProduct - - - BUILD_IN_VAR - INDEX < gl_MaxLights - [] - uniform gl_LightProducts - - - - - gl_MaxClipPlanes - - - BUILD_IN_VAR - value >= 6 since OpenGL 1.0 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum supported clip planes. - - <p> - This constant can be also queried by calling <b>glGetIntegerv</b> with - the symbolic constant <i>GL_MAX_CLIP_PLANES_ARB</i>. The minimum value - is 6. - </p> - </body> -</html> - - const int - - - - - inversesqrt - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_TextureMatrixInverseTranspose - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform mat4 - - - - - int - - - TYPE - signed integer - - - - - gl_MaxLights - - - BUILD_IN_VAR - value >= 8 since OpenGL 1.0 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum allowed dynamic light - sources.<br> The minimum value is 8. - </body> -</html> - - const int - - - - - flat - - - QUALIFIER - no interpolation - <html> - <head> - - </head> - <body> - <p> - no interpolation. - </p> - </body> -</html> - - - - - - log2 - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - isampler3D - - - TYPE - a handle for accessing an integer 3D texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 3D texture - </body> -</html> - - - - - - exp - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - ftransform - - - BUILD_IN_FUNC - () - vec4 - - - - - mat4 - - - TYPE - 4×4 floating-point matrix - - - - - default - - - KEYWORD - - - - - sampler1D - - - TYPE - handle for accessing a 1D texture - - - - - mat2 - - - TYPE - 2×2 floating-point matrix - - - - - mat3 - - - TYPE - 3×3 floating-point matrix - - - - - gl_ModelViewProjectionMatrixTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - textureCubeLod - - - BUILD_IN_FUNC - (samplerCube, vec3, float lod) - vec4 - - - - - usampler2D - - - TYPE - a handle for accessing an unsigned integer 2D texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 2D texture - </body> -</html> - - - - - - gl_TextureMatrix - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform mat4 - - - - - gl_ProjectionMatrixInverse - - - BUILD_IN_VAR - uniform mat4 - - - - - shadow1DLod - - - BUILD_IN_FUNC - (sampler1DShadow, vec3, float lod) - vec4 - - - - - while - - - ITERATION - - - - - sampler2D - - - TYPE - handle for accessing a 2D texture - - - - - texture1DProj - - - BUILD_IN_FUNC - (sampler1D, vec2, float bias) - vec4 - - - BUILD_IN_FUNC - (sampler1D, vec4, float bias) - vec4 - - - - - if - - - SELECTION - - - - - shadow2DProj - - - BUILD_IN_FUNC - (sampler2DShadow, vec4, float bias) - vec4 - - - - - isampler1DArray - - - TYPE - a handle for accessing an integer 1D array texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 1D array texture - </body> -</html> - - - - - - acos - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc cosine. Returns an angle whose cosine is x. The range of values - returned by this function is [0, pi]. Results are undefined if |x|&gt;1. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc cosine. Returns an angle whose cosine is x. The range of values - returned by this function is [0, pi]. Results are undefined if |x|&gt;1. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc cosine. Returns an angle whose cosine is x. The range of values - returned by this function is [0, pi]. Results are undefined if |x|&gt;1. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc cosine. Returns an angle whose cosine is x. The range of values - returned by this function is [0, pi]. Results are undefined if |x|&gt;1. - </body> - </html> - - (vec4) - vec4 - - - - - usampler3D - - - TYPE - a handle for accessing an unsigned integer 3D texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 3D texture - </body> -</html> - - - - - - degrees - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts radians to degrees, i.e. 180/Pi * radians - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts radians to degrees, i.e. 180/Pi * radians - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts radians to degrees, i.e. 180/Pi * radians - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts radians to degrees, i.e. 180/Pi * radians - </body> - </html> - - (vec4) - vec4 - - - - - in - - - QUALIFIER - value initialized on entry, not copied on return (default) - - - - - sampler3D - - - TYPE - handle for accessing a 3D texture - - - - - continue - - - JUMP - - - - - bool - - - TYPE - conditional type, taking on values of true or false (also known as boolean) - - - - - step - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (float, vec2) - vec2 - - - BUILD_IN_FUNC - (float, vec3) - vec3 - - - BUILD_IN_FUNC - (float, vec4) - vec4 - - - - - uint - - - TYPE - an unsigned integer - <html> - <head> - - </head> - <body> - an unsigned integer - </body> -</html> - - - - - - - - gl_FragDepth - - - BUILD_IN_VAR - pixel depth - <html> - <head> - - </head> - <body> - Writing to <i>gl_FragDepth </i>will establish the depth value for the - fragment being processed. If depth buffering is enabled, and no shader - writes <i>gl_FragDepth</i>, then the fixed function value for depth will - be used as the fragment&#8217;s depth value. If a shader statically assigns a - value to <i>gl_FragDepth</i>, and there is an execution path through the - shader that does not set <i>gl_FragDepth</i>, then the value of the - fragment&#8217;s depth may be undefined for executions of the shader that take - that path. That is, if the set of linked fragment shaders statically - contain a write to <i>gl_FragDepth</i>, then it is responsible for always - writing it. - - <p> - (A shader contains a <i>static assignment </i>to a variable <i>x </i>if, - after pre-processing, the shader contains a statement that would write - to <i>x</i>, whether or not run-time flow of control will cause that - statement to be executed.) - </p> - </body> - </html> - - float - - - - - gl_FragCoord - - - BUILD_IN_VAR - pixel coordinate (READ ONLY) - <html> - <head> - - </head> - <body> - The variable <i>gl_FragCoord </i>is available as a read-only variable from - within fragment shaders and it holds the window relative coordinates x, y, - z, and 1/w values for the fragment. If multi-sampling, this value can be - for any location within the pixel, or one of the fragment samples. The use - of <b>centroid </b>varyings does not further restrict this value to be - inside the current primitive. This value is the result of the fixed - functionality that interpolates primitives after vertex processing to - generate fragments. The <i>z </i>component is the depth value that would - be used for the fragment&#8217;s depth if no shader contained no writes to <i>gl_FragDepth. - </i>This is useful for invariance if a shader conditionally computes <i>gl_FragDepth - </i>but otherwise wants the fixed functionality fragment depth. - </body> - </html> - - vec4 - - - - - gl_PointCoord - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The values in <i>gl_PointCoord </i>are two-dimensional coordinates - indicating where within a point primitive the current fragment is located, - when point sprites are enabled. They range from 0.0 to 1.0 across the - point. If the current primitive is not a point, or if point sprites are - not enabled, then the values read from gl_PointCoord are undefined. - </body> - </html> - - vec2 - - - - - gl_FrontFacing - - - BUILD_IN_VAR - (READ ONLY) - <html> - <head> - - </head> - <body> - Fragment shaders have access to the read-only built-in variable <i>gl_FrontFacing, - </i>whose value is <b>true </b>if the fragment belongs to a front-facing - primitive.<p> One use of this is to emulate two-sided lighting - by selecting one of two colors calculated by the vertex shader or geometry - shader. - </body> -</html> - - bool - - - - - gl_Color - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The values in <i>gl_Color </i>and <i>gl_SecondaryColor </i>will be derived - automatically by the system from <i>gl_FrontColor, gl_BackColor, - gl_FrontSecondaryColor, </i>and <i>gl_BackSecondaryColor </i>based on - which face is visible. If fixed functionality is used for vertex - processing, then <i>gl_FogFragCoord </i>will either be the z-coordinate of - the fragment in eye space, or the interpolation of the fog coordinate, as - described in section 3.10 of the OpenGL 1.4 Specification. The <i>gl_TexCoord[] - </i>values are the interpolated <i>gl_TexCoord[] </i>values from a vertex - shader or the texture coordinates of any fixed pipeline based vertex - functionality. - </body> - </html> - - varying vec4 - - - - - discard - - - JUMP - <html> - <head> - - </head> - <body> - The <b>discard </b>keyword is only allowed within fragment shaders. It can - be used within a fragment shader to abandon the operation on the current - fragment. This keyword causes the fragment to be discarded and no updates - to any buffers will occur. It would typically be used within a conditional - statement, for example: - - <pre> if (intensity &lt; 0.0) - discard; - </pre> - A fragment shader may test a fragment&#8217;s alpha value and discard the - fragment based on that test. However, it should be noted that coverage - testing occurs after the fragment shader runs, and the coverage test can - change the alpha value. - </body> - </html> - - - - - - gl_SecondaryColor - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The values in <i>gl_Color </i>and <i>gl_SecondaryColor </i>will be derived - automatically by the system from <i>gl_FrontColor, gl_BackColor, - gl_FrontSecondaryColor, </i>and <i>gl_BackSecondaryColor </i>based on - which face is visible. If fixed functionality is used for vertex - processing, then <i>gl_FogFragCoord </i>will either be the z-coordinate of - the fragment in eye space, or the interpolation of the fog coordinate, as - described in section 3.10 of the OpenGL 1.4 Specification. The <i>gl_TexCoord[] - </i>values are the interpolated <i>gl_TexCoord[] </i>values from a vertex - shader or the texture coordinates of any fixed pipeline based vertex - functionality. - </body> - </html> - - varying vec4 - - - - - gl_FragData - - - BUILD_IN_VAR - INDEX<gl_MaxDrawBuffers - <html> - <head> - - </head> - <body> - The variable <i>gl_FragData </i>is an array. Writing to <i>gl_FragData[n] </i>specifies - the fragment data that will be used by the subsequent fixed functionality - pipeline for data <i>n</i>. If subsequent fixed functionality consumes - fragment data and an execution of a fragment shader executable does not - write a value to it, then the fragment data consumed is undefined. - </body> - </html> - - [] - vec4 - - - - - gl_FragColor - - - BUILD_IN_VAR - pixel color - <html> - <head> - - </head> - <body> - If a shader statically assigns a value to <i>gl_FragColor</i>, it may not - assign a value to any element of <i>gl_FragData</i>. If a shader - statically writes a value to any element of <i>gl_FragData</i>, it may not - assign a value to <i>gl_FragColor</i>. That is, a shader may assign values - to either <i>gl_FragColor </i>or <i>gl_FragData</i>, but not both. - Multiple shaders linked together must also consistently write just one of - these variables. - </body> - </html> - - vec4 - - - - - - - gl_BackColor - - - BUILD_IN_VAR - enable GL_VERTEX_PROGRAM_TWO_SIDE - varying vec4 - - - - - gl_FogFragCoord - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - For <i>gl_FogFragCoord</i>, the value written will be used as the &quot;c&quot; - value on page 160 of the OpenGL 1.4 Specification by the fixed - functionality pipeline. For example, if the z-coordinate of the fragment - in eye space is desired as &quot;c&quot;, then that's what the vertex or geometry shader - executable should write into <i>gl_FogFragCoord</i>. - </body> - </html> - - varying float - - - - - gl_Position - - - BUILD_IN_VAR - must be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_Position</i> is available only in the vertex and - geometry language and is intended for writing the homogeneous vertex - position. - - <p> - It can be written at any time during shader execution. It may also be - read back by the shader after being written. This value will be used by - primitive assembly, clipping, culling, and other fixed functionality - operations that operate on primitives after vertex or geometry - processing has occurred. Compilers may generate a diagnostic message if - they detect <i>gl_Position</i> is read before being written, but not all - such cases are detectable. Writing to <i>gl_Position</i> is optional. If <i>gl_Position</i> - is not written but subsequent stages of the OpenGL pipeline consume <i>gl_Position</i>, - then results are undefined. - </p> - </body> -</html> - - vec4 - - - - - gl_TexCoord - - - BUILD_IN_VAR - INDEX<gl_MaxTextureCoords - <html> - <head> - - </head> - <body> - As with all arrays, indices used to subscript <i>gl_TexCoord </i>must - either be an integral constant expressions, or this array must be - re-declared by the shader with a size. The size can be at most <i>gl_MaxTextureCoords</i>. - Using indexes close to 0 may aid the implementation in preserving varying - resources. - </body> - </html> - - [] - varying vec4 - - - - - gl_FrontSecondaryColor - - - BUILD_IN_VAR - varying vec4 - - - - - attribute - - - QUALIFIER - linkage between a vertex shader and OpenGL for per-vertex data (READ-ONLY) - <html> - <head> - - </head> - <body> - The <b>attribute </b>qualifier is used to declare variables that are - passed to a vertex shader from OpenGL on a per-vertex basis. It is an - error to declare an attribute variable in any type of shader other than a - vertex shader. Attribute variables are read-only as far as the vertex - shader is concerned. Values for attribute variables are passed to a vertex - shader through the OpenGL vertex API or as part of a vertex array. They - convey vertex attributes to the vertex shader and are expected to change - on every vertex shader run. The attribute qualifier can be used only with <b>float, - </b>floating-point vectors, and matrices. Attribute variables cannot be - declared as arrays or structures.<p>Example declarations: - - <pre>attribute vec4 position; -attribute vec3 normal; -attribute vec2 texCoord;</pre> - <p> - All the standard OpenGL vertex attributes have built-in variable names - to allow easy integration between user programs and OpenGL vertex - functions. See Section 7 &quot;Built-in Variables&quot; of the OpenGL Shading - Language specification; for a list of the built-in attribute names. - </p> - <p> - It is expected that graphics hardware will have a small number of fixed - locations for passing vertex attributes. Therefore, the OpenGL Shading - language defines each non-matrix attribute variable as having space for - up to four floating-point values (i.e., a vec4). There is an - implementation dependent limit on the number of attribute variables that - can be used and if this is exceeded it will cause a link error. - (Declared attribute variables that are not used do not count against - this limit.) A float attribute counts the same amount against this limit - as a vec4, so applications may want to consider packing groups of four - unrelated float attributes together into a vec4 to better utilize the - capabilities of the underlying hardware. A matrix attribute will use up - multiple attribute locations. The number of locations used will equal - the number of columns in the matrix. - </p> - <p> - Attribute variables are required to have global scope, and must be - declared outside of function bodies, before their first use. - </p> - </body> -</html> - - - - - - gl_BackSecondaryColor - - - BUILD_IN_VAR - enable GL_VERTEX_PROGRAM_TWO_SIDE - varying vec4 - - - - - gl_FrontColor - - - BUILD_IN_VAR - varying vec4 - - - - - gl_FogCoord - - - BUILD_IN_VAR - attribute float - - - - - gl_MultiTexCoord7 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord6 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord5 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_PointSize - - - BUILD_IN_VAR - may be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_PointSize </i>is available only in the vertex and geometry language - and is intended to write the size of the point to be - rasterized. It is measured in pixels. - - <p> - If <i>gl_PointSize </i>or <i>gl_ClipVertex </i>are not written to, their - values are undefined. Any of these variables can be read back by the - shader after writing to them, to retrieve what was written. Reading them - before writing them results in undefined behavior. If they are written - more than once, it is the last value written that is consumed by the - subsequent operations. These built-in variables have global scope. - </p> - </body> - </html> - - float - - - - - gl_Color - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord0 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_Normal - - - BUILD_IN_VAR - attribute vec3 - - - - - gl_Vertex - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_SecondaryColor - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord4 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord3 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_ClipVertex - - - BUILD_IN_VAR - may be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_ClipVertex </i>is available only in the vertex and geometry language - and provides a place for vertex and geometry shaders to write the coordinate to be used - with the user clipping planes. The user must ensure the clip vertex and - user clipping planes are defined in the same coordinate space. User clip - planes work properly only under linear transform. It is undefined what - happens under non-linear transform. - - <p> - If <i>gl_PointSize </i>or <i>gl_ClipVertex </i>are not written to, their - values are undefined. Any of these variables can be read back by the - shader after writing to them, to retrieve what was written. Reading them - before writing them results in undefined behavior. If they are written - more than once, it is the last value written that is consumed by the - subsequent operations. These built-in variables have global scope. - </p> - </body> - </html> - - vec4 - - - - - gl_MultiTexCoord2 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord1 - - - BUILD_IN_VAR - attribute vec4 - - - - - - - gl_FogFragCoord - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - For <i>gl_FogFragCoord</i>, the value written will be used as the &quot;c&quot; - value on page 160 of the OpenGL 1.4 Specification by the fixed - functionality pipeline. For example, if the z-coordinate of the fragment - in eye space is desired as &quot;c&quot;, then that's what the vertex or geometry shader - executable should write into <i>gl_FogFragCoord</i>. - </body> - </html> - - varying out float - - - - - gl_BackColor - - - BUILD_IN_VAR - enable GL_VERTEX_PROGRAM_TWO_SIDE - varying out vec4 - - - - - gl_Layer - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The built-in output variable <i>gl_Layer</i> is available only in the - geometry language, and provides the number of the layer of textures - attached to a FBO to direct rendering to.<p> If a shader statically assigns a - value to <i>gl_Layer</i>, layered rendering mode is enabled. See section - 2.16.4 for a detailed explanation. If a shader statically assigns a value - to <i>gl_Layer</i>, and there is an execution path through the shader that - does not set <i>gl_Layer</i>, then the value of <i>gl_Layer</i> may be - undefined for executions of the shader that take that path. - </body> -</html> - - int - - - - - gl_Position - - - BUILD_IN_VAR - must be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_Position</i> is available only in the vertex and - geometry language and is intended for writing the homogeneous vertex - position. - - <p> - It can be written at any time during shader execution. It may also be - read back by the shader after being written. This value will be used by - primitive assembly, clipping, culling, and other fixed functionality - operations that operate on primitives after vertex or geometry - processing has occurred. Compilers may generate a diagnostic message if - they detect <i>gl_Position</i> is read before being written, but not all - such cases are detectable. Writing to <i>gl_Position</i> is optional. If <i>gl_Position</i> - is not written but subsequent stages of the OpenGL pipeline consume <i>gl_Position</i>, - then results are undefined. - </p> - </body> -</html> - - vec4 - - - - - gl_TexCoord - - - BUILD_IN_VAR - INDEX<gl_MaxTextureCoords - <html> - <head> - - </head> - <body> - As with all arrays, indices used to subscript <i>gl_TexCoord </i>must - either be an integral constant expressions, or this array must be - re-declared by the shader with a size. The size can be at most <i>gl_MaxTextureCoords</i>. - Using indexes close to 0 may aid the implementation in preserving varying - resources. - </body> - </html> - - [] - varying out vec4 - - - - - gl_FogFragCoordIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in float - - - - - EmitVertex - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The function <b>EmitVertex()</b> specifies that a vertex is completed. A - vertex is added to the current output primitive using the current values - of the varying output variables and the current values of the special - built-in output variables <b>gl_PointSize</b>, <b>gl_ClipVertex</b>, <b>gl_Layer</b>, - gl_Position</b> and <b>gl_PrimitiveID</b>. - - <p> - The values of any unwritten output variables are undefined. The values - of all varying output variables and the special built-in output - variables are undefined after a call to <b>EmitVertex()</b>. If a - geometry shader, in one invocation, emits more vertices than the value <i>GEOMETRY_VERTICES_OUT_EXT</i>, - these emits may have no effect. - </p> - </body> -</html> - - () - void - - - - - gl_BackColorIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_PointSizeIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in float - - - - - gl_FrontSecondaryColor - - - BUILD_IN_VAR - varying out vec4 - - - - - gl_BackSecondaryColorIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_ClipVertexIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_BackSecondaryColor - - - BUILD_IN_VAR - enable GL_VERTEX_PROGRAM_TWO_SIDE - varying out vec4 - - - - - gl_TexCoordIn - - - BUILD_IN_VAR - value <= gl_MaxTextureCoords - -value <= gl_MaxTextureCoords - [gl_VerticesIn][] - varying in vec4 - - - - - gl_FrontColorIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_FrontColor - - - BUILD_IN_VAR - varying out vec4 - - - - - gl_FrontSecondaryColorIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_VerticesIn - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - <p> - Value set at link time. - </p> - </body> -</html> - - const int - - - - - gl_PointSize - - - BUILD_IN_VAR - may be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_PointSize </i>is available only in the vertex and geometry language - and is intended to write the size of the point to be - rasterized. It is measured in pixels. - - <p> - If <i>gl_PointSize </i>or <i>gl_ClipVertex </i>are not written to, their - values are undefined. Any of these variables can be read back by the - shader after writing to them, to retrieve what was written. Reading them - before writing them results in undefined behavior. If they are written - more than once, it is the last value written that is consumed by the - subsequent operations. These built-in variables have global scope. - </p> - </body> - </html> - - float - - - - - EndPrimitive - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The function <b>EndPrimitive()</b> specifies that the current output - primitive is completed and a new output primitive (of the same type) - should be started. This function does not emit a vertex.<br> The effect of <b>EndPrimitive()</b> - is roughly equivalent to calling End followed by a new Begin, where the - primitive mode is taken from the program object parameter <i>GEOMETRY_OUTPUT_TYPE_EXT</i>. - If the output primitive type is <i>POINTS</i>, calling <b>EndPrimitive()</b> - is optional. - - <p> - A geometry shader starts with an output primitive containing no - vertices. When a geometry shader terminates, the current output - primitive is automatically completed. It is not necessary to call <b>EndPrimitive()</b> - if the geometry shader writes only a single primitive. - </p> - </body> -</html> - - () - void - - - - - gl_PositionIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_PrimitiveID - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The built-in output variable <i>gl_PrimitiveID</i> is available only in the - geometry language and provides a single integer that serves as a primitive - identifier.<p> This written primitive ID is available to fragment shaders. - If a fragment shader using primitive IDs is active and a geometry shader - is also active, the geometry shader must write to <i>gl_PrimitiveID</i> or the - primitive ID in the fragment shader number is undefined. - </body> -</html> - - int - - - - - gl_ClipVertex - - - BUILD_IN_VAR - may be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_ClipVertex </i>is available only in the vertex and geometry language - and provides a place for vertex and geometry shaders to write the coordinate to be used - with the user clipping planes. The user must ensure the clip vertex and - user clipping planes are defined in the same coordinate space. User clip - planes work properly only under linear transform. It is undefined what - happens under non-linear transform. - - <p> - If <i>gl_PointSize </i>or <i>gl_ClipVertex </i>are not written to, their - values are undefined. Any of these variables can be read back by the - shader after writing to them, to retrieve what was written. Reading them - before writing them results in undefined behavior. If they are written - more than once, it is the last value written that is consumed by the - subsequent operations. These built-in variables have global scope. - </p> - </body> - </html> - - vec4 - - - - - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/JmeVocabulary.xml b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/JmeVocabulary.xml deleted file mode 100644 index 287c9111d..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/JmeVocabulary.xml +++ /dev/null @@ -1,4724 +0,0 @@ - - - - - pow - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3) - vec3 - - - BUILD_IN_FUNC - (vec4, vec4) - vec4 - - - - - float - - - TYPE - single floating-point scalar - - - - - dot - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2) - float - - - BUILD_IN_FUNC - (vec3, vec3) - float - - - BUILD_IN_FUNC - (vec4, vec4) - float - - - - - gl_MaxFragmentUniformComponents - - - BUILD_IN_VAR - value >= 64 ARB_fragment_shader required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum allowed uniform - components inside the fragment shader.<br> This limit refers to the storage - for the combination of build-in uniform variables and user-defined uniform - variables that are actually used in a fragment shader. This constant can - be also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB</i>. - The minimum value is 64 if <i>ARB_fragment_shader</i> is supported. - </body> -</html> - - const int - - - - - else - - - SELECTION - - - - - gl_BackLightProduct - - - BUILD_IN_VAR - INDEX < gl_MaxLights - [] - uniform gl_LightProducts - - - - - mod - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, float) - vec2 - - - BUILD_IN_FUNC - (vec3, float) - vec3 - - - BUILD_IN_FUNC - (vec4, float) - vec4 - - - - - gl_MaxVertexAttribs - - - BUILD_IN_VAR - value >= 16 ARB_vertex_shader required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum useable vertex attributes - in a vertex shader.<br> This limit consists of the standard (build-in) attributes (these are color, secondary color, normal, vertex position, texture coordinates, and fog coordinates) and the generic attributes left for custom purposes. This constant can be also queried by calling <b>glGetIntegerv</b> - with the symbolic constant <i>GL_MAX_VERTEX_ATTRIBS_ARB</i>. Every OpenGL - implementation is required to support at least 16 vertex attributes in a - vertex shader. - </body> -</html> - - const int - - - - - log - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - texture2DLod - - - BUILD_IN_FUNC - (sampler2D, vec2, float lod) - vec4 - - - - - uvec2 - - - TYPE - a two-component unsigned integer vector - <html> - <head> - - </head> - <body> - a two-component unsigned integer vector - </body> -</html> - - - - - - floor - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - uvec3 - - - TYPE - a three-component unsigned integer vector - <html> - <head> - - </head> - <body> - a three-component unsigned integer vector - </body> -</html> - - - - - - uvec4 - - - TYPE - a four-component unsigned integer vector - <html> - <head> - - </head> - <body> - a four-component unsigned integer vector - </body> -</html> - - - - - - faceforward - - - BUILD_IN_FUNC - (float, float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2, vec2) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3, vec3) - vec3 - - - BUILD_IN_FUNC - (vec4 V, vec4 I, vec4 N) - vec4 - - - - - gl_TextureMatrixTranspose - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform mat4 - - - - - smooth - - - QUALIFIER - perspective correct interpolation - <html> - <head> - - </head> - <body> - <p> - perspective correct interpolation - </p> - </body> -</html> - - - - - - usampler2DArray - - - TYPE - a handle for accessing an unsigned integer 2D array texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 2D array texture - </body> -</html> - - - - - - ceil - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - smoothstep - - - BUILD_IN_FUNC - (float, float, float) - float - - - BUILD_IN_FUNC - (float, float, vec2) - vec2 - - - BUILD_IN_FUNC - (float, float, vec3) - vec3 - - - BUILD_IN_FUNC - (float, float, vec4) - vec4 - - - - - texture2DProjLod - - - BUILD_IN_FUNC - (sampler2D, vec3, float lod) - vec4 - - - BUILD_IN_FUNC - (sampler2D, vec4, float lod) - vec4 - - - - - isampler1D - - - TYPE - a handle for accessing an integer 1D texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 1D texture - </body> -</html> - - - - - - do - - - ITERATION - - - - - texture1DProjLod - - - BUILD_IN_FUNC - (sampler1D, vec2, float lod) - vec4 - - - BUILD_IN_FUNC - (sampler1D, vec4, float lod) - vec4 - - - - - max - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, float) - vec2 - - - BUILD_IN_FUNC - (vec3, float) - vec3 - - - BUILD_IN_FUNC - (vec4, float) - vec4 - - - - - sqrt - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - shadow1DProjLod - - - BUILD_IN_FUNC - (sampler1DShadow, vec4, float lod) - vec4 - - - - - highp - - - QUALIFIER - <html> - <head> - - </head> - <body> - qualifier for high precision - </body> -</html> - - - - - - gl_MaxVertexUniformComponents - - - BUILD_IN_VAR - value >= 512 ARB_vertex_shader required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum allowed uniform - components inside the vertex shader.<br> This limit refers to the storage for - the combination of build-in uniform variables and user-defined uniform - variables that are actually used in a vertex shader. This constant can be - also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB</i>. - The minimum value is 512 if <i>ARB_vertex_shader</i> is supported. - </body> -</html> - - const int - - - - - noise4 - - - BUILD_IN_FUNC - (float) - vec4 - - - BUILD_IN_FUNC - (vec2) - vec4 - - - BUILD_IN_FUNC - (vec3) - vec4 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - clamp - - - BUILD_IN_FUNC - (float, float, float) - float - - - BUILD_IN_FUNC - (vec2, float, float) - vec2 - - - BUILD_IN_FUNC - (vec3, float, float) - vec3 - - - BUILD_IN_FUNC - (vec4, float, float) - vec4 - - - - - sin - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric sine function. Angle in radians. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric sine function. Angle in radians. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric sine function. Angle in radians. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric sine function. Angle in radians. - </body> - </html> - - (vec4) - vec4 - - - - - noise2 - - - BUILD_IN_FUNC - (float) - vec2 - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec2 - - - BUILD_IN_FUNC - (vec4) - vec2 - - - - - noise3 - - - BUILD_IN_FUNC - (float) - vec3 - - - BUILD_IN_FUNC - (vec2) - vec3 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec3 - - - - - noise1 - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - float - - - BUILD_IN_FUNC - (vec3) - float - - - BUILD_IN_FUNC - (vec4) - float - - - - - gl_ProjectionMatrixInverseTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - reflect - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3) - vec3 - - - BUILD_IN_FUNC - (vec4 I, vec4 N) - vec4 - - - - - vec4 - - - TYPE - four component floating-point vector - - - - - cos - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric cosine function. Angle in radians. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric cosine function. Angle in radians. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric cosine function. Angle in radians. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric cosine function. Angle in radians. - </body> - </html> - - (vec4) - vec4 - - - - - centroid - - - QUALIFIER - centroid interpolation on multi-sample varyings - <html> - <head> - - </head> - <body> - Examples: - - <blockquote> - <code><nobr>centroid varying vec4 color;</nobr><br><nobr>centroid varying float value;</nobr></code> - </blockquote> - By definition, varying variables are set per vertex and are interpolated - in a perspective-correct manner over the primitive being rendered. - - <ul> - <li> - If single-sampling, the value is interpolated to the pixel's center, - and the <b>centroid </b>qualifier, if present, is ignored. - </li> - <li> - If multi-sampling, and <b>varying</b> is not qualified with <b>centroid</b>, - then the value must be interpolated to the pixel's center, or anywhere - within the pixel, or to one of the pixel's samples. - </li> - <li> - If multi-sampling and <b>varying </b>is qualified with <b>centroid</b>, - then the value must be interpolated to a point that lies in both the - pixel and in the primitive being rendered, or to one of the pixel's - samples that falls within the primitive. Due to the less regular - location of centroids, their derivatives may be less accurate than - non-centroid varying variables. - </li> - </ul> - <p> - When using the <b>centroid </b>keyword, it must immediately precede the <b>varying - </b>keyword. A fragment shader may read from varying variables and the - value read will be the interpolated value, as a function of the - fragment's position within the primitive. A fragment shader can not - write to a varying variable. - </p> - <p> - The type and presence of the <b>centroid </b>and <b>invariant </b>qualifiers - of varying variables with the same name declared in linked vertex and - fragments shaders must match, otherwise the link command will fail. Only - those varying variables used (i.e. read) in the fragment shader - executable must be written to by the vertex shader executable; declaring - superfluous varying variables in a vertex shader is permissible. - </p> - </body> -</html> - - - - - - texture1D - - - BUILD_IN_FUNC - (sampler1D, float, float bias) - vec4 - - - - - ivec4 - - - TYPE - four component integer vector - - - - - ivec3 - - - TYPE - three component integer vector - - - - - shadow2D - - - BUILD_IN_FUNC - (sampler2DShadow, vec3, float bias) - vec4 - - - - - varying - - - QUALIFIER - output from Vertex shader (READ/WRITE), interpolated, then input to Fragment shader (READ-ONLY) - <html> - <head> - - </head> - <body> - <p> - <b>Deprecated since 1.3, use <i>smooth</i> instead</b> - </p> - <p> - </p> - Varying variables provide the interface between the vertex shader and - geometry shader and also between the geometry shader and fragment shader - and the fixed functionality between them. If no geometry shader is - present, <b>varying</b> variables also provide the interface between the - vertex shader and fragment shader. - - <p> - The vertex, or geometry shader will compute values per vertex (such as - color, texture coordinates, etc) and write them to output variables - declared with the &quot;varying&quot; qualifier (vertex) or &quot;varying out&quot; - qualifiers (geometry). A vertex or geometry shader may also read these - output varying variables, getting back the same values it has written. - Reading an output varying variable in a vertex or geometry shader - returns undefined results if it is read before being written. - </p> - <p> - A geometry shader may also read from an input <b>varying</b> variable - declared with the &quot;varying in&quot; qualifiers. The value read will be the - same value as written by the vertex shader for that <b>varying</b> - variable. Since a geometry shader operates on primitives, each input - varying variable needs to be declared as an array. Each element of such - an array corresponds to a vertex of the primitive being processed. If - the varying variable is declared as a scalar or matrix in the vertex - shader, it will be a one-dimensional array in the geometry shader. Each - array can optionally have a size declared. If a size is not specified, - it inferred by the linker and depends on the value of the input - primitive type. See table 4.3.xxx (GLSL specification) to determine the - exact size. The read-only built-in constant <b>gl_VerticesIn</b> will be - set to this value by the linker. If a size is specified, it has to be - the size as given by table 4.3.xxx, otherwise a link error will occur. - The built-in constant <b>gl_VerticesIn</b>, if so desired, can be used - to size the array correctly for each input primitive type. Varying - variables can also be declared as arrays in the vertex shader. This - means that those, on input to the geometry shader, must be declared as - two- dimensional arrays. The first index to the two-dimensional array - holds the vertex number. Declaring a size for the first range of the - array is optional, just as it is for one-dimensional arrays. The second - index holds the per-vertex array data. Declaring a size for the second - range of the array is not optional, and has to match the declaration in - the vertex shader. - </p> - <p> - By definition, varying variables are set per vertex and are interpolated - in a perspective-correct manner over the primitive being rendered. If - single-sampling, the value is interpolated to the pixel's center, and - the <b>centroid </b>qualifier, if present, is ignored. If - multi-sampling, and <b>varying</b> is not qualified with <b>centroid</b>, - then the value must be interpolated to the pixel's center, or anywhere - within the pixel, or to one of the pixel's samples. If multi-sampling - and <b>varying </b>is qualified with <b>centroid</b>, then the value - must be interpolated to a point that lies in both the pixel and in the - primitive being rendered, or to one of the pixel's samples that falls - within the primitive. Due to the less regular location of centroids, - their derivatives may be less accurate than non-centroid varying - variables. - </p> - <p> - When using the <b>centroid </b>keyword, it must immediately precede the <b>varying - </b>keyword. A fragment shader may read from varying variables and the - value read will be the interpolated value, as a function of the - fragment's position within the primitive. A fragment shader can not - write to a varying variable. - </p> - <p> - The type and presence of the <b>centroid </b>and <b>invariant </b>qualifiers - of varying variables with the same name declared in linked vertex and - fragments shaders must match, otherwise the link command will fail. Only - those varying variables used (i.e. read) in the fragment shader - executable must be written to by the vertex shader executable; declaring - superfluous varying variables in a vertex shader is permissible. - </p> - <p> - Varying variables are declared as in the following examples: - </p> - <blockquote> - <nobr><code>varying vec3 normal;</code></nobr><code><br><nobr>centroid - varying vec2 TexCoord;</nobr><br><nobr>invariant centroid varying vec4 - Color;</nobr><br></code> - </blockquote> - <p> - The <b>varying </b>qualifier can be used only with <b>float</b>, - floating-point vectors, matrices, or arrays of these. Structures cannot - be <b>varying</b>. If no vertex shader executable is active, the fixed - functionality pipeline of OpenGL will compute values for the built-in - varying variables that will be consumed by the fragment shader - executable. Similarly, if no fragment shader executable is active, the - vertex shader executable is responsible for computing and writing to the - varying variables that are needed for OpenGL's fixed functionality - fragment pipeline. Varying variables are required to have global scope, - and must be declared outside of function bodies, before their first use. - </p> - </body> -</html> - - - - - - any - - - BUILD_IN_FUNC - (bvec2) - bool - - - BUILD_IN_FUNC - (bvec3) - bool - - - BUILD_IN_FUNC - (bvec4) - bool - - - - - notEqual - - - BUILD_IN_FUNC - (bvec2, bvec2) - bvec2 - - - BUILD_IN_FUNC - (bvec3, bvec3) - bvec3 - - - BUILD_IN_FUNC - (bvec4, bvec4) - bvec4 - - - - - ivec2 - - - TYPE - two component integer vector - - - - - sampler1DArray - - - TYPE - a handle for accessing a 1D array texture - <html> - <head> - - </head> - <body> - a handle for accessing a 1D array texture - </body> -</html> - - - - - - - sampler2DArrayShadow - - - TYPE - <html> - <head> - - </head> - <body> - a handle for accessing a 2D array depth texture with comparison - </body> -</html> - - - - - - - radians - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts degrees to radians, i.e. pi / 180 * degrees - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts degrees to radians, i.e. pi / 180 * degrees - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts degrees to radians, i.e. pi / 180 * degrees - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts degrees to radians, i.e. pi / 180 * degrees - </body> - </html> - - (vec4) - vec4 - - - - - usamplerCube - - - TYPE - a handle for accessing an unsigned integer cube mapped texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer cube mapped texture - </body> -</html> - - - - - - gl_TextureMatrixInverse - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform mat4 - - - - - texture2D - - - BUILD_IN_FUNC - (sampler2D, vec2, float bias) - vec4 - - - - - sampler1DArrayShadow - - - TYPE - a handle for accessing a 1D array depth texture with comparison - <html> - <head> - - </head> - <body> - a handle for accessing a 1D array depth texture with comparison - </body> -</html> - - - - - - - sign - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - texture2DProj - - - BUILD_IN_FUNC - (sampler2D, vec3, float bias) - vec4 - - - BUILD_IN_FUNC - (sampler2D, vec4, float bias) - vec4 - - - - - shadow1D - - - BUILD_IN_FUNC - (sampler1DShadow, vec3, float bias) - vec4 - - - - - gl_MaxTextureCoords - - - BUILD_IN_VAR - value >= 2 ARB_fragment_program required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum allowed number of - texture coordinate sets.<br>The number of texture coordinate sets defines - the maximum number of texture coordinates that can be attached to a - vertex. A texture coordinate set encompasses vertex texture coordinate attributes, as well as the texture matrix stack and texture generation state. This limit applies regardless of using a vertex shader or - fixed-function pipeline to perform vertex processing. This constant can be - also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_TEXTURE_COORDS_ARB</i>. - Minimum value is 2. - </body> -</html> - - const int - - - - - gl_MaxVertexTextureImageUnits - - - BUILD_IN_VAR - value >= 0 ARB_vertex_shader required - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum available texture image - units in a vertex shader.<br> The texture image unit constant specifyes the - number of hardware units that can be used simultaneously for accessing - texture maps. This constant can be also queried by calling <b>glGetIntegerv</b> - with the symbolic constant <i>GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB</i>. - The minimum value is 0. - </body> -</html> - - const int - - - - - vec3 - - - TYPE - three component floating-point vector - - - - - vec2 - - - TYPE - two component floating-point vector - - - - - case - - - KEYWORD - - - - - texture1DLod - - - BUILD_IN_FUNC - (sampler1D, float, float lod) - vec4 - - - - - asin - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc sine. Returns an angle whose sine is x. The range of values returned - by this function is [- Pi / 2 , Pi / 2 ] Results are undefined if |x| &gt; 1. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc sine. Returns an angle whose sine is x. The range of values returned - by this function is [- Pi / 2 , Pi / 2 ] Results are undefined if |x| &gt; 1. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc sine. Returns an angle whose sine is x. The range of values returned - by this function is [- Pi / 2 , Pi / 2 ] Results are undefined if |x| &gt; 1. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc sine. Returns an angle whose sine is x. The range of values returned - by this function is [- Pi / 2 , Pi / 2 ] Results are undefined if |x| &gt; 1. - </body> - </html> - - (vec4) - vec4 - - - - - texture3D - - - BUILD_IN_FUNC - (sampler3D, vec3, float bias) - vec4 - - - - - gl_LightModel - - - BUILD_IN_VAR - uniform gl_LightModelParameters - - - - - bvec2 - - - TYPE - two component boolean vector - - - - - bvec3 - - - TYPE - three component boolean vector - - - - - bvec4 - - - TYPE - four component boolean vector - - - - - normalize - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_MaxCombinedTextureImageUnits - - - BUILD_IN_VAR - value >= 2 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum available combined - texture image units in all shader processing parts of OpenGL.<br>The - texture image unit constant specifys the number of hardware units that can - be used simultaneously for accessing texture maps. This constant can be - also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB</i>. - The minimum value is 2. - - <p> - <b>Note:</b> If a vertex shader and a fragment shader both use the same - texture image unit, that counts as two units against this limit. - </p> - </body> -</html> - - const int - - - - - struct - - - KEYWORD - <html> - <head> - - </head> - <body> - Once a structure is defined, and its type is given a name, a constructor - is available with the same name to construct instances of that structure. - For example: - - <pre><code>struct light { - float intensity; - vec3 position; -}; -<nobr>light lightVar = light(3.0, vec3(1.0, 2.0, 3.0));</nobr></code> - </pre> - <p> - The arguments to the constructor will be used to set the structure's - fields, in order, using one argument per field. Each argument must be - the same type as the field it sets. - </p> - <p> - Structure constructors can be used as initializers or in expressions. - </p> - </body> -</html> - - - - - - all - - - BUILD_IN_FUNC - (bvec2) - bool - - - BUILD_IN_FUNC - (bvec3) - bool - - - BUILD_IN_FUNC - (bvec4) - bool - - - - - shadow2DLod - - - BUILD_IN_FUNC - (sampler2DShadow, vec3, float lod) - vec4 - - - - - precision - - - KEYWORD - <html> - <head> - - </head> - <body> - The precision statement -<pre> -precision precision-qualifier type; -</pre> -can be used to establish a default precision qualifier. The type field can be either int or <b>float</b>, and the -precision-qualifier can be <b>lowp, mediump, or highp</b>. Any other types or qualifiers will result in an error. -If type is float, the directive applies to non-precision-qualified floating point type (scalar, vector, and -matrix) declarations. If type is <b>int</b>, the directive applies to all non-precision-qualified integer type (scalar, -vector, signed, and unsigned) declarations. This includes global variable declarations, function return declarations, -function parameter declarations, and local variable declarations. Non-precision qualified declarations will use the precision qualifier -specified in the most recent precision statement that is still in scope. The <b>precision</b> statement has the same scoping rules as variable -declarations. If it is declared inside a compound statement, its effect stops at the end of the innermost -statement it was declared in. Precision statements in nested scopes override <b>precision</b> statements in outer -scopes. Multiple precision statements for the same basic type can appear inside the same scope, with later -statements overriding earlier statements within that scope. -<p> -The vertex language has the following predeclared globally scoped default - precision statements: -<pre> -precision highp float; -precision highp int; -</pre> -</p> -<p> -The fragment language has the following predeclared globally scoped default - precision statement: -<pre> -precision mediump int; -</pre> -</p> -The fragment language has no default precision qualifier for floating point types. Hence for float, floating -point vector and matrix variable declarations, either the declaration must include a precision qualifier or -the default float precision must have been previously declared. - </body> -</html> - - - - - - gl_BackMaterial - - - BUILD_IN_VAR - uniform gl_MaterialParameters - - - - - uniform - - - QUALIFIER - input to Vertex and Fragment shader from OpenGL or application (READ-ONLY) - <html> - <head> - - </head> - <body> - <nobr>The <b>uniform </b>qualifier is used to declare global variables - whose values are the same across the entire</nobr> <nobr>primitive being - processed. All <b>uniform </b>variables are read-only and are initialized - externally either at link</nobr> <nobr>time or through the API. The link - time initial value is either the value of the variable's initializer, if</nobr> - <nobr>present, or 0 if no initializer is present. Sampler types cannot - have initializers.</nobr><br>Example declarations are: - - <pre> <nobr>uniform vec4 lightPosition;</nobr> - <nobr>uniform vec3 color = vec3(0.7, 0.7, 0.2); // value assigned at link time </nobr></pre> -<p> - <nobr>The <b>uniform </b>qualifier can be used with any of the basic data - types, or when declaring a variable whose</nobr> <nobr>type is a - structure, or an array of any of these.</nobr> <nobr>There is an - implementation dependent limit on the amount of storage for uniforms that - can be used for</nobr> <nobr>each type of shader and if this is exceeded - it will cause a compile-time or link-time error. Uniform</nobr> <nobr>variables - that are declared but not used do not count against this limit. The number - of user-defined</nobr> <nobr>uniform variables and the number of built-in - uniform variables that are used within a shader are added</nobr> <nobr>together - to determine whether available uniform storage has been exceeded.</nobr> - - <p> - <nobr>If multiple shaders are linked together, then they will share a - single global uniform name space. Hence,</nobr> <nobr>the types and - initializers of uniform variables with the same name must match across - all shaders that are</nobr> <nobr>linked into a single executable. It is - legal for some shaders to provide an initializer for a particular</nobr> <nobr>uniform - variable, while another shader does not, but all provided initializers - must be equal.</nobr> - </p> - </body> -</html> - - - - - - matrixCompMult - - - BUILD_IN_FUNC - (mat2, mat2) - mat2 - - - BUILD_IN_FUNC - (mat3, mat3) - mat3 - - - BUILD_IN_FUNC - (mat4, mat4) - mat4 - - - - - gl_BackLightModelProduct - - - BUILD_IN_VAR - uniform gl_LightModelProducts - - - - - equal - - - BUILD_IN_FUNC - (bvec2, bvec2) - bvec2 - - - BUILD_IN_FUNC - (bvec3, bvec3) - bvec3 - - - BUILD_IN_FUNC - (bvec4, bvec4) - bvec4 - - - - - gl_NormalScale - - - BUILD_IN_VAR - uniform float - - - - - gl_ModelViewProjectionMatrixInverse - - - BUILD_IN_VAR - uniform mat4 - - - - - gl_DepthRange - - - BUILD_IN_VAR - uniform gl_DepthRangeParameters - - - - - isampler2DArray - - - TYPE - a handle for accessing an integer 2D array texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 2D array texture - </body> -</html> - - - - - - out - - - QUALIFIER - copied out on return, but not initialized - - - - - noperspective - - - QUALIFIER - linear interpolation - <html> - <head> - - </head> - <body> - <p> - linear interpolation - </p> - </body> -</html> - - - - - - samplerCube - - - TYPE - handle for accessing a cube mapped texture - <html> - <head> - - </head> - <body> - </body> - </html> - - - - - - sampler2DShadow - - - TYPE - handle for accessing a 2D depth texture with comparison - <html> - <head> - - </head> - <body> - </body> - </html> - - - - - - for - - - ITERATION - <html> - <head> - - </head> - <body> - - </body> -</html> - - - - - - break - - - JUMP - - - - - invariant - - - QUALIFIER - ensures all calculations of this variable give identical values across programs - <html> - <head> - - </head> - <body> - To ensure that a particular output variable is invariant, it is necessary - to use the <b>invariant </b>qualifier. It can either be used to qualify a - previously declared variable as being invariant - - <blockquote> - <code><nobr>invariant gl_Position; // make existing gl_Position be invariant</nobr><br><nobr>varying - vec3 Color;</nobr><br><nobr>invariant Color; // make existing Color be invariant</nobr><br></code> - </blockquote> - <p> - or as part of a declaration when a variable is declared - </p> - <blockquote> - <code><nobr>invariant varying vec3 Color;</nobr></code> - </blockquote> - <p> - The invariant qualifier must appear before any storage qualifiers (<b>varying</b>) - when combined with a declaration. Only variables output from a vertex - shader can be candidates for invariance. This includes user-defined - varying variables, the built-in vertex-side varying variables, and the - special vertex variables <i>gl_Position </i>and <i>gl_PointSize</i>. For - varying variables leaving a vertex shader and coming into a fragment - shader with the same name, the <b>invariant </b>keyword has to be used - in both the vertex and fragment shaders. The <b>invariant </b>keyword - can be followed by a comma separated list of previously declared - identifiers. All uses of <b>invariant </b>must be at the global scope, - and before any use of the variables being declared as invariant. - </p> - <p> - To guarantee invariance of a particular output variable across two - programs, the following must also be true: - </p> - <ul> - <li> - The output variable is declared as invariant in both programs. - </li> - <li> - The same values must be input to all shader input variables consumed - by expressions and flow control contributing to the value assigned to - the output variable. - </li> - <li> - The texture formats, texel values, and texture filtering are set the - same way for any texture function calls contributing to the value of - the output variable. - </li> - <li> - All input values are all operated on in the same way. All operations - in the consuming expressions and any intermediate expressions must be - the same, with the same order of operands and same associativity, to - give the same order of evaluation. Intermediate variables and - functions must be declared as the same type with the same explicit or - implicit precision qualifiers. Any control flow affecting the output - value must be the same, and any expressions consumed to determine this - control flow must also follow these invariance rules. - </li> - <li> - All the data flow and control flow leading to setting the invariant - output variable reside in a single compilation unit. - </li> - </ul> - <p> - Essentially, all the data flow and control flow leading to an invariant - output must match. Initially, by default, all output variables are - allowed to be variant. To force all output variables to be invariant, - use the pragma - </p> - <blockquote> - <code>#pragma STDGL invariant(all)</code> - </blockquote> - <p> - before all declarations in a shader. If this pragma is used after the - declaration of any variables or functions, then the set of outputs that - behave as invariant is undefined. It is an error to use this pragma in a - fragment shader. - </p> - <p> - Generally, invariance is ensured at the cost of flexibility in - optimization, so performance can be degraded by use of invariance. - Hence, use of this pragma is intended as a debug aid, to avoid - individually declaring all output variables as invariant. - </p> - </body> -</html> - - - - - - abs - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Returns x if x &gt;= 0, otherwise it returns -x - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Returns x if x &gt;= 0, otherwise it returns -x - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Returns x if x &gt;= 0, otherwise it returns -x - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Returns x if x &gt;= 0, otherwise it returns -x - </body> - </html> - - (vec4) - vec4 - - - - - greaterThanEqual - - - BUILD_IN_FUNC - (ivec2, ivec2) - bvec2 - - - BUILD_IN_FUNC - (ivec3, ivec3) - bvec3 - - - BUILD_IN_FUNC - (ivec4, ivec4) - bvec4 - - - - - g_NormalMatrix - - - BUILD_IN_VAR - uniform mat3 - - - - - false - - - KEYWORD - boolean value - - - - - gl_ModelViewMatrixInverse - - - BUILD_IN_VAR - uniform mat4 - - - - - g_WorldViewProjectionMatrix - - - BUILD_IN_VAR - uniform mat4 - - - - - refract - - - BUILD_IN_FUNC - (float, float, float eta) - float - - - BUILD_IN_FUNC - (vec2, vec2, float eta) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3, float eta) - vec3 - - - BUILD_IN_FUNC - (vec4 I, vec4 M, float eta) - vec4 - - - - - dFdx - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - dFdy - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_ModelViewProjectionMatrixInverseTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - lessThanEqual - - - BUILD_IN_FUNC - (ivec2, ivec2) - bvec2 - - - BUILD_IN_FUNC - (ivec3, ivec3) - bvec3 - - - BUILD_IN_FUNC - (ivec4, ivec4) - bvec4 - - - - - usampler1D - - - TYPE - a handle for accessing an unsigned integer 1D texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 1D texture - </body> -</html> - - - - - - not - - - BUILD_IN_FUNC - (bvec2) - bvec2 - - - BUILD_IN_FUNC - (bvec3) - bvec3 - - - BUILD_IN_FUNC - (bvec4) - bvec4 - - - - - gl_ModelViewMatrixInverseTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - greaterThan - - - BUILD_IN_FUNC - (ivec2, ivec2) - bvec2 - - - BUILD_IN_FUNC - (ivec3, ivec3) - bvec3 - - - BUILD_IN_FUNC - (ivec4, ivec4) - bvec4 - - - - - gl_Fog - - - BUILD_IN_VAR - uniform gl_FogParameters - - - - - tan - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric tangent function. Angle in radians. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric tangent function. Angle in radians. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric tangent function. Angle in radians. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The standard trigonometric tangent function. Angle in radians. - </body> - </html> - - (vec4) - vec4 - - - - - cross - - - BUILD_IN_FUNC - (vec3, vec3) - vec3 - - - - - gl_ClipPlane - - - BUILD_IN_VAR - INDEX < gl_MaxClipPlanes - [] - uniform vec4 - - - - - textureCube - - - BUILD_IN_FUNC - (samplerCube, vec3, float bias) - vec4 - - - - - const - - - QUALIFIER - constant function input - - - - - gl_MaxTextureUnits - - - BUILD_IN_VAR - value >= 2 since OpenGL 1.3 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum available multitexture - statges.<br>This constant can - be also queried by calling <b>glGetIntegerv</b> with the symbolic constant <i>GL_MAX_TEXTURE_UNITS</i>. - The minimum value is 2. - </body> -</html> - - const int - - - - - mediump - - - QUALIFIER - <html> - <head> - - </head> - <body> - qualifier for medium precision - </body> -</html> - - - - - - inout - - - QUALIFIER - value initialized on entry, and copied out on return - - - - - switch - - - KEYWORD - - - - - gl_FrontLightModelProduct - - - BUILD_IN_VAR - uniform gl_LightModelProducts - - - - - shadow1DProj - - - BUILD_IN_FUNC - (sampler1DShadow, vec4, float bias) - vec4 - - - - - usampler1DArray - - - TYPE - a handle for accessing an unsigned integer 1D array texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 1D array texture - </body> -</html> - - - - - - gl_EyePlaneT - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - gl_EyePlaneS - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - gl_EyePlaneR - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - distance - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2) - float - - - BUILD_IN_FUNC - (vec3, vec3) - float - - - BUILD_IN_FUNC - (vec4, vec4) - float - - - - - gl_EyePlaneQ - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - sampler1DShadow - - - TYPE - handle for accessing a 1D depth texture with comparison - <html> - <head> - - </head> - <body> - a handle for accessing a 1D depth texture with comparison - </body> -</html> - - - - - - g_ProjectionMatrix - - - BUILD_IN_VAR - uniform mat4 - - - - - gl_TextureEnvColor - - - BUILD_IN_VAR - INDEX < gl_MaxTextureUnits - [] - uniform vec4 - - - - - length - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - float - - - BUILD_IN_FUNC - (vec3) - float - - - BUILD_IN_FUNC - (vec4) - float - - - - - gl_ModelViewMatrixTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - gl_FrontMaterial - - - BUILD_IN_VAR - uniform gl_MaterialParameters - - - - - sampler2DArray - - - TYPE - a handle for accessing a 2D array texture - <html> - <head> - - </head> - <body> - a handle for accessing a 2D array texture - </body> -</html> - - - - - - - min - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (vec2, float) - vec2 - - - BUILD_IN_FUNC - (vec3, float) - vec3 - - - BUILD_IN_FUNC - (vec4, float) - vec4 - - - - - gl_LightSource - - - BUILD_IN_VAR - INDEX < gl_MaxLights - [] - uniform gl_LightSourceParameters - - - - - return - - - JUMP - - - - - void - - - TYPE - for functions that do not return a value - - - - - true - - - KEYWORD - boolean value - - - - - mix - - - BUILD_IN_FUNC - (float, float, float) - float - - - BUILD_IN_FUNC - (vec2, vec2, float) - vec2 - - - BUILD_IN_FUNC - (vec3, vec3, float) - vec3 - - - BUILD_IN_FUNC - (vec4, vec4, float) - vec4 - - - - - texture3DProj - - - BUILD_IN_FUNC - (sampler3D, vec4, float bias) - vec4 - - - - - gl_MaxDrawBuffers - - - BUILD_IN_VAR - value >= 1 ARB_draw_buffers required - min = 1; // proposed ARB_draw_buffers - const int - - - - - gl_ProjectionMatrixTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - lowp - - - QUALIFIER - <html> - <head> - - </head> - <body> - qualifier for low precision - </body> -</html> - - - - - - isamplerCube - - - TYPE - a handle for accessing an integer cube mapped texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer cube mapped texture - </body> -</html> - - - - - - g_WorldViewMatrix - - - BUILD_IN_VAR - uniform mat4 - - - - - fwidth - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - atan - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y - are used to determine what quadrant the angle is in. The range of values - returned by this function is [-Pi, Pi]. Results are undefined if x and y - are both 0. - </body> - </html> - - (float, float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y - are used to determine what quadrant the angle is in. The range of values - returned by this function is [-Pi, Pi]. Results are undefined if x and y - are both 0. - </body> - </html> - - (vec2, vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y - are used to determine what quadrant the angle is in. The range of values - returned by this function is [-Pi, Pi]. Results are undefined if x and y - are both 0. - </body> - </html> - - (vec3, vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y - are used to determine what quadrant the angle is in. The range of values - returned by this function is [-Pi, Pi]. Results are undefined if x and y - are both 0. - </body> - </html> - - (vec4, vec4) - vec4 - - - - - gl_MaxVaryingFloats - - - BUILD_IN_VAR - value >= 32 - min = 32; // ARB_vertex_shader - const int - - - - - fract - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_Point - - - BUILD_IN_VAR - uniform gl_PointParameters - - - - - texture3DProjLod - - - BUILD_IN_FUNC - (sampler3D, vec4, float lod) - vec4 - - - - - gl_ObjectPlaneS - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - gl_ObjectPlaneT - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - isampler2D - - - TYPE - a handle for accessing an integer 2D texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 2D texture - </body> -</html> - - - - - - exp2 - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_ObjectPlaneR - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - gl_ObjectPlaneQ - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform vec4 - - - - - lessThan - - - BUILD_IN_FUNC - (ivec2, ivec2) - bvec2 - - - BUILD_IN_FUNC - (ivec3, ivec3) - bvec3 - - - BUILD_IN_FUNC - (ivec4, ivec4) - bvec4 - - - - - shadow2DProjLod - - - BUILD_IN_FUNC - (sampler2DShadow, vec4, float lod) - vec4 - - - - - gl_MaxTextureImageUnits - - - BUILD_IN_VAR - value >= 2 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum available texture image - units in a fragment shader.<br> The texture image unit constant specifyes the - number of hardware units that can be used simultaneously for accessing - texture maps. This constant can be also queried by calling <b>glGetIntegerv</b> - with the symbolic constant <i>GL_MAX_TEXTURE_IMAGE_UNITS_ARB</i>. The - minimum value is 2. - </body> -</html> - - const int - - - - - gl_FrontLightProduct - - - BUILD_IN_VAR - INDEX < gl_MaxLights - [] - uniform gl_LightProducts - - - - - gl_MaxClipPlanes - - - BUILD_IN_VAR - value >= 6 since OpenGL 1.0 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum supported clip planes. - - <p> - This constant can be also queried by calling <b>glGetIntegerv</b> with - the symbolic constant <i>GL_MAX_CLIP_PLANES_ARB</i>. The minimum value - is 6. - </p> - </body> -</html> - - const int - - - - - inversesqrt - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - gl_TextureMatrixInverseTranspose - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform mat4 - - - - - int - - - TYPE - signed integer - - - - - gl_MaxLights - - - BUILD_IN_VAR - value >= 8 since OpenGL 1.0 - <html> - <head> - - </head> - <body> - Implementation dependent constant for the maximum allowed dynamic light - sources.<br> The minimum value is 8. - </body> -</html> - - const int - - - - - flat - - - QUALIFIER - no interpolation - <html> - <head> - - </head> - <body> - <p> - no interpolation. - </p> - </body> -</html> - - - - - - log2 - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - isampler3D - - - TYPE - a handle for accessing an integer 3D texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 3D texture - </body> -</html> - - - - - - exp - - - BUILD_IN_FUNC - (float) - float - - - BUILD_IN_FUNC - (vec2) - vec2 - - - BUILD_IN_FUNC - (vec3) - vec3 - - - BUILD_IN_FUNC - (vec4) - vec4 - - - - - ftransform - - - BUILD_IN_FUNC - () - vec4 - - - - - mat4 - - - TYPE - 4×4 floating-point matrix - - - - - default - - - KEYWORD - - - - - sampler1D - - - TYPE - handle for accessing a 1D texture - - - - - mat2 - - - TYPE - 2×2 floating-point matrix - - - - - mat3 - - - TYPE - 3×3 floating-point matrix - - - - - gl_ModelViewProjectionMatrixTranspose - - - BUILD_IN_VAR - uniform mat4 - - - - - textureCubeLod - - - BUILD_IN_FUNC - (samplerCube, vec3, float lod) - vec4 - - - - - usampler2D - - - TYPE - a handle for accessing an unsigned integer 2D texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 2D texture - </body> -</html> - - - - - - gl_TextureMatrix - - - BUILD_IN_VAR - INDEX < gl_MaxTextureCoords - [] - uniform mat4 - - - - - gl_ProjectionMatrixInverse - - - BUILD_IN_VAR - uniform mat4 - - - - - shadow1DLod - - - BUILD_IN_FUNC - (sampler1DShadow, vec3, float lod) - vec4 - - - - - while - - - ITERATION - - - - - sampler2D - - - TYPE - handle for accessing a 2D texture - - - - - texture1DProj - - - BUILD_IN_FUNC - (sampler1D, vec2, float bias) - vec4 - - - BUILD_IN_FUNC - (sampler1D, vec4, float bias) - vec4 - - - - - if - - - SELECTION - - - - - shadow2DProj - - - BUILD_IN_FUNC - (sampler2DShadow, vec4, float bias) - vec4 - - - - - isampler1DArray - - - TYPE - a handle for accessing an integer 1D array texture - <html> - <head> - - </head> - <body> - a handle for accessing an integer 1D array texture - </body> -</html> - - - - - - acos - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc cosine. Returns an angle whose cosine is x. The range of values - returned by this function is [0, pi]. Results are undefined if |x|&gt;1. - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc cosine. Returns an angle whose cosine is x. The range of values - returned by this function is [0, pi]. Results are undefined if |x|&gt;1. - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc cosine. Returns an angle whose cosine is x. The range of values - returned by this function is [0, pi]. Results are undefined if |x|&gt;1. - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Arc cosine. Returns an angle whose cosine is x. The range of values - returned by this function is [0, pi]. Results are undefined if |x|&gt;1. - </body> - </html> - - (vec4) - vec4 - - - - - usampler3D - - - TYPE - a handle for accessing an unsigned integer 3D texture - <html> - <head> - - </head> - <body> - a handle for accessing an unsigned integer 3D texture - </body> -</html> - - - - - - degrees - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts radians to degrees, i.e. 180/Pi * radians - </body> - </html> - - (float) - float - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts radians to degrees, i.e. 180/Pi * radians - </body> - </html> - - (vec2) - vec2 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts radians to degrees, i.e. 180/Pi * radians - </body> - </html> - - (vec3) - vec3 - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - Converts radians to degrees, i.e. 180/Pi * radians - </body> - </html> - - (vec4) - vec4 - - - - - in - - - QUALIFIER - value initialized on entry, not copied on return (default) - - - - - sampler3D - - - TYPE - handle for accessing a 3D texture - - - - - continue - - - JUMP - - - - - bool - - - TYPE - conditional type, taking on values of true or false (also known as boolean) - - - - - step - - - BUILD_IN_FUNC - (float, float) - float - - - BUILD_IN_FUNC - (float, vec2) - vec2 - - - BUILD_IN_FUNC - (float, vec3) - vec3 - - - BUILD_IN_FUNC - (float, vec4) - vec4 - - - - - uint - - - TYPE - an unsigned integer - <html> - <head> - - </head> - <body> - an unsigned integer - </body> -</html> - - - - - - - - gl_FragDepth - - - BUILD_IN_VAR - pixel depth - <html> - <head> - - </head> - <body> - Writing to <i>gl_FragDepth </i>will establish the depth value for the - fragment being processed. If depth buffering is enabled, and no shader - writes <i>gl_FragDepth</i>, then the fixed function value for depth will - be used as the fragment&#8217;s depth value. If a shader statically assigns a - value to <i>gl_FragDepth</i>, and there is an execution path through the - shader that does not set <i>gl_FragDepth</i>, then the value of the - fragment&#8217;s depth may be undefined for executions of the shader that take - that path. That is, if the set of linked fragment shaders statically - contain a write to <i>gl_FragDepth</i>, then it is responsible for always - writing it. - - <p> - (A shader contains a <i>static assignment </i>to a variable <i>x </i>if, - after pre-processing, the shader contains a statement that would write - to <i>x</i>, whether or not run-time flow of control will cause that - statement to be executed.) - </p> - </body> - </html> - - float - - - - - gl_FragCoord - - - BUILD_IN_VAR - pixel coordinate (READ ONLY) - <html> - <head> - - </head> - <body> - The variable <i>gl_FragCoord </i>is available as a read-only variable from - within fragment shaders and it holds the window relative coordinates x, y, - z, and 1/w values for the fragment. If multi-sampling, this value can be - for any location within the pixel, or one of the fragment samples. The use - of <b>centroid </b>varyings does not further restrict this value to be - inside the current primitive. This value is the result of the fixed - functionality that interpolates primitives after vertex processing to - generate fragments. The <i>z </i>component is the depth value that would - be used for the fragment&#8217;s depth if no shader contained no writes to <i>gl_FragDepth. - </i>This is useful for invariance if a shader conditionally computes <i>gl_FragDepth - </i>but otherwise wants the fixed functionality fragment depth. - </body> - </html> - - vec4 - - - - - gl_PointCoord - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The values in <i>gl_PointCoord </i>are two-dimensional coordinates - indicating where within a point primitive the current fragment is located, - when point sprites are enabled. They range from 0.0 to 1.0 across the - point. If the current primitive is not a point, or if point sprites are - not enabled, then the values read from gl_PointCoord are undefined. - </body> - </html> - - vec2 - - - - - gl_FrontFacing - - - BUILD_IN_VAR - (READ ONLY) - <html> - <head> - - </head> - <body> - Fragment shaders have access to the read-only built-in variable <i>gl_FrontFacing, - </i>whose value is <b>true </b>if the fragment belongs to a front-facing - primitive.<p> One use of this is to emulate two-sided lighting - by selecting one of two colors calculated by the vertex shader or geometry - shader. - </body> -</html> - - bool - - - - - gl_Color - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The values in <i>gl_Color </i>and <i>gl_SecondaryColor </i>will be derived - automatically by the system from <i>gl_FrontColor, gl_BackColor, - gl_FrontSecondaryColor, </i>and <i>gl_BackSecondaryColor </i>based on - which face is visible. If fixed functionality is used for vertex - processing, then <i>gl_FogFragCoord </i>will either be the z-coordinate of - the fragment in eye space, or the interpolation of the fog coordinate, as - described in section 3.10 of the OpenGL 1.4 Specification. The <i>gl_TexCoord[] - </i>values are the interpolated <i>gl_TexCoord[] </i>values from a vertex - shader or the texture coordinates of any fixed pipeline based vertex - functionality. - </body> - </html> - - varying vec4 - - - - - discard - - - JUMP - <html> - <head> - - </head> - <body> - The <b>discard </b>keyword is only allowed within fragment shaders. It can - be used within a fragment shader to abandon the operation on the current - fragment. This keyword causes the fragment to be discarded and no updates - to any buffers will occur. It would typically be used within a conditional - statement, for example: - - <pre> if (intensity &lt; 0.0) - discard; - </pre> - A fragment shader may test a fragment&#8217;s alpha value and discard the - fragment based on that test. However, it should be noted that coverage - testing occurs after the fragment shader runs, and the coverage test can - change the alpha value. - </body> - </html> - - - - - - gl_SecondaryColor - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The values in <i>gl_Color </i>and <i>gl_SecondaryColor </i>will be derived - automatically by the system from <i>gl_FrontColor, gl_BackColor, - gl_FrontSecondaryColor, </i>and <i>gl_BackSecondaryColor </i>based on - which face is visible. If fixed functionality is used for vertex - processing, then <i>gl_FogFragCoord </i>will either be the z-coordinate of - the fragment in eye space, or the interpolation of the fog coordinate, as - described in section 3.10 of the OpenGL 1.4 Specification. The <i>gl_TexCoord[] - </i>values are the interpolated <i>gl_TexCoord[] </i>values from a vertex - shader or the texture coordinates of any fixed pipeline based vertex - functionality. - </body> - </html> - - varying vec4 - - - - - gl_FragData - - - BUILD_IN_VAR - INDEX<gl_MaxDrawBuffers - <html> - <head> - - </head> - <body> - The variable <i>gl_FragData </i>is an array. Writing to <i>gl_FragData[n] </i>specifies - the fragment data that will be used by the subsequent fixed functionality - pipeline for data <i>n</i>. If subsequent fixed functionality consumes - fragment data and an execution of a fragment shader executable does not - write a value to it, then the fragment data consumed is undefined. - </body> - </html> - - [] - vec4 - - - - - gl_FragColor - - - BUILD_IN_VAR - pixel color - <html> - <head> - - </head> - <body> - If a shader statically assigns a value to <i>gl_FragColor</i>, it may not - assign a value to any element of <i>gl_FragData</i>. If a shader - statically writes a value to any element of <i>gl_FragData</i>, it may not - assign a value to <i>gl_FragColor</i>. That is, a shader may assign values - to either <i>gl_FragColor </i>or <i>gl_FragData</i>, but not both. - Multiple shaders linked together must also consistently write just one of - these variables. - </body> - </html> - - vec4 - - - - - - - gl_BackColor - - - BUILD_IN_VAR - enable GL_VERTEX_PROGRAM_TWO_SIDE - varying vec4 - - - - - gl_FogFragCoord - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - For <i>gl_FogFragCoord</i>, the value written will be used as the &quot;c&quot; - value on page 160 of the OpenGL 1.4 Specification by the fixed - functionality pipeline. For example, if the z-coordinate of the fragment - in eye space is desired as &quot;c&quot;, then that's what the vertex or geometry shader - executable should write into <i>gl_FogFragCoord</i>. - </body> - </html> - - varying float - - - - - gl_Position - - - BUILD_IN_VAR - must be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_Position</i> is available only in the vertex and - geometry language and is intended for writing the homogeneous vertex - position. - - <p> - It can be written at any time during shader execution. It may also be - read back by the shader after being written. This value will be used by - primitive assembly, clipping, culling, and other fixed functionality - operations that operate on primitives after vertex or geometry - processing has occurred. Compilers may generate a diagnostic message if - they detect <i>gl_Position</i> is read before being written, but not all - such cases are detectable. Writing to <i>gl_Position</i> is optional. If <i>gl_Position</i> - is not written but subsequent stages of the OpenGL pipeline consume <i>gl_Position</i>, - then results are undefined. - </p> - </body> -</html> - - vec4 - - - - - gl_TexCoord - - - BUILD_IN_VAR - INDEX<gl_MaxTextureCoords - <html> - <head> - - </head> - <body> - As with all arrays, indices used to subscript <i>gl_TexCoord </i>must - either be an integral constant expressions, or this array must be - re-declared by the shader with a size. The size can be at most <i>gl_MaxTextureCoords</i>. - Using indexes close to 0 may aid the implementation in preserving varying - resources. - </body> - </html> - - [] - varying vec4 - - - - - gl_FrontSecondaryColor - - - BUILD_IN_VAR - varying vec4 - - - - - attribute - - - QUALIFIER - linkage between a vertex shader and OpenGL for per-vertex data (READ-ONLY) - <html> - <head> - - </head> - <body> - The <b>attribute </b>qualifier is used to declare variables that are - passed to a vertex shader from OpenGL on a per-vertex basis. It is an - error to declare an attribute variable in any type of shader other than a - vertex shader. Attribute variables are read-only as far as the vertex - shader is concerned. Values for attribute variables are passed to a vertex - shader through the OpenGL vertex API or as part of a vertex array. They - convey vertex attributes to the vertex shader and are expected to change - on every vertex shader run. The attribute qualifier can be used only with <b>float, - </b>floating-point vectors, and matrices. Attribute variables cannot be - declared as arrays or structures.<p>Example declarations: - - <pre>attribute vec4 position; -attribute vec3 normal; -attribute vec2 texCoord;</pre> - <p> - All the standard OpenGL vertex attributes have built-in variable names - to allow easy integration between user programs and OpenGL vertex - functions. See Section 7 &quot;Built-in Variables&quot; of the OpenGL Shading - Language specification; for a list of the built-in attribute names. - </p> - <p> - It is expected that graphics hardware will have a small number of fixed - locations for passing vertex attributes. Therefore, the OpenGL Shading - language defines each non-matrix attribute variable as having space for - up to four floating-point values (i.e., a vec4). There is an - implementation dependent limit on the number of attribute variables that - can be used and if this is exceeded it will cause a link error. - (Declared attribute variables that are not used do not count against - this limit.) A float attribute counts the same amount against this limit - as a vec4, so applications may want to consider packing groups of four - unrelated float attributes together into a vec4 to better utilize the - capabilities of the underlying hardware. A matrix attribute will use up - multiple attribute locations. The number of locations used will equal - the number of columns in the matrix. - </p> - <p> - Attribute variables are required to have global scope, and must be - declared outside of function bodies, before their first use. - </p> - </body> -</html> - - - - - - gl_BackSecondaryColor - - - BUILD_IN_VAR - enable GL_VERTEX_PROGRAM_TWO_SIDE - varying vec4 - - - - - gl_FrontColor - - - BUILD_IN_VAR - varying vec4 - - - - - gl_FogCoord - - - BUILD_IN_VAR - attribute float - - - - - gl_MultiTexCoord7 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord6 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord5 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_PointSize - - - BUILD_IN_VAR - may be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_PointSize </i>is available only in the vertex and geometry language - and is intended to write the size of the point to be - rasterized. It is measured in pixels. - - <p> - If <i>gl_PointSize </i>or <i>gl_ClipVertex </i>are not written to, their - values are undefined. Any of these variables can be read back by the - shader after writing to them, to retrieve what was written. Reading them - before writing them results in undefined behavior. If they are written - more than once, it is the last value written that is consumed by the - subsequent operations. These built-in variables have global scope. - </p> - </body> - </html> - - float - - - - - inColor - - - BUILD_IN_VAR - attribute vec4 - - - - - inTexCoord - - - BUILD_IN_VAR - attribute vec4 - - - - - inNormal - - - BUILD_IN_VAR - attribute vec3 - - - - - inPosition - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_SecondaryColor - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord4 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord3 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_ClipVertex - - - BUILD_IN_VAR - may be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_ClipVertex </i>is available only in the vertex and geometry language - and provides a place for vertex and geometry shaders to write the coordinate to be used - with the user clipping planes. The user must ensure the clip vertex and - user clipping planes are defined in the same coordinate space. User clip - planes work properly only under linear transform. It is undefined what - happens under non-linear transform. - - <p> - If <i>gl_PointSize </i>or <i>gl_ClipVertex </i>are not written to, their - values are undefined. Any of these variables can be read back by the - shader after writing to them, to retrieve what was written. Reading them - before writing them results in undefined behavior. If they are written - more than once, it is the last value written that is consumed by the - subsequent operations. These built-in variables have global scope. - </p> - </body> - </html> - - vec4 - - - - - gl_MultiTexCoord2 - - - BUILD_IN_VAR - attribute vec4 - - - - - gl_MultiTexCoord1 - - - BUILD_IN_VAR - attribute vec4 - - - - - - - gl_FogFragCoord - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - For <i>gl_FogFragCoord</i>, the value written will be used as the &quot;c&quot; - value on page 160 of the OpenGL 1.4 Specification by the fixed - functionality pipeline. For example, if the z-coordinate of the fragment - in eye space is desired as &quot;c&quot;, then that's what the vertex or geometry shader - executable should write into <i>gl_FogFragCoord</i>. - </body> - </html> - - varying out float - - - - - gl_BackColor - - - BUILD_IN_VAR - enable GL_VERTEX_PROGRAM_TWO_SIDE - varying out vec4 - - - - - gl_Layer - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The built-in output variable <i>gl_Layer</i> is available only in the - geometry language, and provides the number of the layer of textures - attached to a FBO to direct rendering to.<p> If a shader statically assigns a - value to <i>gl_Layer</i>, layered rendering mode is enabled. See section - 2.16.4 for a detailed explanation. If a shader statically assigns a value - to <i>gl_Layer</i>, and there is an execution path through the shader that - does not set <i>gl_Layer</i>, then the value of <i>gl_Layer</i> may be - undefined for executions of the shader that take that path. - </body> -</html> - - int - - - - - gl_Position - - - BUILD_IN_VAR - must be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_Position</i> is available only in the vertex and - geometry language and is intended for writing the homogeneous vertex - position. - - <p> - It can be written at any time during shader execution. It may also be - read back by the shader after being written. This value will be used by - primitive assembly, clipping, culling, and other fixed functionality - operations that operate on primitives after vertex or geometry - processing has occurred. Compilers may generate a diagnostic message if - they detect <i>gl_Position</i> is read before being written, but not all - such cases are detectable. Writing to <i>gl_Position</i> is optional. If <i>gl_Position</i> - is not written but subsequent stages of the OpenGL pipeline consume <i>gl_Position</i>, - then results are undefined. - </p> - </body> -</html> - - vec4 - - - - - gl_TexCoord - - - BUILD_IN_VAR - INDEX<gl_MaxTextureCoords - <html> - <head> - - </head> - <body> - As with all arrays, indices used to subscript <i>gl_TexCoord </i>must - either be an integral constant expressions, or this array must be - re-declared by the shader with a size. The size can be at most <i>gl_MaxTextureCoords</i>. - Using indexes close to 0 may aid the implementation in preserving varying - resources. - </body> - </html> - - [] - varying out vec4 - - - - - gl_FogFragCoordIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in float - - - - - EmitVertex - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The function <b>EmitVertex()</b> specifies that a vertex is completed. A - vertex is added to the current output primitive using the current values - of the varying output variables and the current values of the special - built-in output variables <b>gl_PointSize</b>, <b>gl_ClipVertex</b>, <b>gl_Layer</b>, - gl_Position</b> and <b>gl_PrimitiveID</b>. - - <p> - The values of any unwritten output variables are undefined. The values - of all varying output variables and the special built-in output - variables are undefined after a call to <b>EmitVertex()</b>. If a - geometry shader, in one invocation, emits more vertices than the value <i>GEOMETRY_VERTICES_OUT_EXT</i>, - these emits may have no effect. - </p> - </body> -</html> - - () - void - - - - - gl_BackColorIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_PointSizeIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in float - - - - - gl_FrontSecondaryColor - - - BUILD_IN_VAR - varying out vec4 - - - - - gl_BackSecondaryColorIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_ClipVertexIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_BackSecondaryColor - - - BUILD_IN_VAR - enable GL_VERTEX_PROGRAM_TWO_SIDE - varying out vec4 - - - - - gl_TexCoordIn - - - BUILD_IN_VAR - value <= gl_MaxTextureCoords - -value <= gl_MaxTextureCoords - [gl_VerticesIn][] - varying in vec4 - - - - - gl_FrontColorIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_FrontColor - - - BUILD_IN_VAR - varying out vec4 - - - - - gl_FrontSecondaryColorIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_VerticesIn - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - <p> - Value set at link time. - </p> - </body> -</html> - - const int - - - - - gl_PointSize - - - BUILD_IN_VAR - may be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_PointSize </i>is available only in the vertex and geometry language - and is intended to write the size of the point to be - rasterized. It is measured in pixels. - - <p> - If <i>gl_PointSize </i>or <i>gl_ClipVertex </i>are not written to, their - values are undefined. Any of these variables can be read back by the - shader after writing to them, to retrieve what was written. Reading them - before writing them results in undefined behavior. If they are written - more than once, it is the last value written that is consumed by the - subsequent operations. These built-in variables have global scope. - </p> - </body> - </html> - - float - - - - - EndPrimitive - - - BUILD_IN_FUNC - <html> - <head> - - </head> - <body> - The function <b>EndPrimitive()</b> specifies that the current output - primitive is completed and a new output primitive (of the same type) - should be started. This function does not emit a vertex.<br> The effect of <b>EndPrimitive()</b> - is roughly equivalent to calling End followed by a new Begin, where the - primitive mode is taken from the program object parameter <i>GEOMETRY_OUTPUT_TYPE_EXT</i>. - If the output primitive type is <i>POINTS</i>, calling <b>EndPrimitive()</b> - is optional. - - <p> - A geometry shader starts with an output primitive containing no - vertices. When a geometry shader terminates, the current output - primitive is automatically completed. It is not necessary to call <b>EndPrimitive()</b> - if the geometry shader writes only a single primitive. - </p> - </body> -</html> - - () - void - - - - - gl_PositionIn - - - BUILD_IN_VAR - [gl_VerticesIn] - varying in vec4 - - - - - gl_PrimitiveID - - - BUILD_IN_VAR - <html> - <head> - - </head> - <body> - The built-in output variable <i>gl_PrimitiveID</i> is available only in the - geometry language and provides a single integer that serves as a primitive - identifier.<p> This written primitive ID is available to fragment shaders. - If a fragment shader using primitive IDs is active and a geometry shader - is also active, the geometry shader must write to <i>gl_PrimitiveID</i> or the - primitive ID in the fragment shader number is undefined. - </body> -</html> - - int - - - - - gl_ClipVertex - - - BUILD_IN_VAR - may be written from vertex shader - <html> - <head> - - </head> - <body> - The variable <i>gl_ClipVertex </i>is available only in the vertex and geometry language - and provides a place for vertex and geometry shaders to write the coordinate to be used - with the user clipping planes. The user must ensure the clip vertex and - user clipping planes are defined in the same coordinate space. User clip - planes work properly only under linear transform. It is undefined what - happens under non-linear transform. - - <p> - If <i>gl_PointSize </i>or <i>gl_ClipVertex </i>are not written to, their - values are undefined. Any of these variables can be read back by the - shader after writing to them, to retrieve what was written. Reading them - before writing them results in undefined behavior. If they are written - more than once, it is the last value written that is consumed by the - subsequent operations. These built-in variables have global scope. - </p> - </body> - </html> - - vec4 - - - - - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/NetBeans-glsl-fontsColors.xml b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/NetBeans-glsl-fontsColors.xml deleted file mode 100644 index 2518c05e8..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/NetBeans-glsl-fontsColors.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/OptionsIcon.gif b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/OptionsIcon.gif deleted file mode 100644 index a9b5990d6..000000000 Binary files a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/OptionsIcon.gif and /dev/null differ diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/VertexShaderIcon.gif b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/VertexShaderIcon.gif deleted file mode 100644 index a20da903c..000000000 Binary files a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/VertexShaderIcon.gif and /dev/null differ diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/VertexShaderTemplate.vert b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/VertexShaderTemplate.vert deleted file mode 100644 index 00964a087..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/VertexShaderTemplate.vert +++ /dev/null @@ -1,7 +0,0 @@ -/* -* vertex shader template -*/ -void main() { - // Vertex transformation - gl_Position = ftransform(); -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/field.gif b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/field.gif deleted file mode 100644 index 50971fb74..000000000 Binary files a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/field.gif and /dev/null differ diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/function.gif b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/function.gif deleted file mode 100644 index dc90fd038..000000000 Binary files a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/function.gif and /dev/null differ diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/preprocessor.png b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/preprocessor.png deleted file mode 100644 index 11c405689..000000000 Binary files a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/resources/preprocessor.png and /dev/null differ diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/vocabulary/GLSLElementDescriptor.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/vocabulary/GLSLElementDescriptor.java deleted file mode 100644 index 48246599a..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/vocabulary/GLSLElementDescriptor.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * GLSLElementDescriptor.java - * - * Created on 03.06.2007, 23:03:57 - * - */ -package net.java.nboglpack.glsleditor.vocabulary; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - -/** - * - * @author Michael Bien - */ -public class GLSLElementDescriptor { - - @XmlType - @XmlEnum(String.class) - public enum Category { - BUILD_IN_FUNC, BUILD_IN_VAR, USER_FUNC, JUMP, ITERATION, SELECTION, QUALIFIER, TYPE, KEYWORD - } - - @XmlElement - public final Category category; - - @XmlElement(required = true) - public final String tooltip; - - @XmlElement(required = true) - public final String doc; - - @XmlElement(required = true) - public final String arguments; - - @XmlElement(required = true) - public final String type; - - /** - * Bean constructor, fields are directly injected. - */ - public GLSLElementDescriptor() { - category = Category.KEYWORD; - tooltip = null; - doc = null; - arguments = null; - type = null; - } - - public GLSLElementDescriptor(Category category, String tooltip, String doc, String arguments, String type) { - this.category = category; - this.tooltip = tooltip; - this.doc = doc; - this.arguments = arguments; - this.type = type; - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/vocabulary/GLSLVocabulary.java b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/vocabulary/GLSLVocabulary.java deleted file mode 100644 index dc0d5b3ba..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/vocabulary/GLSLVocabulary.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * GLSLVocabulary.java - * - * Created on 03.06.2007, 23:03:57 - * - */ -package net.java.nboglpack.glsleditor.vocabulary; - -import java.util.HashMap; -import javax.xml.bind.annotation.XmlRootElement; - -/** - * - * @author Michael Bien - */ -@XmlRootElement -public class GLSLVocabulary { - - public final HashMap mainVocabulary; - public final HashMap fragmentShaderVocabulary; - public final HashMap vertexShaderVocabulary; - public final HashMap geometryShaderVocabulary; - - public GLSLVocabulary() { - mainVocabulary = new HashMap(); - vertexShaderVocabulary = new HashMap(); - fragmentShaderVocabulary = new HashMap(); - geometryShaderVocabulary = new HashMap(); - } -} diff --git a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/vocabulary/jaxb.index b/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/vocabulary/jaxb.index deleted file mode 100644 index 4c8c5e813..000000000 --- a/sdk/jme3-glsl-support/src/net/java/nboglpack/glsleditor/vocabulary/jaxb.index +++ /dev/null @@ -1,2 +0,0 @@ -GLSLElementDescriptor -GLSLVocabulary \ No newline at end of file diff --git a/sdk/jme3-glsl-support/test/unit/src/META-INF/services/org.openide.loaders.DataLoader b/sdk/jme3-glsl-support/test/unit/src/META-INF/services/org.openide.loaders.DataLoader deleted file mode 100644 index f9476ad9a..000000000 --- a/sdk/jme3-glsl-support/test/unit/src/META-INF/services/org.openide.loaders.DataLoader +++ /dev/null @@ -1 +0,0 @@ -net.java.nboglpack.glsleditor.GlslGeometryShaderDataLoader diff --git a/sdk/nbproject/project.properties b/sdk/nbproject/project.properties index 2804b29b4..dbcdb7343 100644 --- a/sdk/nbproject/project.properties +++ b/sdk/nbproject/project.properties @@ -1,4 +1,4 @@ -#Wed, 21 Jan 2015 20:41:54 +0100 +#Fri, 23 Jan 2015 12:23:23 +0100 app.icon=branding/core/core.jar/org/netbeans/core/startup/frame48.gif #same as ${branding.token} app.name=jmonkeyplatform @@ -46,7 +46,6 @@ modules=\ ${project.com.jme3.gde.obfuscate}:\ ${project.com.jme3.gde.blender}:\ ${project.com.jme3.gde.angelfont}:\ - ${project.net.java.nboglpack.glsleditor}:\ ${project.com.jme3.gde.android}:\ ${project.com.jme3.gde.nmgen}:\ ${project.com.jme3.gde.docs} @@ -57,7 +56,6 @@ project.com.jme3.gde.codecheck=jme3-code-check project.com.jme3.gde.customcontrols=jme3-custom-controls project.com.jme3.gde.desktop.executables=jme3-desktop-executables project.com.jme3.gde.docs=jme3-documentation -project.net.java.nboglpack.glsleditor=jme3-glsl-support project.com.jme3.gde.assetpack=jme3-assetpack-support project.com.jme3.gde.cinematics=jme3-cinematics project.com.jme3.gde.codepalette=jme3-codepalette