Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Making character render on top of another

Hi i spent a lot of time looking for an answer for this.

i am making a 2.5D fighting game and i want the character who landed the last hit to be rendered on the top of the other.

i noticed that it's been done on UE4 games like Street Fighter V and Dragon Ball FighterZ.

I tried changing the material to translucent but it flipped the character inside out. and for now i am just stuck with custom depth and post processing that's rendering solid colors and outlines in overlapped points.

Product Version: UE 4.20
more ▼

asked Jan 13 '19 at 02:58 AM in Rendering

avatar image

Comic Shake
3 1 2 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The weird look when using a translucent material is because the polygons are in a pretty much random order and thus rendered all over each other. (The classic problem with hair strips.) Depending on the art style and camera movement you might be help this by sorting the polygons in DCC, ordering them toward the camera. This is a somewhat dicey solution, especially that you'd need two versions of each character depending on which way they are facing (ie which side of them is closer to the camera.)

The next, cleaner but more performance intensive approach would be rendering only the character who landed the hit into a render target with a camera matching the game camera. Since you already figured out custom depth masking you can just replace that solid color with samples from the render target.
You probably have some wiggle room when choosing RT resolution, you might be able get away with even a 0.5x multiplier to save performance.

The most performant and robust solution would be modifying the render pipeline to support "always on top" objects but that involves a deep dive into the guts of the engine with a C++ snorkel and a lot of courage.

EDIT: The CameraOffset node in the material editor moves vertices toward the camera center so they get closer without looking different. It still has artifacts, bits disappearing sometimes. It would be perhaps the best solution if it works well enough on your assets.

more ▼

answered Jan 13 '19 at 06:05 AM

avatar image

1.6k 79 93 142

avatar image Comic Shake Jan 13 '19 at 06:40 AM

Thanks very much.

Yes i just managed to get it right by using the render target and attaching a scene capture into the main camera.

avatar image MaffyKing May 14 '19 at 11:33 AM

Hi, I'm a student who has the exact same problem as you.

Could you explain what exactly you did to accomplish it? As of right now I do not understand your solution.

Kind regards, Maffy

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question