Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
// Shader targeted for low end devices. Single Pass Forward Rendering.
Shader "Custom/Shadows Only"
{
// Keep properties of StandardSpecular shader for upgrade reasons.
Properties
{
_Alpha("Shadow Alpha", float) = 0.5
// Blending state
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DragObject : MonoBehaviour {
private Vector3 mOffset;
private float mZCoord;
@kirurobo
kirurobo / TransparentWindow.cs
Created February 16, 2019 09:11 — forked from wakagomo/TransparentWindow.cs
Transparent Window for Unity
///
/// Copyright (c) 2019 wakagomo
///
/// This source code is released under the MIT License.
/// http://opensource.org/licenses/mit-license.php
///
using UnityEngine;
using System;
using UnityEngine;
using UnityEngine.Profiling;
using System.Runtime.CompilerServices;
using System.Collections.Generic;
public class VectorTest : MonoBehaviour
{
Vector3[] array;
List<Vector3> list;
@pervognsen
pervognsen / rad.py
Last active January 18, 2024 02:30
# Reverse-mode automatic differentiation
import math
# d(-x) = -dx
def func_neg(x):
return -x, [-1]
# d(x + y) = dx + dy
def func_add(x, y):
// Written by: Johan Svensson (https://medium.com/dotcrossdot).
Shader "DotCrossDot/Water" {
Properties{
// Color
_Color("Color", Color) = (0,0,1,1)
_SmoothNess("SmoothNess", Range(0.0,1.0)) = 0
_Metallic("Reflectivity", Range(0.0,1.0)) = 0
_WaveFoamDir("Wave foam direction", Vector) = (0,0,0,0)
// Distortion (normals and height maps)
@josephbk117
josephbk117 / ReflectionProbeAccess.shader
Created November 18, 2018 18:51
Reflection Probe In Custom Unity Shader
/*Please do support www.bitshiftprogrammer.com by joining the facebook page : fb.com/BitshiftProgrammer
Legal Stuff:
This code is free to use no restrictions but attribution would be appreciated.
Any damage caused either partly or completly due to usage this stuff is not my responsibility*/
Shader "BitshiftProgrammer/ReflectionProbeAccess"
{
Properties
{
_Roughness("Roughness", Range(0.0, 10.0)) = 0.0
}
@sebbbi
sebbbi / BadCode.txt
Last active December 23, 2018 18:06
Let's improve this
int i13;
i13 = 0;
for (;i13<3;)
{
int i14;
i14 = 0;
for (;i14<3;)
{
uvec3 v15;
v15.x = 0u;
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@zznop
zznop / mem-loader.asm
Last active June 6, 2025 11:29
Fun little loader shellcode that executes an ELF in-memory using an anonymous file descriptor (inspired by https://x-c3ll.github.io/posts/fileless-memfd_create/)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Copyright (C), zznop, [email protected]
;;;
;;; This software may be modified and distributed under the terms
;;; of the MIT license. See the LICENSE file for details.
;;;
;;; DESCRIPTION
;;;
;;; This PoC shellcode is meant to be compiled as a blob and prepended to a ELF