Skip to content

SmailikHappy/GraphicsConcepting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

General

This project introduces wet spots from rain VFX

result-to-show.mp4

Project

The idea was to create a realistic surface response to the VFX. This involved generating a screen-space mask that highlights wet areas, which is then sampled in materials using screen UV coordinates of the pixel currently being rendered.

Pipeline explanation

The source code includes a module (/Source/SceneViewExtModule) responsible for executing the core algorithm. This algorithm leverages Unreal Engine's Scene View Extension feature to listen for the PreRenderView_renderThread() function. Within this function, a custom pass (referred to as Rain mask pass in code and debug tools) renders a wetness screen mask before the base pass, ensuring the mask is available within the same frame. In the project, the mask is sampled in material graphs using screen UV coordinates.

Setup for your project

  1. Copy the module folder /Source/SceneViewExtModule and paste it into your project's source folder.
  2. Add the following code line to both /Source/<project name>.Target.cs and /Source/<project name>Editor.Target.cs:
ExtraModuleNames.Add("SceneViewExtModule");
  1. In the <project name>.uproject file, add this to the module list
{
   "Name": "SceneViewExtModule",
   "Type": "Runtime",
   "LoadingPhase": "PostConfigInit"
}  
  1. Build the project

You should now be able to use the RainDropOperator class directly within blueprints.

Usage

  1. Create an instance of RainDropOperator, call the CreateRainDropExtension() function and assign the output render target.
    This output render target will be referenced in materials as a mask.
  2. Export relevant data from a VFX and send it to a blueprint.
    In our case, this is only the position of a raindrop
  3. Receive the data and store it in the RainDropOperator object's arrays.
  4. Reference the mask within materials to apply effects.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published