Skip to content
View babon's full-sized avatar

Block or report babon

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. Convert unity texture without extens... Convert unity texture without extension as png
    1
    [ContextMenuItem("Yo", "Yo")]
    2
        public Texture2D tex;
    3
        public void Yo()
    4
        {
    5
            Texture2D DeCompress(Texture2D source)
  2. Unity memory mapped file to native a... Unity memory mapped file to native array, to directly read write to disk file from gpu buffer.cs
    1
    public class MMFNativeArray<T> where T : struct
    2
    {
    3
        MemoryMappedFile mmf;
    4
        MemoryMappedViewAccessor accessor;
    5
        public NativeArray<T> native;
  3. attempt at saving a computebuffer wi... attempt at saving a computebuffer with asyncgpureadback, nativearray, memory mapped file.cs
    1
    void SavePartMM(int offset = 0, int partSize = fullWidth * fullHeight * fullDepth, int chunkSizeDiv = 1024)
    2
        {
    3
            //crashes if empty save file for some reason, too unreliable to use
    4
            var mmf = MemoryMappedFile.CreateFromFile(Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer ? "/Users/user/Downloads/test.bytes" : "C:\\test.bytes", FileMode.OpenOrCreate, "apoca_save");
    5
    
                  
  4. Unity compute shader dispatch helper... Unity compute shader dispatch helper with better syntax
    1
    //Example usage:
    2
    shader.Dispatch("Advect", texWidth, texHeight, texDepth, 
    3
        "_texture", texture,
    4
        "_separationPlane", Vector3.Scale(separationPlane.position, tscale),
    5
        "_advectFall", advectN == 0,
  5. C# List that reports better OutOfRan... C# List that reports better OutOfRange exceptions.cs
    1
    //will throw like "[0], [1], [0], [1], [2] [0..1]"
    2
    
                  
    3
    public sealed class LastNQueue<T> : Queue<T>
    4
    {
    5
        public int HoldLastN { get; }
  6. Unity efficiently convert RenderText... Unity efficiently convert RenderTexture to Texture3D.cs
    1
    //input RenderTexture 'rt3D'
    2
    
                  
    3
    Texture3D output = new Texture3D(width, height, depth, rt3D.graphicsFormat, TextureCreationFlags.None);
    4
    //assuming rt3D format to be 8 bits
    5
    var a = new NativeArray<byte>(width * height * depth, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);