I have a nice baked normal shader; the problem with it is of course it’s only really good for static lighting. Anyone know of a way to fake dynamic lighting (or really, faking the pixel specular contribution) that would give similar results to NM without the expensive calculation? Looking for something like the faked specular in UDK iOS games…even a link that shows how they do it would be nice, so I can recreate it in Strumpy Shader Editor.
Just an FYI:
Using Strumpy Shader Editor outputs a Surface Shader, which always calculates light (Directional + Spherical Harmonic + Ambient) in its first generated pass, even if there is no light in the scene.
You can’t stop these calculations from happening in a Surface Shader because the purpose of a SS is to provide a simple framework for describing how a surface reacts to light. What you would need to do is take a step below the Surface Shader and write a programmable pipeline shader (Vertex to Fragment).
With that said, I’m clueless as to how the guys at Epic have written their graphics engine, but…
If you’re looking for specular without accepting light, perhaps you could use a specular map texture and determine the influence by taking the normalized dot product of the surface normal and the view direction.
Psuedo Code: (In your frag function)
_spec = dot(_vertexNormal,_viewDirection) * 0.5 + 0.5;
I am a little confused as to exactly what effect you are trying to achieve. If you could provide more detail, or perhaps a screen cap I could be more precise.
Cheers
==
In Infinity Blade, there is a kind of faked specular hilighting that changes based on your view angle to the surface; you can see it in the characters here as well as in the arch behind the enemy character. This is what I am trying to do; I have already got the normal baking into the surface with a normal map converted to greyscale then multiplied over albedo; I then bake the environment lighting into the surface with Beast; this allows Beast to take the normal/bump into consideration during the lightmap generation and looks pretty good (see technique here.) The problem with this technique is of course you lose the dynamic movement of the specular component on the surface, which I believe they are faking in UDK and Infinity Blade; that is what I am trying to achieve. It seems like they are taking normals into account for the specular hilight to get a near normal mapped appearance, but its possible they are just using really well made specular map assets and a trick to fake it. I know from experience that if they were using true normal mapping with lights, the framerate (especially in the high res mode) would be atrocious. I will try your method tonight and see if I can get anywhere with it; ultimately my goal is to squeeze the best visuals I can without any real lighting in my games at all.