Closed DoctorAnsem closed 3 years ago
Those sound like compelling use cases, I'll try find time to work on it.
Vertex alpha being used to smoothly fade out emissive surfaces
Is vertex alpha controlling it necessary or could it just be the vertex color? In that case when fading was needed one would have to fade to black but the vertex alpha would still be available for other uses.
Hmm, that is a good question. The case I was actually using vertex alpha for is just a scrolling, transparent emissive material, a sort of energy beam that fades out into the sky. So there is some flexibility, I guess? Would it break things if a transparent material used the overall brightness value of a vertex color to multiply the final transparency of the vertex, textures included? Or something along those lines, whatever works and is the easiest to implement lol. I don't mind the details, I'd just prefer to have any kind of method to fade that beam out without peppering the world with particles.
Coming in the release that will be posted as soon as it finishes building is support for MultiplyEmissiveByVertexColor. For now multiplying by vertex color was simplest to implement.
As it is in a preview release details about how it works can be changed so let me know if it is unsuitable in someway.
I'm not sure if it's working correctly, it doesn't actually seem affect the emissive texture in any way - it does change the diffuse blending as intended though.
Oh, I see what I've done wrong. Sorry about that, I'll aim to get a new version out with it actually working by tomorrow. Thanks for testing it so quickly as well!
Hmmm, so I grabbed the latest version just now but it unfortunately still didn't quite do the trick - now the switch doesn't actually do anything at all to either the diffuse or the emissive textures. :/ It's just treated as if it's always "false".
I'll investigate further! One quick thing is that the .msh.option file doesn't have -vertexlighting
in it does it? As that would interfere with the setting.
Nope, no vertex lighting on this one. And I don't think the particle meshes are treated as having it either, iirc some of them might be explicitly tagged -additiveemissive
in the option file but I'm guessing that just overrides the material flags. As far as vertex lighting goes I don't think the particle meshes usually have a CAV property at all.
Found the problem I did a typo and made it conditional on the env map being active rather than the emissive map. Expect a new release later today fixing it.
Since the stock materials do factor in vertex colors to glowing polygons, it could be useful for normal_ext to replicate this behaviour. There are a couple of scenarios where it would be applicable.
Just a little improvement to consider, I guess.