Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@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 July 8, 2025 00:53
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" {}
@bgolus
bgolus / StereographicProjectionBubble.shader
Created February 28, 2020 06:33
Modifying UVs using stereographic projection to create the illusion of a sphere.
Shader "Unlit/StereographicProjectionBubble"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_PanSpeed ("Pan Speed", Float) = 0.1
_Spherify ("Spherify", Range(0,1)) = 1
}
SubShader
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
using TMPro;
using System.Text.RegularExpressions;
public class ButtonNameToText : EditorWindow
{
@De-Panther
De-Panther / UnityLoaderCompatibilityCheck.js
Last active February 27, 2021 00:42
Unity WebGL on mobile - Code snippet for patching UnityLoader.compatibilityCheck() so it won't show popup message on mobile. Works in Unity 2018 and 2019. Unity 2020 switched templates and don't need it.
UnityLoader.compatibilityCheck = function (unityInstance, onsuccess, onerror) {
if (!UnityLoader.SystemInfo.hasWebGL) {
unityInstance.popup('Your browser does not support WebGL',
[{text: 'OK', callback: onerror}]);
} else {
onsuccess();
}
}
// now you can call ... var unityInstance = UnityLoader.instantiate( ...
@kentbrew
kentbrew / cookies.md
Last active October 20, 2024 15:55
Quick-read cookies via browser extension

Here's a thing you can do to quickly reveal any or all cookies set on your WebExtensions-compatible browser from any domain. For this example we'll use Chrome but it should work wherever you can debug a browser extension.

You need to have at least one add-on installed that has a background page; to find it, go to chrome://extensions, be sure Developer Mode is on (top right sliding switch) and see if any of your installed extensions has a link to background page next to Inspect Views.

Once you find a link to a background page, click it. A Web inspector should appear; when it does, go to the Console tab and paste this:

chrome.cookies.getAll(
  {domain: "facebook.com"},
 results => {
@pixelsnafu
pixelsnafu / CloudsResources.md
Last active June 28, 2025 11:08
Useful Resources for Rendering Volumetric Clouds

Volumetric Clouds Resources List

  1. A. Schneider, "Real-Time Volumetric Cloudscapes," in GPU Pro 7: Advanced Rendering Techniques, 2016, pp. 97-127. (Follow up presentations here, and here.)

  2. S. Hillaire, "Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite" in Physically Based Shading in Theory and Practice course, SIGGRAPH 2016. [video] [course notes] [scatter integral shadertoy]

  3. [R. Högfeldt, "Convincing Cloud Rendering – An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite"](https://odr.chalmers.se/hand