Skip to content

edunad/FailCake.VISOcclusion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FailCake.VISOcclusion

Important

Originally built for a game made by a friend Delivery & Beyond, not really intended for public use. But after thinking about it, figured I'd share it anyway. Some stuff is still hardcoded for the game, but eventually I want to turn this into a proper plugin.

Important

Single camera only! Should be your main player camera and be marked with the MainCamera tag!

Installation

Package Manager > Add Git URL:

https://github.com/edunad/FailCake.VISOcclusion.git?path=/com.failcake.vis.occlusion

Features

  • Compute shaders for fast visibility checks. No Jobs! All calculations done on the GPU side.
  • Works with 2D and 3D portals (3D just does frustum culling, 2D does the full visibility check)

Sample

TODO: Add sample scene

Tutorial

  1. Add the VISOcclusion render feature to your scriptable renderer

{83B22150-529F-4244-9DC8-93E4C707866C}

  1. Make a GameObject with VISController script. This handles all the room show/hide logic.

{C6063E7C-D2F0-4629-A1D8-8A0B16264684}
{39DF731D-0E3F-4B92-BDEE-B77976D083B0}

  1. Create another GameObject with entity_vis_room, entity_vis_test and a BoxCollider (set to trigger). The entity_vis_test is just an example script showing how to handle room visibility.

{2BE76E7A-60FD-49F3-8391-99A6DE34D046}

  1. Add a GameObject with entity_vis_portal_2d. Put it where your doorway is and link it to the room on the right side.

{84A72654-8B28-485F-9ACF-5F105DCE25B8}

  1. DONE

Debugging

If stuff isn't working, turn on DEBUG mode in VISController to see the portal occlusion visualization.

About

VIS occlusion system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages