Combine Normal Maps in Godot

Sdílet
Vložit
  • čas přidán 6. 09. 2024

Komentáře • 15

  • @njdarda
    @njdarda Před 9 měsíci +1

    came here from your "How to blend Environment? (GODOT)" video when you mentioned this problem. thanks for explaining it!

  • @MK-lk7nc
    @MK-lk7nc Před 10 měsíci

    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.

  • @tomislavstasina8451
    @tomislavstasina8451 Před 6 měsíci +1

    You are a lifesaver. Subscribed.

  • @thygrrr
    @thygrrr Před 11 měsíci +1

    Excellent video, thank you so much

    • @mohsenzare2511
      @mohsenzare2511  Před 11 měsíci +1

      Glad it was helpful!

    • @thygrrr
      @thygrrr Před 11 měsíci

      @@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)

  • @Skiggles
    @Skiggles Před 25 dny

    This is awesome but how do you blend the strength of multiple normal map and assign to NORMAL_MAP_DEPTH?

  • @solitary200
    @solitary200 Před rokem +1

    Very cool. Wish the Engine had a normal detail built into the Standard Material

    • @AgnisNeZvers
      @AgnisNeZvers Před rokem

      True, but you can easily convert it to shader code and pretty easily add it yourself.

    • @mohsenzare2511
      @mohsenzare2511  Před rokem +1

      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

    • @npip99
      @npip99 Před 9 měsíci

      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.

  • @DarksiderDarmoset
    @DarksiderDarmoset Před 8 měsíci

    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;
    }

    • @mohsenzare2511
      @mohsenzare2511  Před 8 měsíci

      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;