OIT_Lab | : pencil2 : Order-independent Transparent in Unity | Serialization library
kandi X-RAY | OIT_Lab Summary
kandi X-RAY | OIT_Lab Summary
This project implements several OIT (Order-independent Transparent) methods in Unity.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of OIT_Lab
OIT_Lab Key Features
OIT_Lab Examples and Code Snippets
Community Discussions
Trending Discussions on OIT_Lab
QUESTION
I have a shader managing script from a github project, and I'm trying to understand what it does line-by-line. At one point it takes the camera and does this:
...ANSWER
Answered 2018-Nov-30 at 22:47The camera's culling mask tells it which layers to render.
The first mask, ~(1 << LayerMask.NameToLayer("Transparent"))
, renders everything except the transparent layer.
The second mask, 1 << LayerMask.NameToLayer("Transparent")
, renders only the transparent layer.
It's pretty common to render opaque geometry in one pass, then render transparent geometry in a second pass. This makes sure that you render any opaque objects that are behind transparent objects.
If none of that makes sense, you may want to read up on bit masks.
Bit masking tends to make heavy use of:
- left shift (
<<
) to pick a bit - bitwise OR (
|
) to enable certain bits of a mask - bitwise AND (
&
) to disable certain bits of a mask - bitwise NOT (
~
) to negate a mask
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install OIT_Lab
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page