Importing cubemaps from single images
So this tweet on EXR format in texture pipeline and replies on cubemaps made me write this…Typically skies or environment maps are authored as regular 2D textures, and then turned into cubemaps at...
View ArticleDivide and Conquer Debugging
It should not be news to anyone that ability to narrow down a problem while debugging is an incredibly useful skill. Yet from time to time, I see people just helplessly randomly stumbling around, when...
View ArticleCurious Case of Slow Texture Importing, and xperf
I was looking at a curious bug report: “Texture importing got much slower in current beta”. At first look, I dismissed it under “eh, someone’s being confused” (quickly tried on several textures, did...
View ArticleOptimizing Shader Info Loading, or Look at Yer Data!
A story about a million shader variants, optimizing using Instruments and looking at the data to optimize some more.The Bug ReportThe bug report I was looking into was along the lines of “when we put...
View ArticleRandom Thoughts on New Explicit Graphics APIs
Last time I wrote about graphics APIs wasalmost a year ago. Since then,Apple Metal was unveiled and shipped in iOS 8; as well as Khronos Vulkan was announced (which is very muchAMD Mantle, improved to...
View ArticleOptimizing Unity Renderer Part 1: Intro
At work we formed a small “strike team” for optimizing CPU side of Unity’s rendering. I’ll blog about my part as I go (idea of doing that seems to be generally accepted). I don’t know where that will...
View ArticleOptimizing Unity Renderer Part 2: Cleanups
With the story introduction in the last post, let’s get to actual work now!As already alluded in the previous post, first I try to remember / figure out what the existing code does, do some profiling...
View ArticleOptimizing Unity Renderer Part 3: Fixed Function Removal
Last time I wrote about some cleanups and optimizations. Since then, I got sidetracked into doing some Unity 5.1 work, removing Fixed Function Shaders and other unrelated things. So not much blogging...
View ArticleCareful With That STL map insert, Eugene
So we had this pattern in some of our code. Some sort of “device/API specific objects” need to be created out of simple “descriptor/key” structures. Think D3D11 rasterizer state orMetal pipeline state,...
View Article10 Years at Unity
Turns out, I started working on this “Unity” thing exactly 10 years ago. I wrote the backstory in“2 years later” and “4 years later“ posts, so not worth repeating it here.A lot of things have happened...
View ArticleBackporting Fixes and Shuffling Branches
“Everyday I’m Shufflin’” – LMFAOFor past few months at work I’m operating this “graphics bugfixes” service. It’s a very simple, free (*) service that I’m doing to reduce overhead of doing “I have this...
View ArticleSolving DX9 Half-Pixel Offset
Summary: the Direct3D 9 “half pixel offset” problem that manages to annoy everyone can be solved in a single isolated place, robustly, and in a way where you don’t have to think about it ever again....
View ArticleMaldives Vacation Report 2016
Just spent 9 days in Maldives doing nothing! So here’s a writeup and a bunch of photos.“Magical”, “paradise”, “heaven” and other things, they say. So we decided to check it out for ourselves. Another...
View ArticleAdam Demo production talk at CGEvent
A while ago I delivered a talk at CG EVENT 2016 in Vilnius, about some production details of Unity’s Adam demo.Clarification point! I did nothing at all for the demo production, just did the talk...
View ArticleHash Functions all the way down
A while ago I needed fast hash function for ~32 byte keys. We already had MurmurHash used in a bunch of places, so I started with that. But then I tried xxHash and that was a bit faster! So I dropped...
View ArticleMore Hash Function Tests
In the previous post, I wrote about non-crypto hash functions, and did some performance tests. Turns out, it’s great to write about stuff! People at the comments/twitter/internets pointed out more...
View ArticleSPIR-V Compression
TL;DR: Vulkan SPIR-V shaders are fairly large. SMOL-V can make them smaller.Other folks are implementing Vulkan support at work, and the other day they noticed that Vulkan shaders (which are...
View ArticleShader Compression: Some Data
One common question I had about SPIR-V Compression is “why compress shaders at all?“, coupled with question on how SPIR-V shaders compare with shader sizes on other platforms.Here’s some data (insert...
View ArticleInterview questions
Recently saw quite some twitter discussions about good & bad interview questions. Here’s a few I found useful.In general, the most useful questions seem to be fairly open-ended ones, that can...
View ArticleAmazing Optimizers, or Compile Time Tests
I wrote some tests to verify sorting/batching behavior in rendering code, and they were producing different results on Windows (MSVC) vs Mac (clang). The tests were creating a “random fake scene” with...
View Article