Character stenciled outline issue when using multi-mesh

If you could provide any information on how you are doing the outline that might help as well. I am assuming you are doing this with a custom depth, so we need to know the interaction between items on the same depth. We also need to know how you are setting the the depth of the mesh.

hi all, I have an issue with my character outline. My characters are using multi-mesh, with the head mesh being the root, and chest/gloves/boots attached to the head mesh. I created an postprocessing outline on my multi-mesh characters. Everything works perfect mesh wise :slight_smile:

now my issue: if I place an obstruction between camera and the outline, and if that obstruction is another character, the obstructed outline doesn’t follow the outline of the obstructing character, but instead it seems to be following only the chest sub mesh, please take a look at the picture, you can see the head and the gloves being ignored, and the outline being traced around the chest sub mesh. everything is done in C++, and as far as I know all meshes are created and treated as equal, besides making to head the root.

Any ideas of why this behavior happens? Thanks!

Hi Shohei, thank you very much for your reply!

to be more specific, when I said “I created an postprocessing outline on my multi-mesh characters” I meant that I followed this tutorial and enable it in C++ on each individual mesh, but the material itself it’s really just a copy paste of the uasset files.

also, when I said “everything is done in C++”, I meant that I prefer C++ over blueprints, unless required or I’m unaware of any other way besides blueprints.

other than the steps described in the above tutorial, I’m not aware of any other setting depth related. My understanding of rendering is basic, in my case I just naïvely assumed that all things being equal, the outcome should be simple and straightforward. I understand your question about setting the depth of the mesh, but if the answer is not In the tutorial, which steps I followed because they were mentioned, not because I actually understand them, then I’m not aware of any other way how to actually accomplish this correctly.

Thanks again for your reply!

So you are using:

GetMesh()->SetRenderCustomDepth(true);
GetMesh()->CustomDepthStencilValue = STENCIL_ENEMY_OUTLINE; // or simply assign an int32 within 1-255 range.

Honestly I am not familiar with multi-meshes. Am I correct in assuming this simply means adding multiple skeletal mesh components and using SetMasterPoseComponent()? If this is the case are you setting the depth and stencil value of every single mesh component?

Hi Shohei, thank you very much for your reply!

Am I correct in assuming this simply means adding multiple skeletal mesh components and using SetMasterPoseComponent()?

Yes.

If this is the case are you setting the depth and stencil value of every single mesh component?

Yes.

all components follow the same pattern, one example below

MeshHEDComponent->SetRenderCustomDepth(true);

MeshHEDComponent->CustomDepthStencilValue = STENCIL_ENEMY_OUTLINE;

Thanks again for your reply!

hi Shohei, thank you very much for your reply!

I would actually not waste anymore of your time, because after your help with mouse over CapsuleComponent on another thread, I enabled stencil on/off based on mouse over, and also because my game is a top-down project, the issue itself is really not that noticeable.

I was just curious for academic reasons. But for transparency purposes after I enable Lit > Buffer Visualizer > Custom Stencil, all I see is a black screen. It may be because I do pretty much everything in C++.

thanks again very much for your help!

Can you take a screenshot of the stencil buffer of the actors in a similar situation? Perhaps we can get some insight as to whether the issue is with the buffer application or with the PP material.

Lit > Buffer Visualizer > Custom Stencil.

I don’t consider it a waste of time at all. I am using that very script myself and my project is top down isomorphic as well, so I was wondering what the issue might be in case I run into it myself.

The buffer visualization being all black is expected until you mouse-over an actor while a PIE session is running.

As a player’s note, I kind of like the issue you have above. If you highlighted the entire unit it would make it extremely difficult to see the obstructing unit (at least from that viewpoint).

The buffer visualization being all black is expected until you mouse-over an actor while a PIE session is running.

interesting, I don’t quite understand what you mean. In my case I can set the buffer visualizer only when I’m outside PIE. If I actually click the play button and go in PIE, everything looks fully lit. Outside PIE, when everything looks black, I don’t actually have any meshes in the level, as I construct them on the fly at runtime.

As for the outline in top-down mode, when the mouse is over character and the stencil kicks in, the outline seems to be being rendered on top of everything else regardless of the character depth relative to the camera.
Say I have two characters, A and B.
if B is in between the camera view and A, then B is partially obstructing A, which is expected. If I hover over A, and the stencil for A kicks in, the outline around A fully renders as a complete outline, completely ignoring B, so the A outline shows in front of B, although the actual A is behind B.

102992-stencil1.jpg

this may well be by design though. My basic understanding of 3D rendering is not nearly enough to make heads or tails out of this :-). I just thought it might be a nice feature in my project to have a character outline based on hostility toward player when the mouse hovers over.

Thanks!

I should stop giving editor advice without actually testing it myself first.

The fact that it renders through the character is completely intentional. Additional work is needed to obstruct the post process line, and this is a very basic outline material. I am taking issue with the fact that your character itself is rendering on top of the obstructing character.

103011-capture.png

At this point I don’t believe I can provide any help. Your images provide two conflicting behaviors. I apologize and wish you the best of luck with a resolution.

Hi Shohei, no worries, I appreciate all your feedback!

I plan to put some colors and some textures in my scene, and we’ll see how it looks in a more colorful setting :slight_smile:

Thanks!