hey this was a very helpful video for me thanks for posting it. I'm trying to hack in some extra normal map stages into terrain3d and they look much better now. Very rarely do I actually bookmark a video for future reference but yours has attained that coveted spot.
@@mohsenzare2511 I read one of the original articles where I think you took some of your formulas from (Unity, UDN, Whiteout), and now am porting stuff from Unity to Godot, so it helps to see godot language and their slightly different handling of normals. Saved me so much time! (generally, I prefer GDShader Language to ShaderLab and also to Visual Shaders)
Yeah that is a good Idea to this be there, It is also good Idea to add a node for combining normal map in visual shader, But Personally I prefer to use code, I want to have control over everything
That's not a good idea for Standard Material. Standard Material is just plain PBR. But yeah a Visual Shader Node to combine normal maps would be a good idea.
Hello! This is super helpful, but I'm trying to add more than two normal maps together for a terrain shader. Is this the appropriate way to use the Unity method? vec3 unity_blending(vec3 r, vec3 g, vec3 b, vec3 a){ r = r * 2.0-1.0; g = g * 2.0-1.0; b = b * 2.0-1.0; a = a * 2.0-1.0; mat3 basis = mat3( vec3(r.z,r.y,-r.x), vec3(r.x,r.z,-r.y), r);
vec3 final = basis * g * b * a; final = normalize(final); return final * 0.5 + 0.5; }
If you want to use unity_blending method I think you should calculate the basis each time you create a new normal vector: I mean you should do it one step at a time! What you wrote basis * g * b * a = g_new * b * a, Which g_new is the new normal and at last you multiply three vector which I don't think it is ok! Use the function provided in the video and do each blend at one time like this: vector n = unity_blending(r,g);; n = unity_blending(n,b); n = unity_blending(n,a); But this is expensive, and I suggest to do the simple blending, For something like a terrain, as terrain itself is something natural and should not be accurate, and no one will notice if you also use simple blending! The unity blending is used for things more accurate;
came here from your "How to blend Environment? (GODOT)" video when you mentioned this problem. thanks for explaining it!
Happy to help
hey this was a very helpful video for me thanks for posting it. I'm trying to hack in some extra normal map stages into terrain3d and they look much better now. Very rarely do I actually bookmark a video for future reference but yours has attained that coveted spot.
You are a lifesaver. Subscribed.
Thanks for the sub!
Excellent video, thank you so much
Glad it was helpful!
@@mohsenzare2511 I read one of the original articles where I think you took some of your formulas from (Unity, UDN, Whiteout), and now am porting stuff from Unity to Godot, so it helps to see godot language and their slightly different handling of normals. Saved me so much time! (generally, I prefer GDShader Language to ShaderLab and also to Visual Shaders)
This is awesome but how do you blend the strength of multiple normal map and assign to NORMAL_MAP_DEPTH?
Very cool. Wish the Engine had a normal detail built into the Standard Material
True, but you can easily convert it to shader code and pretty easily add it yourself.
Yeah that is a good Idea to this be there, It is also good Idea to add a node for combining normal map in visual shader, But Personally I prefer to use code, I want to have control over everything
That's not a good idea for Standard Material. Standard Material is just plain PBR. But yeah a Visual Shader Node to combine normal maps would be a good idea.
Hello! This is super helpful, but I'm trying to add more than two normal maps together for a terrain shader. Is this the appropriate way to use the Unity method?
vec3 unity_blending(vec3 r, vec3 g, vec3 b, vec3 a){
r = r * 2.0-1.0;
g = g * 2.0-1.0;
b = b * 2.0-1.0;
a = a * 2.0-1.0;
mat3 basis = mat3( vec3(r.z,r.y,-r.x), vec3(r.x,r.z,-r.y), r);
vec3 final = basis * g * b * a;
final = normalize(final);
return final * 0.5 + 0.5;
}
If you want to use unity_blending method I think you should calculate the basis each time you create a new normal vector: I mean you should do it one step at a time! What you wrote basis * g * b * a = g_new * b * a, Which g_new is the new normal and at last you multiply three vector which I don't think it is ok!
Use the function provided in the video and do each blend at one time like this:
vector n = unity_blending(r,g);;
n = unity_blending(n,b);
n = unity_blending(n,a);
But this is expensive, and I suggest to do the simple blending, For something like a terrain, as terrain itself is something natural and should not be accurate, and no one will notice if you also use simple blending!
The unity blending is used for things more accurate;