Pugrad is a color gradient generator for Unity that supports commonly-used perceptually uniform colormaps.
At the moment, Pugrad supports the following colormaps:
#ifndef RAYMARCHSDFINCLUDE_INCLUDED | |
#define RAYMARCHSDFINCLUDE_INCLUDED | |
#define STEPS 256 | |
#define MAX_DISTANCE 500 | |
#define MIN_DISTANCE 0.001 | |
#if !SHADERGRAPH_PREVIEW | |
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" | |
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" |
using System.Collections; | |
using UnityEngine; | |
using UnityEngine.InputSystem; | |
public abstract class ContinuousInputHandler<InputType> : MonoBehaviour | |
where InputType : struct | |
{ | |
private InputType m_ReadValue; |
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
[ExecuteInEditMode] | |
public class GlobalShaderParams : MonoBehaviour | |
{ |
#pragma use_dxc //enable SM 6.0 features, in Unity this is only supported on version 2020.2.0a8 or later with D3D12 enabled | |
#pragma kernel CountTotalsInBlock | |
#pragma kernel BlockCountPostfixSum | |
#pragma kernel CalculateOffsetsForEachKey | |
#pragma kernel FinalSort | |
uint _FirstBitToSort; | |
int _NumElements; | |
int _NumBlocks; | |
bool _ShouldSortPayload; |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
[InitializeOnLoad] | |
public class RenderingPipelineDefines | |
{ | |
enum PipelineType |
// Quick try at doing a "print value" node for Unity ShaderGraph. | |
// Tested on Unity 2019.2.17 with ShaderGraph 6.9.2. | |
// | |
// Use with CustomFunction node, with two inputs: | |
// - Vector1 Value, the value to display, | |
// - Vector2 UV, the UVs of area to display at. | |
// And one output: | |
// - Vector4 Color, the color. | |
// Function name is DoDebug. |
Shader "Custom/CurveDissolve" | |
{ | |
Properties | |
{ | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_Noise("Noise", 2D) = "white" {} | |
_CurveTexture("Curve texture", 2D) = "white" {} | |
_Cutoff("Cutoff", Range(0,1)) = 0 | |
_Glossiness ("Smoothness", Range(0,1)) = 0.5 |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.Experimental.Rendering; | |
public class ShaderTextureCombiner : EditorWindow { | |
//Input textures |
In shader programming, you often run into a problem where you want to iterate an array in memory over all pixels in a compute shader | |
group (tile). Tiled deferred lighting is the most common case. 8x8 tile loops over a light list culled for that tile. | |
Simplified HLSL code looks like this: | |
Buffer<float4> lightDatas; | |
Texture2D<uint2> lightStartCounts; | |
RWTexture2D<float4> output; | |
[numthreads(8, 8, 1)] |