Skip to content

Instantly share code, notes, and snippets.

View ValerioMarty's full-sized avatar

Valerio Marty ValerioMarty

View GitHub Profile
@ValerioMarty
ValerioMarty / CustomDepth.shader
Last active July 6, 2021 14:33
custom depth in linear space for the colored volumetric light tutorial
Shader "Hidden/CustomDepth"
{
Properties
{
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
@ValerioMarty
ValerioMarty / VolumetricLightFeature.cs
Last active July 10, 2021 17:08
Colored volumetric Light feature for the colored volumetric tutorial
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class VolumetricLightFeature : ScriptableRendererFeature
{
public enum DownSample { off = 1, half = 2, third = 3, quarter = 4 };
[System.Serializable]
@ValerioMarty
ValerioMarty / ColoredVolumetricLightTuto.shader
Last active April 29, 2025 15:19
shader for the colored volumetric light tutorial
Shader "Hidden/VolumetricLight"
{
Properties
{
//we need to have _MainTex written exactly like this because unity will pass the source render texture into _MainTex automatically
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
@ValerioMarty
ValerioMarty / CustomDepthFeatureTuto.cs
Last active July 20, 2021 14:46
CustomDepthFeature for the colored volumetric light tutorial
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
//using https://alexanderameye.github.io/notes/edge-detection-outlines/ as a base for this script, including comments
public class CustomDepthFeature : ScriptableRendererFeature
{
public Material material;
public RenderPassEvent renderPassEvent;
@ValerioMarty
ValerioMarty / VolumetricLightTuto4.shader
Last active July 3, 2021 12:01
depth aware upsampling and compositing of the volumetric lighting tutorial
Pass
{
Name "Compositing"
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
@ValerioMarty
ValerioMarty / VolumetricLightTutoDepth.shader
Last active July 3, 2021 12:01
downsampled depth pass for the volumetric light tutorial
Pass
{
Name "SampleDepth"
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
@ValerioMarty
ValerioMarty / VolumetricLightTuto2and3.shader
Last active July 3, 2021 12:02
Bilateral Blur for Volumetric Light tutorial
Pass
{
Name "Gaussian Blur x"
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
@ValerioMarty
ValerioMarty / VolumetricLightTuto1a.shader
Last active July 6, 2021 13:12
Raymarching pass of the Volumetric Lighting tutorial before randomizing rays
Shader "Hidden/VolumetricLight"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
// No culling or depth
@ValerioMarty
ValerioMarty / VolumetricLightTuto1b.shader
Last active August 15, 2022 09:41
Raymarching pass of the Volumetric Lighting tutorial
Shader "Hidden/VolumetricLight"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
// No culling or depth
@ValerioMarty
ValerioMarty / VolumetricLightingTutoComplete.shader
Last active July 6, 2021 13:13
ScriptableRendererFeature Volumetric Lighting Tutorial
Shader "Hidden/VolumetricLight"
{
Properties
{
//we need to have _MainTex written exactly like this because unity will pass the source render texture into _MainTex automatically
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{