A guide to exposing lighting data to the material graph in UEs Forward Renderer, allowing for creation of arbitrary shading models without the need for further Engine modification nor GBuffer restrictions.
https://dev.epicgames.com/community/learning/tutorials/ow0x/unreal-engine-custom-shading-models-directly-in-your-material-graphs
Hi @AbidNaga, thatâs a pretty interesting tutorial . Regarding the last part (Volumetric Lightmap and Reflection Capture sampling in the material) : you should ask this guy , he knows an answer .
Hi. While following the tutorial, I came across this line in BasePassPixelShader.usf Light Smuggler Base Pass Function Implementation:
include âLightSmuggler/LightSmugglerPixelShader.ushâ
However, the file LightSmugglerPixelShader.ush doesnât seem to be included anywhere in the tutorial files. Am I overlooking something, or is this an error in the tutorial?
Iâm asking because even after modifying the engine as shown in the tutorial, switching the shading model to LightSmuggler
doesnât give me access to FSmuggledLight
or LightSmugglePack
in the custom node.
Has anyone else run into this issue or found a workaround?
Any clarification would be greatly appreciated!
Thanks in advance!
Oh shoot thanks for pointing that out, itâs just an error on my part. What it actually should be is:
#include "LightSmuggler/LightSmugglerCalcMaterial.ush"
The file created in section 3.3.2. Just a mistake on my end sorry about that. Lemme know if everythings working well after that change
Iâm getting some errors when trying to create a custom node in this shading model.
Any ideas on what could be causing this? I tried including the files in the custom node as well as in the include file paths within the details panel of the custom node.
Iâm using Unreal 5.5, so Iâm not sure if MegaLights or something else could have changed the setup slightly.
\Engine\Shaders\Private\MaterialTemplate.ush(3579,1): Shader TBasePassPSFNoLightMapPolicy, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:3579:1: error: unknown type name âFSmuggledLightâ
FSmuggledLight DirLight = LightSmugglePack.DirectionalLight;
Depending on where you placed the LightSmugglerCommon.ush file, be sure to add it as an include in your custom node. I had it placed in â/Engine/Private/LightSmuggler/LightSmugglerCommon.ushâ, so in my case I added that path to the include file paths of the HLSL node
Lemme know if that fixes it!