Trying to replicate T3ssel8r grass shader

The best way to get consistent colors and lighting is to have basically the same toon_shader logic for the floor and grass. So just make sure that all the calculations and code inside both shaders are identical. Also the render_modes should match up too. I don’t think its a problem with the light nodes as that shouldn’t have to matter.

My project looks quite different so my shader logic will not be of much help im afraid :joy_cat:

For toon shading I always recommend this tutorial:
https://saturnmind.hashnode.dev/shaders-cel-shading

Also if nothing works try using this code for the billboarding instead of the one you use now. I see a lot of people using that one but I know also a lot of people have problems with. I’ve been using this one since the start, and I made it with basic vector logic and its been working perfectly:

shader_type spatial;
render_mode diffuse_toon;

void vertex() {
    vec3 cam_z = normalize(CAMERA_DIRECTION_WORLD);
    vec3 cam_y = vec3(0.0, 1.0, 0.0);
    vec3 cam_x = normalize(cross(cam_y, cam_z));
    mat3 spherical_billboard = mat3(cam_x, cam_y, cam_z);

    vec3 billboarded_vertex = spherical_billboard * VERTEX;

    vec3 instance_origin = (MODEL_MATRIX * vec4(0.0, 0.0, 0.0, 1.0)).xyz;
    vec3 world_position = instance_origin + billboarded_vertex;
    POSITION = PROJECTION_MATRIX * VIEW_MATRIX * vec4(world_position, 1.0);

    NORMAL = (MODEL_MATRIX * vec4(0.0, 1.0, 0.0, 0.0)).xyz;
}
1 Like