Material for photogrammetry environment? real time casted shadows over unlit material?

Hey ,

I am having a bit of trouble getting this to work I copied and pasted your code after line #952 but am not getting shadows on the emissive texture.

Can you please confirm line #952 reads:
#if !(MATERIAL_SHADINGMODEL_SUBSURFACE_PROFILE && USES_GBUFFER)

Thanks so much!

FIX:

I wrote it wrong… it´s not the line 952, sorry, I´m not sure if the shader file changed in the latest revisions or if I plainly wrote it wrong.

The simplest way to look at it is to understand it, and basically you can put the code right after the Emissive variable declaration, so after this line:



half3 Emissive = GetMaterialEmissive(PixelMaterialInputs);


you can paste the code, or before this line:



Color += Emissive;


BTW this “hack” does not work in all lighting cases, so the light has to be “Stationary” and the object that has to drop shadows has to be “movable”, this does not take into account baked shadows, probably making some more research this can be solved, but right now I don´t knwo how, it could be great if some UE4 guru jump into the conversation and help us all to figure this shader out because it is very important for Photogrammetry work.

Cheers!!!

BTW and even in that situation, there are some glitches that are not solved, but again, if someone with more experience can jump in and help us could be great, so push your expert friends into this!! :smiley:

Cheers!

Is there any way that you could link your shader files somewhere for people who would like to use it?

​​​​​either that, or is there any way that you can give us instructions on how to enable shadows with an unlit shader.

Sadly this is not workin in 4.20!!!

I don´t understand why is not working at all, if someone can help me with this, I need this for a current project and while I´m already bald… I´m loosing al the few hairs that are still in my head…

The only things I did was what I posted here, but it seems that for some reason, this is not working in 4.20 anymore :stuck_out_tongue:

I sort of made a fix for this, maybe it can help someone