Replies: 2 comments 1 reply
-
I haven't watched the whole video, but this is possible. The algorithm explained in the video seems to be doable directly from a vertex or fragment shader (preferably fragment for better precision), as you have access to the mesh normal through |
Beta Was this translation helpful? Give feedback.
-
Sure, you can use drivers in Malt as well. The only gotcha is that you must use them from the Material properties, they don't work in nodes due to a Blender limitation. That said, you can retrieve the camera direction from shaders. If you want the camera direction at the center of the view you can retrieve it from an Inline Code node with this code: transform_normal(inverse(CAMERA), vec3(0,0,-1)) I haven't watched the full video, but I think the algorithm boils down to this: vec3 camera_facing_normals(sampler1D distribution)
{
vec3 ortho_view_normal = transform_normal(inverse(CAMERA), vec3(0,0,1));
float weight = dot(NORMAL, ortho_view_normal);
weight = texture(distribution, max(weight, 0)).r;
return normalize(mix(NORMAL, ortho_view_normal, weight));
} I'm using a color ramp instead of curves because that's what Malt supports atm. Remember to disable self shadows, otherwise you won't see too much difference. |
Beta Was this translation helpful? Give feedback.
-
manipulating normals using shader
There is this tutorial about manipulating normals but it's on Eevee and uses drivers for it to work. I've been wondering if this is possible in Malt but my brain just shutdowns doing technical things in Malt.
Beta Was this translation helpful? Give feedback.
All reactions