Posts

Showing posts from March, 2020

UE4: Make Emissive Material Light Flash

Image
Reference the B branch of the final multiply into the emissive color: here we are multiplying the time by a flash speed scalar parameter and passing it into the Sine function. The output of this is multiplied into the emissive color to adjust the strength. You can increase/decrease the flash speed parameter to adjust how quickly the light flashes.

UE4: Adding Emissive Light to a Part of a Texture

Image
1) Create a copy of the original texture and highlight only the parts that should shine in either red, blue, or green 2) Multiply that texture sample with a vector parameter representing the light color (using the appropriate red, blue, or green channel from the texture to isolate the area to light up) 3) Multiply this by a scalar parameter called emissive strength so that you can pump up this value to make the shine brighter 4) Wire this into the emissive color channel

UE4: Making Materials Shiny

Image
1) Edit your material 2) Add a scalar param node with a default value of 1 wired into the Metallic channel 3) Add a scalar param node with a default value of .5 wired into Specular channel 4) Multiply a scalar param node with a default value of .5 (combined with the texture's alpha channel) into the roughness channel  Lower roughness to increase shine. You can also reduce roughness (or the Metallic value) to reduce the shine. Specular is almost always good at the .5 value.

Unity: Detect VR Mode

Image
Create a new "VRGameController" script as follows: using System . Collections ; using System . Collections . Generic ; using UnityEngine ; using UnityEngine . XR ; public class VRGameController : MonoBehaviour {     [ SerializeField ] GameObject [] disableComponenetsOnVR ;     // Start is called before the first frame update     void Start ()     {         if ( IsXrDevicePresent ()) {             for ( int i = 0 ; i < disableComponenetsOnVR . Length ; i ++) {                 GameObject go = ( GameObject ) disableComponenetsOnVR [ i ];                 go . SetActive ( false );             }         }     }     bool IsXrDevicePresent ()     {         List < XRDisplaySubsystem > xrDisplaySubsystem...

UE4: Load New UI From Button

Image
Use the following blueprint on an event handler to load another UI (Widget Blueprint):

SE: Looping Ambient Clips

Image
1) Download Audacity . 2) Select the portion of the clip you want to loop and press the trim button 3) Cut a piece off the front and paste it into a new track 4) Align the second clip to end just barley after the first 4) Highlight overlap portion of both tracks, and select "Crossfade Tracks" under effects (using "Constant Power 1") 5) Zoom in heavy (where you can see a single line of the sound), fade in the start of the first clip, and fade out the end of the second . This should only be a tiny bit of fade just to keep the clip from popping on the loop border. 6) Shift+space to play in a loop and test 7) Export!

UE4: UI Text Button Hover Color Change

Image
Create transparent button with child Text widget. Expose Text widget as variable and add the following blueprint using the On Hovered and On Unhovered events.