Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
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 May 10, 2025 06:36
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

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 or Unity for their games (or that's what lot of people think) because d

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 April 29, 2025 08:22
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

## Compute the Fourier coefficients of the harmonic parametrization of the
## boundary of the Mandelbrot set, using the formulae given in following paper:
## John H. Ewing & Glenn Schober, "The area of the Mandelbrot set",
## Numer. Math. 61 (1992) 59-72 (esp. formulae (7) and (9)). (Note that their
## numerical values in table 1 give the coefficients of the inverse series.)
## The coefficients ctab[m] are the b_m such that z + sum(b_m*z^-m) defines a
## biholomorphic bijection from the complement of the unit disk to the
## complement of the Mandelbrot set. The first few values are:
## [-1/2, 1/8, -1/4, 15/128, 0, -47/1024, -1/16, 987/32768, 0, -3673/262144]