Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: What editor to use for writing MetaSL shaders?

  1. #1

    Default What editor to use for writing MetaSL shaders?

    So far I was using Notepad++ but it's lack of proper support for the
    MetaSL language is a letdown. Handling several shaders in a single
    file is a pain in the ass as the fold/unfold functionality doesn't work
    very well. I'd really like to have a "table of contents" kind of listing
    of shader definitions in the currently open file among other things,
    so I'm looking for a better application.

    What software do you use for writing MSL shaders?

  2. #2
    Join Date
    Nov 2008
    Posts
    232

    Default

    you can configure easily enough np++ by adding metasl keywords, np++ config files are xml files.

  3. #3

    Default

    Hmm.. thanks I'll give it a try.

  4. #4

    Default

    I attached the first iteration of the MetaSL language definition
    file for Notepad++. It works ok for simpler stuff but I'm not
    sure if all keywords are properly colored. Let me know if you
    want something changed.
    Attached Files Attached Files

  5. #5
    Join Date
    Aug 2008
    Location
    Ravenna, Ohio, United States
    Posts
    125

    Default

    The MetaSL_spec documentation does have a set of reserved words that should be helpful-

    abstract after annotation attachment auto before
    bool2 bool3 bool4 bool break bsdf
    case catch char class const cast const
    continue decltype default delete do dynamic cast
    else enum event explicit export extern
    false finally final foreach for friend
    global graph if import inline inout
    int2 int3 int4 interface int in
    long mutable namespace native new operator
    out phaser phenomenon private protected public
    reinterpret cast return scenedata sealed shader short
    signed sizeof state static cast static struct
    super switch technique template texture1D texture2D
    texture3D textureCUBE this throw true try
    typedef typeid typename uniform union unsigned
    using varying virtual void while
    half half2 half3 half4 half2x2 half2x3 half3x2 half3x3
    half3x4 half4x3 half4x4 half4x2 half2x4
    float float2 float3 float4 float2x2 float2x3 float3x2 float3x3
    float3x4 float4x3 float4x4 float4x2 float2x4
    double double2 double3 double4 double2x2 double2x3 double3x2 double3x3
    double3x4 double4x3 double4x4 double4x2 double2x4

    One good app I use for anything code related is PSPad.You can set up various syntax highlighters and make default templates. and set up User Converters, which acts as an advanced search/replace, which I use a lot to convert between similar shaders, such as converting a. color add shader into a float3 add shader.The syntaxes are stored in ini files and are fairly easy to change.

    I do have a metaSL syntax and an mi scene syntax, both of which could still use more work, but they do help. I'm also have a decent max script syntax, which does okay. I'll include these, let me know if I should add anything to these.
    Attached Files Attached Files
    Last edited by Ian_; April 20th, 2011 at 11:55.

  6. #6

    Default

    Yeah I copied them from there. I'm just not sure if I grouped
    them properly because I don't know what many of them do.
    "Virtual" and "void" should be in one color group? Stuff like that.

    PSPad looks cool, I'll take a closer look.

  7. #7
    Join Date
    Aug 2008
    Location
    Ravenna, Ohio, United States
    Posts
    125

    Default

    Well I made a revision of the the MSL keywords, and grouped them into a few categories, which should be pretty accurate. I don't know what every term means exactly, but for the most part, I know which ones are MSL-specific and which ones are from c, and which ones are data types. Here's the list-

    MetaSL Keywords--
    after
    annotation
    attachment
    before
    bsdf
    decltype
    dynamic
    final
    foreach
    global
    graph
    import
    in
    inout
    input
    native
    out
    output
    phaser
    phenomenon
    reinterpret
    scenedata
    shader
    state
    super
    technique
    then
    uniform
    varying

    C++ Keywords--
    abstract
    auto
    break
    case
    cast
    catch
    class
    const
    continue
    default
    delete
    do
    else
    event
    explicit
    export
    extern
    false
    finally
    for
    friend
    if
    inline
    interface
    internal
    mutable
    namespace
    new
    object
    operator
    private
    protected
    public
    return
    sealed
    sizeof
    static
    static_cast
    switch
    this
    throw
    true
    try
    typedef
    typeid
    typename
    using
    virtual
    void
    while

    Function Keywords--
    abs
    acos
    all
    any
    asin
    atan
    atan2
    ceil
    clamp
    cos
    cross
    ddx
    ddy
    degrees
    distance
    dot
    exp
    exp2
    faceforward
    floor
    fmod
    frac
    isfinite
    isnan
    length
    lerp
    log
    log10
    log2
    max
    min
    modf
    normalize
    pow
    radians
    reflect
    refract
    round
    rsqrt
    saturate
    sign
    sin
    sincos
    smoothstep
    sqrt
    step
    tan
    tex3D
    texCUBE
    transpose

    Data Type Keywords--
    bool
    bool2
    bool3
    bool4
    char
    Color
    double
    double2
    double2x2
    double2x3
    double2x4
    double3
    double3x2
    double3x3
    double3x4
    double4
    double4x2
    double4x3
    double4x4
    enum
    float
    float2
    float2x2
    float2x3
    float2x4
    float3
    float3x2
    float3x3
    float3x4
    float4
    float4x2
    float4x3
    float4x4
    half
    half2
    half2x2
    half2x3
    half2x4
    half3
    half3x2
    half3x3
    half3x4
    half4
    half4x2
    half4x3
    half4x4
    int
    int2
    int3
    int4
    long
    short
    signed
    Spectrum
    String
    struct
    template
    texture1D
    texture2D
    texture3D
    textureCUBE
    union
    unsigned
    void

    Preprocessor--
    #define
    #undef
    #if
    #ifdef
    #ifndef
    #else
    #elif
    #endif
    #include
    #import
    #native
    #version

    I'll include the updated ini file and a screen grab of it in pspad, hope this helps.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by Ian_; April 21st, 2011 at 07:09.

  8. #8

    Default

    Great job! I fixed quite a few things in the NP++ highlighter (attached).

    I noticed a few things with the list above:

    "Foreach" and "then" are present in both the c++ and metasl sections.
    "Event", "finally" and "new" are there twice.
    Attached Files Attached Files

  9. #9
    Join Date
    Aug 2008
    Location
    Ravenna, Ohio, United States
    Posts
    125

    Default

    Yeah, sorry about that, I noticed that returning to this thread, darn those human errors! XD I'll update my last attachment. I used pspad to alphabetize the keywords, so its easy to spot duplicates.

    Also, the function keywords are both functions from metasl and c++, so if you want less sections, you could put them in the corresponding sections, here is a list of functions from c++. If anyone uses another app for metasl with syntax highlighting, please feel free to post the syntax file for that app here.
    Last edited by Ian_; April 21st, 2011 at 07:36.

  10. #10
    Join Date
    Aug 2008
    Location
    Ravenna, Ohio, United States
    Posts
    125

    Default

    BTW, I forgot to mention, pspad does have something called a Code Explorer, which I believe is similar to what you wanted with a "table of contents". The code explorer looks for specific text patterns to detect functions, include files and macro definitions based on the currently selected syntax. It mainly works best with HTML, XML or C so it isn't implemented very well with metasl. For most shaders, it will only recognize preprocessors, like #define and #include and c-like functions. Unfortunately I don't think there is a way to change this yet.
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •