![image](https://private-user-images.githubusercontent.com/6388730/262071370-a94c2169-190a-4bd3-9f02-5c2f9037eaa1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0MjI1NzksIm5iZiI6MTcxOTQyMjI3OSwicGF0aCI6Ii82Mzg4NzMwLzI2MjA3MTM3MC1hOTRjMjE2OS0xOTBhLTRiZDMtOWYwMi01YzJmOTAzN2VhYTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjZUMTcxNzU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODQ4MTU1Y2ViMzgxNTM1ZDk4ZTQwZTkyY2Q1Njk0YzEzMDk4NjFjZDFlZjNlM2M5MjliMTkzNGEyZGM0ZTA5MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.3SYUc1nuaLu1i_4P9XDRlE0NStbsSdjNQqgGr6Hw728)
Generate flowmap dynamically from your scene.
Note: It is not recommended to use this in real-time, as it is quite expensive.
Clone this repository into your project's Assets
folder.
TODO: Add UPM installation instructions
-
Create a new Flowmap_Plane in your scene. (Right click in the hierarchy -> OpenFlowmap)
-
We need an OpenFlowmap configuration. Create a new one in your project (Right click in the project window -> Create -> OpenFlowmap -> OpenFlowmapConfig) and assign it to the OpenFlowmap object. You can set the layer mask, number of rays, ray processors to use, etc.
-
Now you need some processors to affect the flowmap. So far I have implemented these processors:
- OuterFlow: This processor will push the flowmap in the direction of the normal of the mesh.
- GlobalFlowDirection: This processor will push the flowmap in a global direction.
- BlurEffect: This processor will blur the flowmap. useful for smoothing out the flowmap when you have a low number of rays.
- FlowmapRenderer: This processor will render the flowmap to a texture.
-
Add the processors you want to use to the OpenFlowmap object. Please note that the processors will be executed in the order they are in the list. so if you want to blur the flowmap, you need to add the blur processor after something like outer flow. or putting the flowmap renderer at the end of the list.
-
Or use available ones in Sample->Data->Processors directory (drag them into the processors field of the configuration file)
-
You can Render the flowmap to a texture by adding a FlowmapRenderer processor to the OpenFlowmap configuration. it will create a texture at the same directory as your scene file. (feel free to change it)
There are few sample shaders and materials in Sample -> Shaders directory. you can use them to visualize the flowmap. just drag and drop desired material to the flowmap plane.