Skip to content

Instantly share code, notes, and snippets.

@larssteenhoff
larssteenhoff / DistantPixelize.cs
Created September 23, 2023 23:06 — forked from joshcamas/DistantPixelize.cs
Distant Pixelize Renderer (Using SCPE)
#if URP
using UnityEngine.Rendering.Universal;
#endif
using System;
using UnityEngine;
using UnityEngine.Rendering;
using SCPE;
namespace Ardenfall.Effects
@larssteenhoff
larssteenhoff / shader_distantpixelize.shader
Created September 23, 2023 23:00 — forked from joshcamas/shader_distantpixelize.shader
Distant Pixelize Unity Effect
Shader "Ardenfall/Effects/DistantPixelize"
{
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
float _MaxPixelSize;
float _MinPixelSize;
float _MaxDistance;
@larssteenhoff
larssteenhoff / UnitypackageExtractor.cs
Created April 25, 2023 14:28 — forked from yasirkula/UnitypackageExtractor.cs
Extract a .unitypackage to any directory (even outside the project folder) from within Unity
#define STOP_EXTRACTION_WHEN_WINDOW_CLOSED
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Text;
using System.Threading;
using UnityEditor;
@larssteenhoff
larssteenhoff / ConvertTexturesToPNG.cs
Created April 25, 2023 14:26 — forked from yasirkula/ConvertTexturesToPNG.cs
Convert all TGA, TIFF, PSD and BMP (customizable) Textures to PNG to reduce the project size without any quality loss in Unity
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
@larssteenhoff
larssteenhoff / .gitattributes
Created December 13, 2022 12:43 — forked from Srfigie/.gitattributes
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
using UnityEngine;
using UnityEditor;
/// <summary>
/// Scene preview data.
/// http://diegogiacomelli.com.br/unitytips-scene-preview-window
/// </summary>
public class ScenePreviewData
{
Texture2D _texture;