So, I’m sort of getting somewhere. But also sort of not. Because I’m modding something vs writing from scratch, I’m somewhat limited in what I have access to.
However, here’s where I am. In the editor, I’ve dropped in an alien, and made a green material and applied it. I’ve set it to SDPG Foreground - you can see it rendering through the wall.
Here it is:
I’ve also created a postprocess material which does this (the image is skewed because the image preview does nasty things):
This is the material I’m using, in case you’re curious: http://i.imgur.com/C2HgL3b.png
In Xcom, I’m injecting a Process Process effect using the material created above, and changing all the pawn materials to use the green tint.
foreach B.AllActors(class'XComAlienPawn', Pawn) {
Pawn.Mesh.SetDepthPriorityGroup(SDPG_Foreground);
`Log("DPG:" @ Pawn.Mesh.DepthPriorityGroup);
for(i = 0; i < Pawn.Mesh.GetNumElements(); i++) {
`Log("Mat" @ Pawn.Mesh.GetMaterial(i));
// Pray this works
Pawn.Mesh.SetMaterial(i, Material(`CONTENT.LoadObjectFromContentPackage("PostProcessGreyScaleScan.Test.Green")));
}
}
It’s definitely setting things to the foreground, because the log shows this:
Here’s what it looks like in-game:
But! When I turn on the PostProcess Effect, I get this:
The troops are see-through. Also, they don’t render through terrain/walls/etc as they do in the editor. What could I be doing wrong?