Testing out a planet shader and I thought I'd be cool if the side of the planet that is not lit by the star would have some lights.
And light vector no longer works with emissive, and neither does CustomLightingDiffuse. And CustomLighting only affects the faces that are facing the light.
Is there an easy way to get emissive output on the faces that are not hit by a light?
Replies
http://davenewson.com/tutorials/udk/planet-earth-material-shader-for-udk
[ame="http://www.youtube.com/watch?v=xS8vDVCHF9c"]Earth / Planet Material Shader - UDK Tutorials by Javahawk - YouTube[/ame]
I don't really understand why they took away the ability to use light vector with emissive... Like having more options would hurt someone.
if that dosnt work perhaps just implemeant it vai a custom lighting shader
Try this instead: Lerp(DiffuseDay, DiffuseNight, Lambert).
Note: Remember to take into consideration the gamma correction for your Lambert, or else your DiffuseNight will show up slightly earlier in day time. So you might want to Div by itself or Power it to a lower value like 0.5, etc.
Try putting this in both of your Custom and play around to see what happens.
IF this doesn't work, then disable shadows, set the Shadow Bias between -1 and 1 (forgot which number you need to use).
Note that if you do disable the shadows to get the effect you're looking for, any kind of normal map in night time that has recessive will 'take' the light information from the other direction, so stuff like mountain tops would be an example of this 'leaking'. I suggest in that case, to have Lerp also your Lambert term, one with a flat normal and the other with a full normal.
It kinda works now, just had to darken the customlightingdiffuse a lot now when there are no shadows.
Is there a way to disable self-shadowing while still making the object shadow other objects?
I've fought with that in the past.
what you may be able to do is use a second object as a shadow caster. like a slightly smaller sphere inside that one with some basic diffuse material. Or one set to cast a shadow but not render.. I think that is possible.
However, as Vail put it, it's a mess, I can't recall top of my head on what enabled, etc to get it, I will have to dig some old files.
I tried implementing the 'proxy mesh' for casting shadow solution not too long, and it ONLY works with default material so far once you subtract all the shadows. Problem is, I don't remember effectively being able to limit the casting from one mesh to another in a simple way. Might be interesting if anyone did such things and has any results.