After watching this youtube video, I felt inspired to recreate what was shown: https://www.youtube.com/watch?v=cs9xUmu3aMA
To my surprise, there is a way to use the SpatialMaterial to create an overlaying outline using the "Grow" Option depicted in the 3.0 Docs: http://docs.godotengine.org/en/latest/learning/features/3d/spatial_material.html
Then I used the Conversion option to convert the SpatialMaterial to The Shader Language, which then I can customize the shading language.
The bottom line: Does anybody know how to displace vertices in the shader code to achieve the deformed effect shown from the youtube video?
P.S. Here is the code if anybody wants to take a look, Its basically a converted ShaderMaterial code that has been barely altered:
shader_type spatial;
render_mode
blend_mix, depth_draw_opaque,cull_front,diffuse_lambert,specular_schlick_ggx,unshaded;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float specular;
uniform float metallic;
uniform float grow;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform sampler2D texture_metallic : hint_white;
uniform vec4 metallic_texture_channel;
uniform sampler2D texture_roughness : hint_white;
uniform vec4 roughness_texture_channel;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
void vertex() {
UV=UV*uv1_scale.xy+uv1_offset.xy;
VERTEX+=NORMAL*grow;
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
ALBEDO = albedo.rgb * albedo_tex.rgb;
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
METALLIC = metallic_tex * metallic;
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
ROUGHNESS = roughness_tex * roughness;
SPECULAR = specular;
}
I suspect void vertex() function is where deforming the outline is possible...