Unlike cached approach, this is simpler but takes much longer to setup on each run.
Intel APT repo is used.
| using System.IO; | |
| using UnityEditor; | |
| using UnityEngine; | |
| namespace UnityLibrary | |
| { | |
| [CustomEditor(typeof(SceneAsset))] | |
| public class CustomThumbnail : Editor | |
| { | |
| public override bool HasPreviewGUI() => true; |
| #%% <- this is vscode stuff, this will run on the command line but plots might come out weird | |
| import numpy as np | |
| u32 = np.uint32 | |
| i32 = np.int32 | |
| def golden_ratio_sequence(i: u32) -> u32: | |
| return u32(i) * u32(2654435769) # 0.614... in 0.32 fixed point | |
| def reverse_bits32(x: u32) -> u32: | |
| x = u32(x) |
| using UnityEngine; | |
| using UnityEditor; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| public class BatchExtractMaterials : EditorWindow | |
| { | |
| private enum ExtractMode { Extract = 0, Remap = 1, Ignore = 2 }; | |
| [System.Serializable] |
| /* Created by easyaspi314. Released into the public domain. */ | |
| #include <ctype.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #ifdef __SSE2__ | |
| #include <immintrin.h> |
| #ifndef XOSHIRO_HPP_INCLUDED | |
| #define XOSHIRO_HPP_INCLUDED 1 | |
| /* | |
| * A C++ implementation of a family of Xoshiro generators. | |
| * | |
| * See: | |
| * https://arxiv.org/abs/1805.01407 | |
| * http://xoshiro.di.unimi.it/xoshiro256plus.c | |
| * http://xoshiro.di.unimi.it/xoshiro256starstar.c |
| /* | |
| The MIT License (MIT) | |
| Copyright (c) 2018 Ivor Wanders | |
| 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 | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is |
| #if 0 // self-compiling code | |
| gcc -std=c99 -Wall -Wextra -pedantic -g -O3 -march=native $0 -o image_predict || exit 1 | |
| exec ./image_predict $* | |
| #endif | |
| // Example code for pre-filtering operations that transform RGB images into | |
| // representations that are better suited for lossless compression | |
| // (color channel separation and decorrelation, pixel prediction). | |
| // Takes a .ppm file as an input and generates multiple files in the form |
| #ifndef XORSHIFT_HPP_INCLUDED | |
| #define XORSHIFT_HPP_INCLUDED 1 | |
| /* | |
| * A C++ implementation of a family of truncated XorShift* generators. | |
| * | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2017-19 Melissa E. O'Neill | |
| * |
| Shader "Custom/Template" | |
| { | |
| Properties | |
| { | |
| _MainTex ("Albedo (RGB)", 2D) = "white" {} | |
| } | |
| SubShader | |
| { | |
| Tags { "RenderType"="Opaque" } | |
| LOD 80 |