const char* vs = R"(
uniform float4x4 proj_model;
uniform float4x4 model;
uniform float3 camera_forward;
Varyings main(const Attributes a) {
Varyings v;
float4 clip = proj_model * float4(a.position, 1.0);
v.position = (ndc).xy;
v.lighting = clamp(dot(a.normal, camera_forward), 0.0, 1.0);
v.v_color = a.color;
return v;
}
)";
const char* fs = R"(
float2 main(const Varyings v, out half4 color) {
color = half4(v.v_color.rgb * v.lighting, v.v_color.a);
return v.position;
}
)";
auto result = SkMeshSpecification::Make(
SkSpan(attributes),
sizeof(Vertex),
SkSpan(varyings),
SkString(vs),
SkString(fs)
);
Yet when I use the keyword discard in the fragment shader, the SKSL compiler complains that I can only use it when compiling a fragment shader? A bit of clarity if I am attempting do to something illegal with the SkMesh would be helpful