Shaders from ShaderForge (Unity) to Playcanvas


is it possible to use the shadercode generated by [Shaderforge][1] in PlayCanvas? [1]: Shader Forge
Surely it would need some adjustments to the code but it shouldn´t be too much, right?


Does shaderforge output GLSL code?

I´m not an expert on Shaders at all so here´s an example code coming out from Shaderforge:

Shader "Carsten/PureColor+Alpha" {
    Properties {
        _ColorA ("Color(A)", Color) = (0.5,0.5,0.5,1)
        [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
    SubShader {
        Tags {
        Pass {
            Name "ForwardBase"
            Tags {
            Blend SrcAlpha OneMinusSrcAlpha
            ZWrite Off
            #pragma vertex vert
            #pragma fragment frag
            #define UNITY_PASS_FORWARDBASE
            #include "UnityCG.cginc"
            #pragma multi_compile_fwdbase
            #pragma exclude_renderers xbox360 ps3 flash d3d11_9x 
            #pragma target 3.0
            uniform float4 _ColorA;
            struct VertexInput {
                float4 vertex : POSITION;
            struct VertexOutput {
                float4 pos : SV_POSITION;
            VertexOutput vert (VertexInput v) {
                VertexOutput o;
                o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
                return o;
            fixed4 frag(VertexOutput i) : COLOR {
////// Lighting:
////// Emissive:
                float3 emissive = _ColorA.rgb;
                float3 finalColor = emissive;
/// Final Color:
                return fixed4(finalColor,_ColorA.a);
    FallBack "Diffuse"
    CustomEditor "ShaderForgeMaterialInspector"

And here´s a screenshot from the settings panel:

That looks like Unity’s proprietary shader language. If you can generate the GLSL, you can upload them as shader assets and use them in a material. But i’m not sure how you do that from Unity.

Ok, thanks very much :smirk: