This is for models that use vertex colors. I want all faces with the max brightness of the object. So in daytime lighting it should look unshaded, but in a dark environment it should darken (like the thumbnail).

What I’ve tried:

  • using vertex_lighting* and then setting the normal directly (eg NORMAL = vec3(0.0, 1.0, 0.0);)
    • this works, but only if the lighting is perfectly overhead… a slightly wrong angle or even too far into the middle of an omnilight will create a shadow
  • attempting to save the original color value, change the normal, and then bring it the old brightness back via max() if the new value is dimmer
    • lots of moving parts/assumptions on my part here
  • other math stuff with NORMAL/VERTEX, abs() and normalize() etc
    • on top of the direction failure, there’s also failure to keep consistent brightness (with a spinning animation), and darkening across a TextMesh

I also know I could do this with unshaded and just multiply/mix it in the shader, but I don’t really like the idea of making a custom lighting/detection system (rather than using actual lights, that is).

I am not totally against diffuse shading, something like a vertex toon shader (2-3 brightness bands) could be interesting aesthetically. If that’s even possible, it seems like the vertex light calculation is hardcoded (though it’s also possible I just don’t understand it).

* this is a relatively re-added feature (4.4)

  • @insomniac_lemon@lemmy.cafeOP
    link
    fedilink
    English
    1
    edit-2
    9 days ago

    A lot of different game styles could work with a single directional light, with different possible techniques (ceiling/background) for top-down and 1st/3rd-person.

    Though I think I found the best way:

    NORMAL = (vec3(NORMAL.x, 1.0, NORMAL.z));

    EDIT: Actually, diffuse_lambert_wrap is what I’m looking for. Although for more distinct shadows, the normal editing does look better than the other shading modes.

    old edit

    This helps make shadows look better (by reducing them) though is not quite perfect. The shadows_disabled render mode removes the ugly self-shadows (not other cast/diffuse shadows) but also means that objects won’t be dark from just pure darkness. Specifically my issue here is with directional light shadows, and even then it’s because it seems internal mesh can cast a shadow (the shadows are also uglier than floor shadows for some reason).

    Volumetric fog seems to tie it all together, working even on unshaded and seems to pair well with a lot of settings to give different aesthetic options. Really fun just iterating on settings (lights, environment, materials, shader) in my test scene with a simple gridmap. But my editor keeps crashing.

    I’m feeling a workflow here, and really liking the effort:results ratio. I have a fever dream of a scene and more ideas too.