This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spherical cap cone analytic solution is a 1d problem, since the cone cap sphere slides along the ray. The intersection point to empty space sphere is always on the ray. | |
S : radius of cone cap sphere at t=1 | |
r(d) : cone cap sphere radius at distance d | |
r(d) = d*S | |
p = distance of current SDF sample | |
SDF(p) = sdf function result at location p | |
x = distance after conservative step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
using Unity.Mathematics; | |
using UnityEngine; | |
public class NativeMesh : IDisposable | |
{ | |
public NativeArray<float3> VertexBuffer; | |
public NativeArray<float3> NormalBuffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Rendering; | |
using UnityEngine.Rendering.Universal; | |
[ExecuteInEditMode] | |
public class CustomPass : MonoBehaviour | |
{ | |
public Mesh mesh; | |
public Material material; | |
DrawMeshPass m_DrawMeshPass; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pixel formats: | |
I.... = Supported Input format for conversion | |
.O... = Supported Output format for conversion | |
..H.. = Hardware accelerated format | |
...P. = Paletted format | |
....B = Bitstream format | |
FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL | |
----- | |
IO... yuv420p 3 12 | |
IO... yuyv422 3 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Full shader example demonstrating how to use a quaterionion to rotate a vertex around a specific point. Note that this is just a plain | |
// vanilla unlit shader which includes the necessary functions (see section below) and example code in the vertex shader. | |
// | |
// Forked from https://gist.github.com/nkint/7449c893fb7d6b5fa83118b8474d7dcb | |
// Converted from GLSL to Cg. For help with that, see https://alastaira.wordpress.com/2015/08/07/unity-shadertoys-a-k-a-converting-glsl-shaders-to-cghlsl/ | |
// | |
// quaternion code from https://github.com/stackgl/gl-quat | |
// rotation from https://twistedpairdevelopment.wordpress.com/2013/02/11/rotating-a-vector-by-a-quaternion-in-glsl/ | |
Shader "Unlit/Quaternion" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine.Internal; | |
using UnityEngine; | |
using System.Runtime.Serialization; | |
using System.Xml.Serialization; | |
/// <summary> | |
/// Quaternions are used to represent rotations. | |
/// A custom completely managed implementation of UnityEngine.Quaternion | |
/// Base is decompiled UnityEngine.Quaternion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This doesn't seem to work properly | |
//#define USE_UNITY_PIN_FUNCTION | |
using System; | |
using System.Runtime.InteropServices; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; | |
using UnityEngine; | |
using UnityEngine.Assertions; | |
// Trick for creating a temporary NativeArray which points to the contents of a managed array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace ConversionLayer.Wave | |
{ | |
internal class SineWave | |
{ | |
#region Fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
pybind11/cast.h: Partial template specializations to cast between | |
C++ and Python types | |
Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch> | |
All rights reserved. Use of this source code is governed by a | |
BSD-style license that can be found in the LICENSE file. | |
*/ |
OlderNewer