consulo / consulo-unity3d

Frameworks: Unity3D
Apache License 2.0
103 stars 10 forks source link

Unity ShaderLab cg code highlighting and code completion #37

Closed cmann1 closed 9 years ago

cmann1 commented 9 years ago

Currently any code between the CGPROGRAM and ENDCG are marked with a background colour but the text is all black and no auto complete is offered.

Shader "UCLA Game Lab/Wireframe/Single-Sided" 
{
    Properties 
    {
        _Color ("Line Color", Color) = (1,1,1,1)
        _MainTex ("Main Texture", 2D) = "white" {}
        _Thickness ("Thickness", Float) = 1
    }

    SubShader 
    {
        Pass
        {
            Tags { "RenderType"="Transparent" "Queue"="Transparent" }

            Blend SrcAlpha OneMinusSrcAlpha 
            ZWrite Off
            LOD 200

            CGPROGRAM
// The code from here >>>>>>>>>>>>>>>>>>>>>>
                #pragma target 5.0
                #include "UnityCG.cginc"
                #include "UCLA GameLab Wireframe Functions.cginc"
                #pragma vertex vert
                #pragma fragment frag
                #pragma geometry geom

                // Vertex Shader
                UCLAGL_v2g vert(appdata_base v)
                {
                    return UCLAGL_vert(v);
                }

                // Geometry Shader
                [maxvertexcount(3)]
                void geom(triangle UCLAGL_v2g p[3], inout TriangleStream<UCLAGL_g2f> triStream)
                {
                    UCLAGL_geom( p, triStream);
                }

                // Fragment Shader
                float4 frag(UCLAGL_g2f input) : COLOR
                {   
                    return UCLAGL_frag(input);
                }
// <<<<<<<<<<<<< to here is just plain text.
            ENDCG
        }
    } 
}
VISTALL commented 9 years ago

This block is CG injection. Currenly Consulo did not implement CG language. I can only add static highlight

Thanks

cmann1 commented 9 years ago

Thanks. Is this something that will be added in the future?

VISTALL commented 9 years ago

Maybe in september, but i dont have stable access to my work PC. I will back home in october.

VISTALL commented 9 years ago

Hi. I added some highlight/completion for CG injections. But - i cant add more powerfull. (CG language is not implemented)