Handprint highlight material and component

BP_HandprintComponent, MPC_Handprint and MF_Handprint are the main elements of the hand location highlighting sytem.

BP_HandprintComponent

BP_HandprintComponent is a scene component that should be added as a child to each hand of the player pawn. It has an editable bool parameter called IsLeft, which should be true for the left hand and false for the right.

All this component does is take it’s world location and store it in MPC_Handprint.

MPC_Handprint

MPC_Handprint is a material parameter collection containing seven scalar and four vector parameters. These values can be set by BP_HandprintComponent or any other script, and are used by MF_Handprint.

MF_Handprint

MF_Handprint is a material function that takes a base colour as input, and outputs a base colour with hand highlights, as well as an emissive channel.

It works by taking the world co-ordinates from the hand, via MPC_Handprint, and projects them into screen-space, using the distance between the shaded pixel and the hand to calculate the size of the highlight.

a section of MF_Handprint

The colours, overall alpha and mask lerping alpha are all also taken from MPC_Handprint.

MF_Handprint should be included in any other base material that should display hand highlights, like in the following example:

nickbell555 Avatar

Posted by

Leave a comment