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 UnityEngine; | |
using UnityEngine.Rendering; | |
using UnityEngine.Rendering.Universal; | |
public class DepthNormalsFeature : ScriptableRendererFeature | |
{ | |
class DepthNormalsPass : ScriptableRenderPass | |
{ | |
int kDepthBufferBits = 32; | |
private RenderTargetHandle depthAttachmentHandle { get; set; } |
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 System.Linq; | |
using UnityEditor; | |
using UnityEngine; | |
using Object = UnityEngine.Object; | |
public class MaterialGradientDrawer : MaterialPropertyDrawer { | |
private int resolution; |
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
/* | |
Render Unlit Opaque objects into CameraNormalsTexture for SSAO Depth Normals mode. | |
If you need Alpha clipping or vertex displacement, you'll need to use Depth mode, | |
or edit the generated shader code to add in the DepthNormals pass instead. | |
This is meant as an alternative if you don't need those. | |
For depthNormalsMat, I'm using a blank PBR/Lit SG with passIndex set to 4 (corresponds to it's DepthNormals pass). | |
*/ | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Rendering; |
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 "URP/CustomLighting" | |
{ | |
Properties | |
{ | |
_BaseColor ("Base Color", Color) = (1, 1, 1, 1) | |
} | |
SubShader | |
{ | |
Tags { "RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" "UniversalMaterialType" = "SimpleLit" "IgnoreProjector" = "True" "ShaderModel" = "4.5" } |