Question about Shader Editor

Hi everyone, I’m happy with the new initiatives that are coming out. I hope you will soon find a solution to easily maintain and evolve the SDK.

I did some other tests. The tool to create new Shader Nodes does not work.

Nothing happens when you click on the Next button.

No problem, I created an empty file and named it PBRLighting.j3sn.
Next step. I wrote a prototype template:

ShaderNodeDefinitions{
    ShaderNodeDefinition PBRLighting {      
        Type: Fragment
        Shader GLSL100: MatDefs/PBRLighting.frag
        Documentation{
            PBR Lighting Template
            @input position
            @input albedo
            @input normal
            @input emission
            @input metallic
            @input smoothness
            @input occlusion
            @input alpha
            @input alphaClipThreshold
            @output outColor
        }
        Input {
            vec3 position vec3(1.0)
            vec3 albedo vec3(1.0)
            vec3 normal vec3(1.0)
            vec3 emission vec3(0.0)
            float metallic 0
            float smoothness 0.5
            float occlusion 1
            float alpha 1
            float alphaClipThreshold 0
        }
        Output {
            vec4 outColor
        }
    }
}

Now we need to write the PBRLighting.frag file. I need your help writing the fragment shader function please. (This file colorMutl.frag can be useful as reference).

void main(){
    outColor = ....;
}

Good news: the newly created Shader Nodes are visible in the editor. There is no need to recompile the SDK. With your help, we can probably find a solution ready to use with the editor we already have.

6 Likes