Ok, I finally managed to have my shader, the inly thing I have been unable to do is to activate and rename a Custom Data channel in the Default Lit shading model to modulate the shadow darkness, but anyways, it works and you can modify the multiplier in the code.
To have shadows over the emmisive it is actually very simple (just Dynamic Shadows), in the file BasePassPixelShader.usf, wich you can find in:
X:\\yourinstallationfolder\Epic Games\4.14\Engine\Shaders
Being X your installation drive and “yourinstallationfolder” your installation folder as you guessed, well, lets continue…
… in that file you just have to put this code after the line #952:
// Bone-Studio Photogrammetry Mod - Multiply Emissive by Shadows, reduce the shadow darkness adding a float value to it.
float2 BoneNDC = MaterialParameters.ScreenPosition.xy / MaterialParameters.ScreenPosition.w;
float2 BoneScreenUV = BoneNDC * ResolvedView.ScreenPositionScaleBias.xy + ResolvedView.ScreenPositionScaleBias.wz;
float4 BoneDynamicShadowFactors = GetPerPixelLightAttenuation(BoneScreenUV);
float BoneShadow = BoneDynamicShadowFactors.x + 0.18f;
Emissive *= BoneShadow;
Of course change the comments and the variable names, I always name my variables that way so I can locate my modifications.
And that’s it, now you can configure a material with Standard Lit as a shading model, put a float with value 0 in “Base Color”, “Metallic”, “Specular” and “Roughness” and put a bitmap in “Emissive Color” and you will get shadows over your photogrammetry… cool!!!
Finally if you want to adjust the darkness of the shadows just modify this line:
float BoneShadow = BoneDynamicShadowFactors.x + 0.18f;
Change the 0.18f value for whatever you want, completely dark, don’t add anything, a bit more of light, add a bit more of value hehe
Thanks to everyone, specially to Kalle-H.
BTW guys if you know how can I enable and use the “Custom Data 0” channel for that value it could be very welcom!
Cheers!
P.S.: Epic could you add an official Photogrammetry shading model or something similar?