Skip to content

Instantly share code, notes, and snippets.

View zukas3's full-sized avatar

Aivaras Ivoškus zukas3

  • Unity Technologies
  • Vilnius, Lithuania
View GitHub Profile
@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;
@zmts
zmts / docker.md
Last active March 13, 2024 07:21
Docker, TypeScript, Node.js

Docker, TypeScript, Node.js

Preconditions:

  • TS application listening port: 7777
|-- dist
|-- src
|-- .dockerignore
|-- Dockerfile
@elringus
elringus / BlendModes.c
Last active March 11, 2024 11:32
Popular blend mode algorithms implemented in Nvidia's Cg. https://elringus.me/blend-modes-in-unity/
fixed3 Darken (fixed3 a, fixed3 b)
{
return min(a, b);
}
fixed3 Multiply (fixed3 a, fixed3 b)
{
return a * b;
}
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 5, 2024 09:12
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@DomNomNom
DomNomNom / intersectAABB.glsl
Last active May 4, 2024 22:02
Ray-AABB (Axis Aligned Bounding Box) intersection.
// adapted from intersectCube in https://github.com/evanw/webgl-path-tracing/blob/master/webgl-path-tracing.js
// compute the near and far intersections of the cube (stored in the x and y components) using the slab method
// no intersection means vec.x > vec.y (really tNear > tFar)
vec2 intersectAABB(vec3 rayOrigin, vec3 rayDir, vec3 boxMin, vec3 boxMax) {
vec3 tMin = (boxMin - rayOrigin) / rayDir;
vec3 tMax = (boxMax - rayOrigin) / rayDir;
vec3 t1 = min(tMin, tMax);
vec3 t2 = max(tMin, tMax);
float tNear = max(max(t1.x, t1.y), t1.z);
@DavidWells
DavidWells / add-wordpress-settings-page.php
Created January 28, 2013 05:59
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters