I hereby claim:
- I am Float3 on github.
- I am hill3 (https://keybase.io/hill3) on keybase.
- I have a public key whose fingerprint is 137A 8777 BAE4 C121 47A1 1BA4 792F 6565 E9A0 CC50
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/* | |
Copyright 2018-2021 Lyuma, Float3 | |
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 furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE O |
MIT License
Copyright (c) 2021 3
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 furnished to do so, subject to the following conditions:
using System.Collections.Generic; | |
namespace _Float3 | |
{ | |
public class UnityBuiltin2019431F1 | |
{ | |
//the keywords listed are only those used by the shaders listed below | |
//all of this information was found by using $grep | |
public static readonly HashSet<string> BuiltInGlobalShaderKeywords = new HashSet<string>(new[] | |
{ |
// Original ShaderKeywordsUtility by ScruffyRules#0879 | |
// Thank you to Xiexe and all that tested! | |
// Licensed under the MIT License (see https://vrchat.com/legal/attribution) | |
// Updated by .3#0003 | |
// https://gist.github.com/Float3/afce1f343d3c5f912fb8943bf25f7fcb | |
#if UNITY_EDITOR | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEditor; |
// you can output depth in the frag shader by returning a struct that contains a element with the SV_DEPTH semantic | |
// or by adding it as a extra out parameter, also with the SV_DEPTH semantic. | |
// the latter is useful if you want to if guard it | |
// example 1: | |
// float4 frag(v2f i, uint facing : SV_IsFrontFace | |
// #ifdef DEPTH_PARALLAX | |
// ,out float depth : SV_DEPTH | |
// #endif |
// https://eheitzresearch.wordpress.com/240-2/ | |
// Generating the dfg: | |
// https://github.com/google/filament/blob/main/tools/cmgen/src/cmgen.cpp | |
// make sure to generate the multiscatter dfg | |
[NonModifiableTextureData] [NoScaleOffset] _DFG ("DFG Lut", 2D) = "black" {} | |
#if UNITY_EDITOR | |
#region | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using UnityEditor; | |
using UnityEditor.Build; |
// Method 1: | |
// by MerlinVR | |
// You can convert the uints to full precision floats using asfloat(half3ToUint(input)) and store floats using uintToHalf3(asuint(inputfloat)) | |
// Packing/unpacking routines for saving integers to R16G16B16A16_FLOAT textures | |
// Heavily based off of https://github.com/apitrace/dxsdk/blob/master/Include/d3dx_dxgiformatconvert.inl | |
// For some reason the last 2 bits get stomped so we'll only allow uint14 for now :( | |
float uint14ToFloat(uint input) | |
{ |
// to use this define | |
// #pragma shader_feature UNITY_EDITOR | |
// in your shader | |
#if UNITY_EDITOR | |
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEditor.Build; | |
using UnityEditor.Callbacks; |