GLSL good thing for integrate into Notepad++

2007-12-20
2012-11-13
  • GLSL (OpenGL Shading Language), also known as GLslang, is a high level shading language based on the C programming language. It was created by the OpenGL ARB to give developers more direct control of the graphics pipeline without having to use assembly language or hardware-specific languages
    (C) http://en.wikipedia.org/wiki/GLSL

    GLSL Specification:
    http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.20.8.pdf

    With respect Alexandr "@!!ex" Basov

    UserDefineLang.xml
    <NotepadPlus>
        <UserLang name="GLSL" ext="glsl vs fs">
            <Settings>
                <Global caseIgnored="no" />
                <TreatAsSymbol comment="no" commentLine="no" />
                <Prefix words1="no" words2="no" words3="no" words4="no" />
            </Settings>
            <KeywordLists>
                <Keywords name="Delimiters">000000</Keywords>
                <Keywords name="Folder+">{</Keywords>
                <Keywords name="Folder-">}</Keywords>
                <Keywords name="Operators">( ) [ ] . ++ -- + - ~ ! * / % &lt;&lt; &gt;&gt; &lt; &gt; &lt;= &gt;= == != &amp; ^ | &amp;&amp; ^^ || ? : = += -= *= /= %= &lt;&lt;= &gt;&gt;= &amp;= ^= |=</Keywords>
                <Keywords name="Operators">! $ % &amp; ( ) * , . / : ; ? [ ] ^ | ~ + &lt; = &gt;</Keywords>
                <Keywords name="Comment">1/* 1 2*/ 2 0//</Keywords>
                <Keywords name="Words1"># #define #undef #if #ifdef #ifndef #else #elif #endif #error #pragma #extension #version #line</Keywords>
                <Keywords name="Words2">attribute const uniform varying centroid break continue do for while if else in out inout float int void bool true false invariant discard return mat2 mat3 mat4 mat2x2 mat2x3 mat2x4 mat3x2 mat3x3 mat3x4 mat4x2 mat4x3 mat4x4 vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow struct 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</Keywords>
                <Keywords name="Words3">gl_Position gl_PointSize gl_ClipVertex gl_FragCoord gl_FrontFacing gl_FragColor gl_FragData gl_MaxDrawBuffers gl_FragDepth gl_Color gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxCombinedTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixInverse gl_ModelViewMatrixTranspose gl_ProjectionMatrixTranspose gl_ModelViewProjectionMatrixTranspose gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRangeParameters gl_DepthRange gl_ClipPlane gl_PointParameters gl_PointParameters gl_MaterialParameters gl_FrontMaterial gl_BackMaterial gl_LightSourceParameters gl_LightSource gl_LightModelParameters gl_LightModel gl_LightModelProducts gl_FrontLightModelProduct gl_BackLightModelProduct gl_LightProducts gl_FrontLightProduct gl_BackLightProduct gl_TextureEnvColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_ObjectPlaneS gl_ObjectPlaneT gl_ObjectPlaneR gl_ObjectPlaneQ gl_FogParameters gl_Fog gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_Color gl_SecondaryColor gl_TexCoord gl_FogFragCoord gl_PointCoord</Keywords>
                <Keywords name="Words4">radians degrees sin cos tan asin acos atan atan pow exp log exp2 log2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect matrixCompMult outerProduct transpose lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4</Keywords>
            </KeywordLists>
            <Styles>
                <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
                <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
                <WordsStyle name="KEYWORD1" styleID="5" fgColor="00FF40" bgColor="FFFFFF" fontName="" fontStyle="2" />
                <WordsStyle name="KEYWORD2" styleID="6" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
                <WordsStyle name="KEYWORD3" styleID="7" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                <WordsStyle name="KEYWORD4" styleID="8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
                <WordsStyle name="COMMENT" styleID="1" fgColor="C0C0C0" bgColor="FFFFFF" fontName="" fontStyle="2" />
                <WordsStyle name="COMMENT LINE" styleID="2" fgColor="C0C0C0" bgColor="FFFFFF" fontName="" fontStyle="6" />
                <WordsStyle name="NUMBER" styleID="4" fgColor="400000" bgColor="FFFFFF" fontName="" fontStyle="1" />
                <WordsStyle name="OPERATOR" styleID="10" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
                <WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            </Styles>
        </UserLang>
    </NotepadPlus>

    glsl.api:
    attribute
    const
    uniform
    varying
    centroid
    break
    continue
    do
    for
    while
    if
    else
    in
    out
    inout
    float
    int
    void
    bool
    true
    false
    invariant
    discard
    return
    mat2
    mat3
    mat4
    mat2x2
    mat2x3
    mat2x4
    mat3x2
    mat3x3
    mat3x4
    mat4x2
    mat4x3
    mat4x4
    vec2
    vec3
    vec4
    ivec2
    ivec3
    ivec4
    bvec2
    bvec3
    bvec4
    sampler1D
    sampler2D
    sampler3D
    samplerCube
    sampler1DShadow
    sampler2DShadow
    struct
    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
    gl_Position
    gl_PointSize
    gl_ClipVertex
    gl_FragCoord
    gl_FrontFacing
    gl_FragColor
    gl_FragData
    gl_MaxDrawBuffers
    gl_FragDepth
    gl_Color
    gl_SecondaryColor
    gl_Normal
    gl_Vertex
    gl_MultiTexCoord0
    gl_MultiTexCoord1
    gl_MultiTexCoord2
    gl_MultiTexCoord3
    gl_MultiTexCoord4
    gl_MultiTexCoord5
    gl_MultiTexCoord6
    gl_MultiTexCoord7
    gl_FogCoord
    gl_MaxLights
    gl_MaxClipPlanes
    gl_MaxTextureUnits
    gl_MaxTextureCoords
    gl_MaxVertexAttribs
    gl_MaxVertexUniformComponents
    gl_MaxVaryingFloats
    gl_MaxVertexTextureImageUnits
    gl_MaxCombinedTextureImageUnits
    gl_MaxTextureImageUnits
    gl_MaxFragmentUniformComponents
    gl_ModelViewMatrix
    gl_ProjectionMatrix
    gl_ModelViewProjectionMatrix
    gl_TextureMatrix
    gl_NormalMatrix
    gl_ModelViewMatrixInverse
    gl_ProjectionMatrixInverse
    gl_ModelViewProjectionMatrixInverse
    gl_TextureMatrixInverse
    gl_ModelViewMatrixTranspose
    gl_ProjectionMatrixTranspose
    gl_ModelViewProjectionMatrixTranspose
    gl_TextureMatrixTranspose
    gl_ModelViewMatrixInverseTranspose
    gl_ProjectionMatrixInverseTranspose
    gl_ModelViewProjectionMatrixInverseTranspose
    gl_TextureMatrixInverseTranspose
    gl_NormalScale
    gl_DepthRangeParameters
    gl_DepthRange
    gl_ClipPlane
    gl_PointParameters
    gl_PointParameters
    gl_MaterialParameters
    gl_FrontMaterial
    gl_BackMaterial
    gl_LightSourceParameters
    gl_LightSource
    gl_LightModelParameters
    gl_LightModel
    gl_LightModelProducts
    gl_FrontLightModelProduct
    gl_BackLightModelProduct
    gl_LightProducts
    gl_FrontLightProduct
    gl_BackLightProduct
    gl_TextureEnvColor
    gl_EyePlaneS
    gl_EyePlaneT
    gl_EyePlaneR
    gl_EyePlaneQ
    gl_ObjectPlaneS
    gl_ObjectPlaneT
    gl_ObjectPlaneR
    gl_ObjectPlaneQ
    gl_FogParameters
    gl_Fog
    gl_FrontColor
    gl_BackColor
    gl_FrontSecondaryColor
    gl_BackSecondaryColor
    gl_TexCoord
    gl_FogFragCoord
    gl_Color
    gl_SecondaryColor
    gl_TexCoord
    gl_FogFragCoord
    gl_PointCoord
    radians
    degrees
    sin
    cos
    tan
    asin
    acos
    atan
    atan
    pow
    exp
    log
    exp2
    log2
    sqrt
    inversesqrt
    abs
    sign
    floor
    ceil
    fract
    mod
    min
    max
    clamp
    mix
    step
    smoothstep
    length
    distance
    dot
    cross
    normalize
    ftransform
    faceforward
    reflect
    matrixCompMult
    outerProduct
    transpose
    lessThan
    lessThanEqual
    greaterThan
    greaterThanEqual
    equal
    notEqual
    any
    all
    not
    texture1D
    texture1DProj
    texture1DLod
    texture1DProjLod
    texture2D
    texture2DProj
    texture2DLod
    texture2DProjLod
    texture3D
    texture3DProj
    texture3DLod
    texture3DProjLod
    textureCube
    textureCubeLod
    shadow1D
    shadow2D
    shadow1DProj
    shadow2DProj
    shadow1DLod
    shadow2DLod
    shadow1DProjLod
    shadow2DProjLod
    dFdx
    dFdy
    fwidth
    noise1
    noise2
    noise3
    noise4

     
    • yair
      yair
      2008-05-11

      following advice below i couldn't get this GLSL xml working, it seems legit but i fail

      Here're the instructions to install them :

         1. Download the user-defined language to your computer
         2. Open the file with your favourite text editor (such as notepad++ or notepad)
         3. Click start, run, type (or paste in) %APPDATA%\Notepad++ then click ok
         4. Open userDefineLang.xml with a text editor
         5. If this is the first userdefined language you are adding, copy/paste the entire first file (which you downloaded) into the userDefineLang.xml, replacing all that was there. If this is the second or more language you add, simply copy everything from the first file starting at <UserLang...> to </UserLang> and paste it at the end of the userDefineLang.xml right before </NotepadPlus>
         6. Save the newly improved userDefineLang.xml

       
    • Sorry. Error there:
      <Keywords name="Operators">( ) [ ] . ++ -- + - ~ ! * / % &lt;&lt; &gt;&gt; &lt; &gt; &lt;= &gt;= == != &amp; ^ | &amp;&amp; ^^ || ? : = += -= *= /= %= &lt;&lt;= &gt;&gt;= &amp;= ^= |=</Keywords>
      <Keywords name="Operators">! $ % &amp; ( ) * , . / : ; ? [ ] ^ | ~ + &lt; = &gt;</Keywords>

      correct:
      <Keywords name="Operators">( ) [ ] . ++ -- + - ~ ! * / % &lt;&lt; &gt;&gt; &lt; &gt; &lt;= &gt;= == != &amp; ^ | &amp;&amp; ^^ || ? : = += -= *= /= %= &lt;&lt;= &gt;&gt;= &amp;= ^= |=</Keywords>