Skip to content

Instantly share code, notes, and snippets.

View aras-p's full-sized avatar

Aras Pranckevičius aras-p

View GitHub Profile
@aras-p
aras-p / welcome.md
Created July 14, 2022 07:59
Welcome, ironSource! in human speak

(original: https://blog.unity.com/news/welcome-ironsource)

Welcome, ironSource!

Unity announced today that it has entered into an agreement to merge with ironSource. Wait, a merge you ask? This is more like an acquisition, but we chose "merge" wording for either accounting reasons, or for better stonks optics reasons.

We continue to believe that the world is a better place with more creators in it. This is actually a great statement that almost no one disagrees with!

We do have a bunch of products, and with our recent acquisitions of Parsec, SyncSketch, Wētā Digital, and Ziva Dynamics, we hope to somehow smash them into a coherent whole, eventually.

@aras-p
aras-p / ExportDDS.cs
Last active March 24, 2024 08:59
Unity DDS file exporter for compressed textures
// Adds context menu to TextureImporter objects, saves .dds next to input texture, including mipmaps.
// Tested with Unity 2021.3.4
using System;
using UnityEngine;
using UnityEditor;
using System.IO;
using Unity.Collections.LowLevel.Unsafe;
struct DDSHeader
@aras-p
aras-p / obj_exort_io.patch
Last active January 21, 2022 08:43
Blender 3.1 obj_export_io.hh output buffering
diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
index 92d478c20a1a2bd9beebda270848e369dfde3024..009b3eff8a836b5178d17f6675190160d1082d82 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -234,6 +234,42 @@ TEST(obj_exporter_writer, mtllib)
BLI_delete(out_file_path.c_str(), false, false);
}
+TEST(obj_exporter_writer, buffer_flushing)
+{
@aras-p
aras-p / results.md
Last active April 7, 2021 12:50
EquirectangularSeamCorrection results

https://twitter.com/bgolus/status/1379670566961995776

Unity 2021.1.1 on Apple M1 MacMini, Mac standalone player build, capture frame in Xcode and see the timings it prints for the fragment shader of the main draw.

Uncompressed, Aniso on:

  • None: 338, 373 us
  • Tarini: 361, 582 us
  • Explicit LOD: 418, 423 us
@aras-p
aras-p / DebugNode.hlsl
Created January 3, 2020 10:37
"Print a value" custom function node code for Unity ShaderGraph
// Quick try at doing a "print value" node for Unity ShaderGraph.
// Tested on Unity 2019.2.17 with ShaderGraph 6.9.2.
//
// Use with CustomFunction node, with two inputs:
// - Vector1 Value, the value to display,
// - Vector2 UV, the UVs of area to display at.
// And one output:
// - Vector4 Color, the color.
// Function name is DoDebug.
@aras-p
aras-p / lwrp.diff
Created December 2, 2019 15:55
Unity LWRP 6.9.0 -> 6.9.1 diff
diff -Naur lwrp-690/CHANGELOG.md lwrp-691/CHANGELOG.md
--- lwrp-690/CHANGELOG.md 2019-07-05 22:48:46.000000000 +0300
+++ lwrp-691/CHANGELOG.md 2019-07-30 00:57:01.000000000 +0300
@@ -4,6 +4,15 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [6.9.1] - 2019-07-29
+
+### Fixed
@aras-p
aras-p / CreateOneMeshFromWholeScene.cs
Last active December 26, 2023 05:41
Mesh.MeshData example
using System.Collections.Generic;
using System.Diagnostics;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Profiling;
using UnityEngine;
using UnityEditor;
using UnityEngine.Rendering;
@aras-p
aras-p / ExistingApi.cs
Created November 4, 2019 07:10
Mesh.ReadOnlyMeshData example
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;
using UnityEditor;
using UnityEngine.Rendering;
using Debug = UnityEngine.Debug;
public class CreateSceneMesh : MonoBehaviour
{
[MenuItem("GameObject/Create Scene Mesh %G")]
@aras-p
aras-p / xformJson.sh
Last active May 31, 2019 08:15
Using jq to manipulate build DAG json
cat artifacts/tundra/${1}.dag1.json | ./jq-osx-amd64 ".Nodes[] | {ann: .Annotation, act: (try .Action catch \"\"|split(\" \")|unique), txt: (try .WriteTextFilePayload catch \"foo\"|split(\" \")|map(split(\",\")|map(split(\"\\n\")))|add|add|unique), inp:.Inputs|unique}" >artifacts/_/${1}.dag1.json
cat artifacts/tundra/${1}.dag.json | ./jq-osx-amd64 ".Nodes[] | {ann: .Annotation, act: (try .Action catch \"\"|split(\" \")|unique), txt: (try .WriteTextFilePayload catch \"foo\"|split(\" \")|map(split(\",\")|map(split(\"\\n\")))|add|add|unique), inp:.Inputs|unique}" >artifacts/_/${1}.dag.json
diff -Naur artifacts/_/${1}.dag1.json artifacts/_/${1}.dag.json >artifacts/_/_${1}.diff
@aras-p
aras-p / example.shader
Created May 31, 2019 05:23
DX10 HLSL style textures and samplers in Unity
// Example of using DX10-style HLSL texture and sampler objects in
// Unity shaders
Shader "Unlit/Example"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{