-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
That tutorial is quite old. Now the intended workflow is to code your own custom nodes if you want to use GLSL. You can drop functions at So the first examples would become something like this: #include "Common.glsl"
void starting_point()
{
}
void flat_color(vec3 color, out vec3 result)
{
result = color;
}
void textures(int uv_channel, sampler2D color_texture, out vec4 result)
{
vec2 texture_coordinates = UV[uv_channel];
vec4 sampled_color = texture(color_texture, texture_coordinates);
result = sampled_color;
} The other two would be much more complex now, since there's not an API aimed at artists anymore. #include "NPR_Lighting.glsl"
void lighting(vec3 color, out vec3 result)
{
result = vec3(0);
for (int i = 0; i < LIGHTS.lights_count; i++)
{
Light L = LIGHTS.lights[i];
LitSurface LS = npr_lit_surface(POSITION, NORMAL, 0, L, i, true, true);
result += max(LS.NoL, 0.0);
}
result *= color;
} Which requires way more context to understand. |
Beta Was this translation helpful? Give feedback.
That tutorial is quite old.
It's from the time when Malt didn't have nodes and I still thought I could convince artists to use code-based shaders.😅
Sorry for the confusion.
Now the intended workflow is to code your own custom nodes if you want to use GLSL.
See https://malt3d.com/documentation/plugins/
You can drop functions at
PluginExample.glsl
and they will be available automatically as a node.So the first examples would become something like this: