Skip to content

Instantly share code, notes, and snippets.

View asus4's full-sized avatar
:octocat:
Working from home

Koki Ibukuro asus4

:octocat:
Working from home
View GitHub Profile
@asus4
asus4 / ARBackgroundRendererFeatureExtended.cs
Created July 21, 2024 02:51
Expose the AR background texture to the global in ARBackgroundRendererFeature.cs
/*
Modified from
`Packages/com.unity.xr.arfoundation/Runtime/ARFoundation/ARBackgroundRendererFeature.cs`
Licensed under the Unity Companion License for Unity-dependent projects (see [Unity Companion License](https://unity3d.com/legal/licenses/unity_companion_license)).
*/
using UnityEngine;
using UnityEngine.Rendering;
#if MODULE_URP_ENABLED
@asus4
asus4 / curve-shapekey-to-mesh.py
Created July 13, 2024 21:29
A Blender script that converts all shape keys in a Curve object to a mesh with shape keys
'''
A Blender script that
1. Convert all shape keys in a curve object to mesh
2. Join all shape keys to a new mesh object
'''
import bpy
def resetAllShapeKeys(target):
for key in target.data.shape_keys.key_blocks:
@asus4
asus4 / ListAllReverbPresetSettings.cs
Created November 30, 2023 14:52
List All Reverb Preset Parameters
using System;
using System.Text;
using UnityEngine;
public class ListAllReverbPresetSettings : MonoBehaviour
{
[SerializeField]
AudioReverbFilter filter;
private void Start()
@asus4
asus4 / tsv2localizable.py
Last active July 17, 2022 06:07
Converts a TSV file into Xcode Localizable strings
#!/usr/bin/python3
import argparse
import csv
import datetime
# A simple script that converts a TSV file into Xcode Localizable strings
# TSV format:
'''
id, comment, en, ja
@asus4
asus4 / tf-lite-unity-sample-Resize.shader
Created June 14, 2020 07:46
tf-lite-unity-sample Resize.shader
Shader "Hidden/TFLite/Resize"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Cull Off
ZWrite Off
@asus4
asus4 / checkaudioloudness.ipynb
Created March 18, 2020 11:40
CheckAudioLoudness.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asus4
asus4 / pickdominantcolor.ipynb
Created March 3, 2020 14:21
PickDominantColor.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
void Start()
{
// Option
var options = new Interpreter.Options()
{
// Multithread
threads = 2,
// Metal option
gpuDelegate = new MetalDelegate(new MetalDelegate.Options()
{
// the image 28 * 28 grayscale
float[,] inputs = new float[28, 28];
// the array of probability
float[] outputs = new float[10];
void Start()
{
// Read bytes from model and make Interpreter
interpreter = new Interpreter(File.ReadAllBytes(path));
@asus4
asus4 / NativeArrayExtension.cs
Last active February 2, 2023 16:12
NativeArray -> byte[] , byte[] -> NativeArray
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
namespace ARKitStream.Internal
{
public static class NativeArrayExtension
{
public static byte[] ToRawBytes<T>(this NativeArray<T> arr) where T : struct
{
var slice = new NativeSlice<T>(arr).SliceConvert<byte>();