Skip to content

Instantly share code, notes, and snippets.

@ArieLeo
ArieLeo / concave_object_to_convex_objects_by_face.py
Created April 8, 2022 14:39 — forked from GuyPaddock/concave_object_to_convex_objects_by_face.py
Blender 2.91 Script for Convex Hull Decomposition into Separate Shapes Using Blender's Convex using "Split Concave Faces"
##
# A script to split simple, architectural geometry into convex pieces.
#
# This script makes use of Blender's built-in "Split Concave Faces" clean-up
# algorithm to break-up the faces of an object into convex pieces. The script
# attempts to identify all the edges that represent convex boundaries, and then
# it splits objects up along those edges. Each resulting piece is then made into
# a closed object by converting it into a convex hull.
#
# Be sure to select the object you wish the split into convex pieces before
@ArieLeo
ArieLeo / FloatingOrigin.cs
Created April 5, 2022 18:19 — forked from brihernandez/FloatingOrigin.cs
Floating origin to handle large worlds in Unity.
// Based on the Unity Wiki FloatingOrigin script by Peter Stirling
// URL: http://wiki.unity3d.com/index.php/Floating_Origin
using UnityEngine;
using UnityEngine.SceneManagement;
public class FloatingOrigin : MonoBehaviour
{
[Tooltip("Point of reference from which to check the distance to origin.")]
public Transform ReferenceObject = null;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class AnimatorPanel : MonoBehaviour
{
[SerializeField] Animator _animator;
[SerializeField] Button _button;
void Start()
@ArieLeo
ArieLeo / Tricubic.cginc
Created February 16, 2022 14:38 — forked from Fewes/Tricubic.cginc
Tricubic texture sampling for Unity
/*--------------------------------------------------------------------------*\
Copyright (c) 2008-2009, Danny Ruijters. All rights reserved.
http://www.dannyruijters.nl/cubicinterpolation/
This file is part of CUDA Cubic B-Spline Interpolation (CI).
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
@ArieLeo
ArieLeo / RaindropTextureBomber.shader
Created January 20, 2022 10:59 — forked from unitycoder/RaindropTextureBomber.shader
Unity Texture Bombing (rain drops)
// https://forum.unity.com/threads/texture-bombing-lets-tackle-this-one.185724/#post-1278100
Shader "Annihlator/Raindrop TextureBomber" {
    Properties {
        _MainTex("Texture (RGB)", 2D) = "black" {}
        _BumpMap ("Normalmap", 2D) = "bump" {}
        _BombTex("Bomb Texture (RGB)", 2D) = "black" {}
        _RandomTex("Random Texture (RGB)", 2D) = "black" {}
        _Slider("Slider", Range(0,1)) = 1
        _Params("Params, Z = Scale",Vector) = (0.037, 0.119, 5, 0)
        _ReflectionTex ("Reflection", 2D) = "white" { TexGen ObjectLinear }
@ArieLeo
ArieLeo / AmbientOcclusionDirection.osl
Created January 15, 2022 13:36 — forked from simonbroggi/AmbientOcclusionDirection.osl
Calculates AO and the average direction where the ambient light came from.
/*
* Ambient Occlusion and Direction.
*
* Calculates AO and the average direction where the ambient light came from.
*
* Original AO code from https://github.com/sambler/osl-shaders/blob/master/ramps/BaAmbientOcclusion/BaAmbientOcclusion.osl
*
*/
void rng_seed(output int rng, int seed)
@ArieLeo
ArieLeo / GrabScreenFeature.cs
Created November 7, 2021 09:39 — forked from Refsa/GrabScreenFeature.cs
Unity URP custom grab pass
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class GrabScreenFeature : ScriptableRendererFeature
{
[System.Serializable]
public class Settings
@ArieLeo
ArieLeo / URPSimpleLit.shader
Created November 7, 2021 09:39 — forked from Refsa/URPSimpleLit.shader
Unity - Shader showing how to write a Simple Lit shader for Unity URP
Shader "Custom/URPSimpleLit"
{
Properties
{
_Color ("Color", Color) = (1,0,0,1)
}
SubShader
{
Tags {
"RenderPipeline" = "UniversalPipeline"
@ArieLeo
ArieLeo / BlurEffect.compute
Created November 7, 2021 09:38 — forked from Refsa/BlurEffect.compute
Unity URP custom render feature for UI Blur
#pragma kernel Downscale
#pragma kernel GaussianBlurVertical
#pragma kernel GaussianBlurHorizontal
#pragma kernel BoxBlur
Texture2D<float4> _Source;
RWTexture2D<float4> _Dest;
float _Amount;
float2 _Size;
@ArieLeo
ArieLeo / Usage.cs
Created November 7, 2021 09:38 — forked from Refsa/Usage.cs
DrawMeshInstancedIndirect with ShaderGraph and URP
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
class Render : MonoBehaviour
{
struct DrawData
{
public Vector3 Pos;
public Quaternion Rot;