Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@alecjacobson
alecjacobson / denoise.sh
Last active May 1, 2025 05:53
Remove background audio noise from a video clip via the command line (using ffmpeg and sox)
#!/bin/bash
if [ -z "$2" ];then
echo 'USAGE:
denoise input.mov output.mov
OR
denoise input.mov output.mov [ambient-noise-start-time] [ambient-noise-duration] [sox-noisered-amount] [sox-norm-param]
Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always
@spajus
spajus / CompileTime.cs
Created July 2, 2020 07:59
Put this into Scripts/Editor and open via Unity menu Kodo Linija > Compile Time
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Compilation;
using UnityEditor.SceneManagement;
using UnityEngine;
class CompileTime : EditorWindow {
bool allowProfiler = false;
bool isTrackingTime;
@texone
texone / gist:66a46554a6fbda50ccc9831561e4037f
Created June 19, 2020 06:58 — forked from DuncanF/gist:353509dd397ea5f292fa52d1b9b5133d
Unity lockless (no GPU readback) marching cubes via Graphics.DrawProceduralIndirect - some slight faffing because compute shader must append full triangle (3 verts) at a time to render correctly, but this means the appendbuffer count is 3 times smaller than it needs to be, so we have to invoke a very short compute shader (FixupIndirectArgs) just…
MarchingCubesGPU.cs:
...
// DrawProceduralIndirect
ComputeBuffer argsBuffer;
[StructLayout(LayoutKind.Sequential)]
struct DrawCallArgBuffer
{
public const int size =
sizeof(int) +
sizeof(int) +
@ArieLeo
ArieLeo / StandardReflectionProbe.shader
Created June 11, 2020 13:06 — forked from unitycoder/StandardReflectionProbe.shader
Unity Standard Shader - Accessing BoxProfected Reflection Probe Cubemap
// Moved most of the functions from includes into the shader
// Removed lots of unnecessary stuff (i just want the reflection probe cube)
// Still plenty to cleanup
// NEW: http://forum.unity3d.com/threads/reflection-probes-in-a-custom-surface-shader.378549/#post-2685603
// References (none of the scripts worked..)
// http://forum.unity3d.com/threads/reflection-probes-in-a-custom-surface-shader.378549/
// http://forum.unity3d.com/threads/reflection-probes-in-custom-shader.322562/
// http://forum.unity3d.com/threads/accessing-reflection-probe-cubemaps.307077/
@aholkner
aholkner / InstallUnity.cmd
Last active February 8, 2023 09:06
PowerShell script to install correct version of Unity for a project
@echo off
title Install Unity
echo Just a moment...
powershell -NoProfile -NoLogo -ExecutionPolicy Unrestricted -File PowershellScripts\InstallUnity.ps1 -Project . -Components Windows
pause
using System.Reflection;
using UnityEditor.ShaderGraph;
using UnityEngine;
[Title("Custom", "Image", "Sobel Edge Detection")]
public class SobelNode : CodeFunctionNode
{
public SobelNode()
{
name = "Sobel Edge Detection";
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active November 30, 2025 02:19
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

WARNING: Article moved to separate repo to allow users contributions: https://github.com/raysan5/custom_game_engines

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like [Unreal](https:

using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
using UnityEngine.Profiling;
class SimpleProfilerWindow : EditorWindow
{
Shader "Custom/Dissolve" {
Properties {
//_Color and _MainTex are the generic properties needed to add a texture and a color overlay on our object.
[MainTexture] _BaseColor("Base Color", Color) = (1, 1, 1, 1)
[MainColor] _BaseMap("Base Map (RGB) Smoothness / Alpha (A)", 2D) = "white" {}
//The _SliceGuide and _SliceAmount are responsible for the dissolving of our model.
//The first is a texture that will be used to determine the overall shape of the dissolving, while the latter is how much will the object be dissolved,
//where 0 means that the object is unaffected from the dissolving and 1 means that the object is completely dissolved.
_SliceGuide("Slice Guide (RGB)", 2D) = "white" {}