This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class AABBIntersection : MonoBehaviour | |
{ | |
/// <summary> | |
/// The main component that checks for a collision with the second object | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/Transparency " | |
{ | |
Properties | |
{ | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_Color ("Color", Color) = (1,1,1) | |
} | |
SubShader | |
{ | |
CGPROGRAM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float Pow5(float x) { return x*x*x*x*x; } | |
float Pow6(float x) { return x*x*x*x*x*x; } | |
//Ref: https://diglib.eg.org/bitstream/handle/10.2312/mam20191305/007-011.pdf Eq(2;4) | |
float3 fresnel_lazanyi_2019(float cos_theta, float3 f0, float3 f82) | |
{ | |
float3 a = 17.6513846 * (f0 - f82) + 8.16666667 * (1.0 - f0); | |
float m = Pow5(1.0 - cos_theta); | |
return clamp((f0 + (1.0 - f0) * m - a * cos_theta * (m - m * cos_theta)), 0, 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
[ExecuteAlways] | |
public class CustomAmbientLights : MonoBehaviour | |
{ | |
[ColorUsage(false, true)] | |
public Color ambientLight; |