Skip to content

Instantly share code, notes, and snippets.

@AlexMerzlikin
AlexMerzlikin / UniversalRenderPipelineTemplateWithDotsInstancing.shader
Last active May 8, 2024 00:41
Template unlit URP shader that supports DOTS instancing to use as a guide to create shaders for BatchRendererGroup since BRG only works with DOTS instancing compatible shaders. Unfortunately, the official docs about it haven't helped me that much, and I thought others might face the same issues.
Shader "Universal Render Pipeline/Custom/UnlitWithDotsInstancing"
{
Properties
{
_BaseMap ("Base Texture", 2D) = "white" {}
_BaseColor ("Base Colour", Color) = (1, 1, 1, 1)
}
SubShader
{
Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always
@totallyRonja
totallyRonja / MaterialGradientDrawer.cs
Last active September 26, 2023 09:46
A Material Property Drawer for the [Gradient] attribute which lets you edit gradients and adds them to the shader as textures. More information here: https://twitter.com/totallyRonja/status/1368704187580682240
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
public class MaterialGradientDrawer : MaterialPropertyDrawer {
private int resolution;
@demid5111
demid5111 / 1_install_opencv_win.md
Last active April 29, 2024 04:04
Instructions for installing opencv on Windows 10

Install OpenCV 4.5 on Windows 10

Pre-configured OpenCV for Python from PyPi

  1. open the terminal (Ctrl+R + cmd)
  2. check Python3 installation: py --version
  3. go to official website to learn details: https://pypi.org/project/opencv-python/
  4. choose the most complete package and run: py -m pip install opencv-contrib-python
  5. check installation by entering the Python REPL: py
  6. import tha library: import cv2
Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always
@hmans
hmans / BobTheBuilder.cs
Last active April 27, 2024 23:26
A basic pipeline for performing headless Unity builds for multiple platforms at once.
/* This needs to live in a folder named "Editor", or it won't work. Doesn't have to be named
"BobTheBuilder", though. Name it whatever you want! */
using System;
using UnityEditor;
using UnityEngine;
public class BobTheBuilder
{
/* List of scenes to include in the build */
@MagistrAVSH
MagistrAVSH / URP-VertexLit.shader
Last active March 28, 2024 22:06
UniversalRenderingPipeline VertexLit Shader
Shader "Universal Render Pipeline/Custom/VertexLit"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Gain ("Gain", Float) = 1.5
_Color ("Color", Color) = (1,1,1,1)
_EdgeColor ("Edge Color", Color) = (0,0,0,1)
[Toggle] _RemoveDiag("Remove diagonals", Float) = 0.
@phi-lira
phi-lira / UnlitTextureShadows.shader
Created April 30, 2020 08:28
Unlit Texture + Realtime Shadows shader
Shader "Universal Render Pipeline/Custom/UnlitTextureShadows"
{
Properties
{
[MainColor] _BaseColor("BaseColor", Color) = (1,1,1,1)
[MainTexture] _BaseMap("BaseMap", 2D) = "white" {}
}
SubShader
{
@Pyredrid
Pyredrid / GradientTextureDrawer.cs
Last active May 17, 2024 09:19
Gradient Texture Material Property Drawer
using UnityEngine;
using UnityEditor;
using System;
using System.Runtime.InteropServices;
/// <summary>
/// Use with "[GradientTexture]" before a texture shader property.
/// Gives a gradient editor instead of a texture selector when viewing
/// in the editor. Meaning you don't have to open any paint programs
/// to make gradient textures.
@JohannesDeml
JohannesDeml / TooltipDrawer.cs
Last active April 13, 2021 20:58
Unity Tooltip drawer for Material properties using reflection
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TooltipDrawer.cs" company="Supyrb">
// Copyright (c) 2018 Supyrb. All rights reserved.
// </copyright>
// <author>
// Johannes Deml
// send@johannesdeml.com
// </author>
// --------------------------------------------------------------------------------------------------------------------