I’ve noticed that I wanted to have specular reflections in my scenes, but found the “realistic” rendering of Unreal Engine 4 insufficient. Therefore I made a trick to emulate specular highlights. It is a trick, because the coordinate of the light source Is hardcoded in the shader. This means also that you can only emulate 1 light source. My example also does not take into account fall-off, so regardless of the distance of the lightsource, the phong is always at the same brightness and size. Distance dependent specular light can however easily be added by a multiply operation. You can do some cool tricks once you can control specular light as you can see in the screenshots below:
The base material code is calculated here:
Now you can easily modulate your specular color (red), add bloom (modulate > 1.0), render with a diffuse color and normal map.
And much desired, translucency + specular, so you can make realistic water (unfortunately by reducing the opacity, also specular is reduced).
You can also make realistic glass. Note that translucent material does not cast a shadow.
To avoid the reduction of translucency with opacity, you can just set the blend mode to additive and only render the specular light as a second render-pass (So first you render translucent water without opacity and, then you render a second mesh, just slightly above your water surface, with the specular highlights). (Still something needs to be made for reflections).
When using “Default lit” lighting mode, you can make use of normal maps, for nice, particle like effects. When using unlit mode, you can make force-field-like effects.