In Project setting, tick support UV from hit result, restart now
Create a Material named MTl_DrawingSurface
Open it, add Parameter 2d on emissive color, rename as DrawTexture
Create another Material, name as Mtl_DrawingBrush
Add Vector Parameter node, rename as Color
Attach to Emissive, change to red color
Create Drawing Surface BP:
Create BP class Actor, name as DrawingSurface
Open it, Add component Plane, rotate 90 degree and scale up, change material to Drawingsurface
Go to Construction Script, create as follow (rename last variable as Render Target)
change clear color to white (as a default color before drawing anything on surface)
Connect sequence 1 as follow
for create drawing:
For Overwrite created material, see the changed made on plane:
Overall:
Create Material instance nodes to 3rd sequence output for Drawing Brush:
Increase width and height of render target node to 1024
Create a new function called DrawBrush, create input vairlables Size (how big the brush) and Location (where to draw on render target)
Create nodes as follow (to allocation screen position with the brush):
Split struct pin on the “-” node, as well as Draw material Screen Size, end draw canvas to render target as follow:
Drag the BP plane in the scene
Call the Draw function in VR Pawn:
Open in VR pawn, Get InputAction TriggerRight and Event Tick
Remark: type To vector float for node input from Multiphy