All Projects → DMeville → Volumetric-Occlusion-Mask-SRP

DMeville / Volumetric-Occlusion-Mask-SRP

Licence: MIT license
Using SRP to create a volumetric occlusion mask for objects to use in their render pass

Programming Languages

ShaderLab
938 projects
C#
18002 projects

Projects that are alternatives of or similar to Volumetric-Occlusion-Mask-SRP

aws-sdk-net-extensions-cognito
An extension library to assist in the Amazon Cognito User Pools authentication process
Stars: ✭ 80 (+370.59%)
Mutual labels:  srp
srptools
Tools to implement Secure Remote Password (SRP) authentication
Stars: ✭ 22 (+29.41%)
Mutual labels:  srp
SRP
Secure Remote Password (SRP) for Swift
Stars: ✭ 44 (+158.82%)
Mutual labels:  srp
pundit kit
Extension for pundit which allows to describe namespaces of policies in routes-like style
Stars: ✭ 12 (-29.41%)
Mutual labels:  srp
URP-Sun-Shafts
A URP port of Unity's classic Standard Assets Effects package's Sun Shaft effect
Stars: ✭ 36 (+111.76%)
Mutual labels:  srp
cognito-srp
Go library for AWS Cognito SRP
Stars: ✭ 40 (+135.29%)
Mutual labels:  srp
RamblerAppDelegateProxy
divide et impera
Stars: ✭ 83 (+388.24%)
Mutual labels:  srp
Attrs
Python Classes Without Boilerplate
Stars: ✭ 3,786 (+22170.59%)
Mutual labels:  srp
mbedtls-esp8266
Updated and Upgraded mbedTLS library for the ESP8266 (probably ESP32 too)
Stars: ✭ 13 (-23.53%)
Mutual labels:  srp
scst
No description or website provided.
Stars: ✭ 61 (+258.82%)
Mutual labels:  srp
AppWindowUtility
This utility is for Unity to configure application window style. With this utility, you can make your application window transparent, frameless and more.
Stars: ✭ 26 (+52.94%)
Mutual labels:  srp

WANT TO BLOCK STUFF FROM GETTING WET?! I GOTCHU FAM

screenshot screenshot screenshot

Edit 7/23/2018 - The system works okay as is, but I'm not really satisfied. Will be looking into make a system based around mesh distance fields to achieve this effect.

Using Unity 2018.2.0b7 Package Manager: Lightweight Render Pipeline 1.1.10-preview and Post-processing 2.0.7-preview

Most of the code is in LightweightPipeline.Render, be sure to replace the version of LightweightPipeline.cs that comes from the package manager with the included one in the project.

Occluder objects need a convex closed mesh renderer and an Occluder behaviour.

Access the global shader texture _CustomOcclusionMask to use the generated mask in an object's shader (to mask it's colour or whatever) or use the incldued CustomOcclusionMask.Asset Amplify Shader Function with ASE.

There is also an included ShowOcclusionDepth post process that shows the mask

Is probably slow and unoptimized, has some issues I'm still working out, but is a good starting point if someone is looking for a system like this.


https://www.youtube.com/watch?v=wDp5uLv2HrU

Been learning about the new scriptable render pipeline in unity 2018, stumbling along because I have no idea what I'm doing.

I wanted to make a system that would allow me to mask out shader effects based on other geometry and work properly with masking by depth. For example, in a snowy forest, I would like to control snow coverage with a global shader variable to affect all meshes, however some meshes (like inside a house) shouldn't get snow on them. I could manually paint masks for individual geometry but that sounds dumb.

Instead I create a cube (or any other concave closed mesh) and mark it with a special two pass shader. This shader renders the backface and frontface depth of the cube to calculate the cubes volume, and uses that to compare with the depth texture. If the pixel we're trying has a depth that falls between the frontface and backface depths, we know that pixel is within the blocking volume and should be masked out.

Volumes are baked into a OcclusionMask texture which I can sample in any shader to access the mask.

I will use this to easily make it so shader wet-ness effects (like animated water dripping on rocks) or snow on the ground doesn't appear in places they shouldnt (like inside houses, caves, etc). What's cool is that it obeys depth properly, so if we're looking "through" a occlusion mesh, only the pixels within the volume are masked, pixels "behind" the mask but off in the distance are not affected (as they would be if it was a simple screen space effect!)

More info of me trying to work through this problem on reddit: https://www.reddit.com/r/Unity3D/comments/8f2stm/how_would_you_go_about_making_a_shader_that_color/?st=jidwwnr0&sh=c9ff5f64


Do whatever you want with this code. Have questions?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].