Creating a New Global Shader in a Plugin - Blueprint Setup

Setting up a Blueprint to test the Shader in Plugin code.

On this page

With the Plugin now verified to be working, in the following section you will be shown how to call the global shader using Blueprints.

  1. To see how this works, right-click in the Content Browser and create a new Blueprint Class that has Actor as its parent class with the name, DrawUVDisToRenderTarget.


  2. Next, create a new Render Target called RT_00 and a new Material called MAT_RT.


  3. Open up MAT_RT Material and then add the RT_00 Render Target to the Material Graph, connecting its output to the Base Color input on the Main Material Node, pressing the Apply and Save button when done.

    Click for full image.

  4. Next, open up the DrawUVDisToRenderTarget Blueprint and create/add the following variables and nodes to the Event Graph.


    Default Value








    Default Value





    Event Tick


    Draw UVDisplacement to Render Target

    Input 1 into FOV, Aspect Ratio, and Overscan Factor

    Make FooCameraModel


    Clear Render Target 2D



  5. To easily demonstrate how the Draw UVDisplacement to Render Target will warp the supplied render target, you will need to setup your up Blueprint so that the values input into the K1 and K2 inputs on the Draw UVDisplacement to Render Target node can be increase or decrease by the press of a button. To accomplish this, setup the nodes in the Event Graph so that they match the following image:

    Copy Node Graph

    You can copy and paste this Blueprint code directly into your Blueprint.

    Do not forget to input your Render Target into the Output Render Target or you will not see anything happen.

  6. With the required Blueprint logic now setup, make sure to Compile and Save your Blueprint and then drag your Blueprint from the Content Browser into a level. When completed, select the Blueprint and under Input change the Auto Receive Input from Disabled to Player 0.

    Click for full image.

  7. Next, select the floor and duplicate it by pressing CTRL + W and then rotate it -90 degrees in the X axis then drag the Material MAT_RT onto it so you can see the effect the of the Draw UVDisplacement to Render Target.

    Click for full image.

  8. With everything now setup, press the Play button and then press the W and S keys to warp the Render Target that was input into the Draw UVDisplacement to Render Target node like in the following video.

End Result

At this point you can now distort the content inside a render target from Blueprint to create all kinds of interesting shapes. Next, try and create a new Plugin or edit the existing one and see what kind of interesting images and effects you can create.

Select Skin

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback