##A Modest Proposal##
As per version 1.0.13 of the Shader Editor Extension, it will look for #define SHADERNAME name
in both the vertex shader code and the fragment shader code.
If name
is defined for both shaders, and it's the same string, the name of the program is that string, e.g.: "Shadertoy".
If only one of the two is defined, the name of the program is "vs_name
/ fs_name
", e.g.: "Quad / Shadertoy"
If there's no #define
on any of the sources, the program name is the program number, e.g.: "Program 3"
At first I thought using a #pragma, but I was getting warnings:
The SHADERNAME string is pretty random, just thinking of something that wouldn't collide with other #defines. It can be changed, but I think the important part is that we all agree.
Does it make sense? Would this be something it'd be interesting for developers to identify shaders, programs, materials, etc. regardless of frameworks or libraries?
I think so :), nice and simple.
A preference for SHADER_NAME (ensure less conflicts than NAME?).