This is an addon for Godot 4.4+ that adds the Lambert node to the visual shader system. This node outputs the Diffuse Light based on the Lambertian Reflectance Model.


Mathematical Formula:

diffuse = (ρ/π) * cos(theta_i)

Where:

  • ρ is the albedo of surface.


Godot Shader Language:

const float INV_PI = 0.31830988618379067154; // 1.0 / PI.

float diffuse_lambert(
    in vec3 n,
    in vec3 l
)
{
    float NdotL = dot(n, l); // cos(theta_l) == cos(theta_i).
    
    if(NdotL < 0.0)
    {
        return 0.0;
    }
    
    return INV_PI * NdotL;
}


ko-fi | InterDreamSoft


Lambert Diffuse Reflectance Model (Node).


Links & Support


[ Support Email: interdreamsoft@gmail.com ]

Updated 1 day ago
StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorInterDreamSoft
Made withGodot
Tags3D, Godot, Shaders
ContentNo generative AI was used

Download

Download NowName your own price

Click download now to get access to the following files:

diffuse_lambert_v1.0.5.zip 99 kB

Leave a comment

Log in with itch.io to leave a comment.