Before I go on with my request, I wish to say that the UDK is awesome, and I thank Epic for every feature and opportunity. I have no intention to sound like I am at all dissatisfied with the UDK or Epic. Now: onto my post.
I've run into a bit of a problem, well actually I ran into it way back in UT3 a few times before this instance: Dynamic self-shadows and Custom Lighting materials. The problem that I have is that the Custom Lighting setup in the material editor doesn't really account for dynamic shadows: In fact anything plugged into the custom lighting input gets cut to zero inside a mesh's dynamic self-shadow. This makes things like partial translucency or diffusion nearly impossible to do well.

This is my recent one-size-fits-all skin shader applied to a skeletal mesh in a one-light environment. Around the edges of the shadow, you can make out brief hints of my custom Sub-Scattering light model. The sub-scattering is part of the custom lighting I've hooked together and is controlled by the light vector, among other things. As you can see in the above image, everything goes 0.0 inside the dynamic shadow, canceling out any pretty scattering effects beyond the edge of the shadow. There is a workaround for this: and that is by entirely disabling dynamic self shadows in the mesh's light environment. This gives me a result like this:

The obvious problem here is that the surface is being lit in areas that should be in shadow. This shows off some cool subsurface stuff, but the end result is not appealing to the eye at all. The problem I can see is that custom lighting in the material editor is not a fully developed tool. It was meant for sort of quickly "sketching" code that would later be written into HLSL by a team of paid professionals. However for many Indie developers, the Material Editor is the only way to go for creating sweet custom lighting models.

The photoshop composite we have here shows off the best of both worlds: the surface lighting is being rendered with shadows, the subscattering is being rendered without. An expert eye will be able to point out the physical inaccuracies (hell, even I can), but for real-time rendering this looks much better than the two previous images. This shows a lighting/material method that has yet to be coded into the engine (or I simply haven't found the checkbox yet). It could be implemented into the engine by changing around mesh rendering a bit and adding a material node that looks at the dynamic self-shadow of a mesh as a per-pixel value. The node can be used like any other single-channel value. Just as a material will only use a texture as the user defines it: the custom lighting will only shadow the code layers that the user defines.
chances are there is
A) a much better way to implement this. -or-
B) a detrimental reason this can never be accomplished by human minds.
Either way this post is kind of a way to raise awareness of the issue, and maybe give epic an idea of a cool feature the community might want.
thoughts?
Comment