- Thoughts on depth texture in forward rendering in Unity
- ARM® Guide to Unity Enhancing Your Mobile Games Home > Optimization Lists > GPU optimizations > Use depth pre-pass
- Optimizing Tegra Apps and Games using Unity
- deferred shading in Unity
- Reuse depth buffer of Main Camera?
Notes of Depth prepass
- Z-Prepass Considered Irrelevant
- Fast per-pixel lit volumetric fog without depth pre-pass
Notes of linear/gamma color space and HDR in Unity 5.4.0.3f3
// HLSLSupport.cginc // UNITY_NO_RGBM - no RGBM support, so doubleLDR // UNITY_NO_LINEAR_COLORSPACE - no linear color space support #if defined(SHADER_API_PSP2) // To get acceptable precision from the SGX interpolators when decoding RGBM type // textures we have to disable sRGB reads and then convert to gamma space in the shader // explicitly. #define UNITY_FORCE_LINEAR_READ_FOR_RGBM #endif // Decodes HDR textures // handles dLDR, RGBM formats inline half3 DecodeHDR (half4 data, half4 decodeInstructions) { // If Linear mode is not supported we can skip exponent part #if defined(UNITY_NO_LINEAR_COLORSPACE) return (decodeInstructions.x * data.a) * data.rgb; #else return (decodeInstructions.x * pow(data.a, decodeInstructions.y)) * data.rgb; #endif } // Decodes HDR textures // handles dLDR, RGBM formats // Called by DecodeLightmap when UNITY_NO_RGBM is not defined. inline half3 DecodeLightmapRGBM (half4 data, half4 decodeInstructions) { // If Linear mode is not supported we can skip exponent part #if defined(UNITY_NO_LINEAR_COLORSPACE) # if defined(UNITY_FORCE_LINEAR_READ_FOR_RGBM) return (decodeInstructions.x * data.a) * sqrt(data.rgb); # else return (decodeInstructions.x * data.a) * data.rgb; # endif #else return (decodeInstructions.x * pow(data.a, decodeInstructions.y)) * data.rgb; #endif }
// UnityCG.cginc inline bool IsGammaSpace() { #if defined(UNITY_NO_LINEAR_COLORSPACE) return true; #else // unity_ColorSpaceLuminance.w == 1 when in Linear space, otherwise == 0 return unity_ColorSpaceLuminance.w == 0; #endif } inline float GammaToLinearSpaceExact (float value) { if (value <= 0.04045F) return value / 12.92F; else if (value < 1.0F) return pow((value + 0.055F)/1.055F, 2.4F); else return pow(value, 2.2F); } inline half3 GammaToLinearSpace (half3 sRGB) { // Approximate version from http://chilliant.blogspot.com.au/2012/08/srgb-approximations-for-hlsl.html?m=1 return sRGB * (sRGB * (sRGB * 0.305306011h + 0.682171111h) + 0.012522878h); // Precise version, useful for debugging. //return half3(GammaToLinearSpaceExact(sRGB.r), GammaToLinearSpaceExact(sRGB.g), GammaToLinearSpaceExact(sRGB.b)); } inline float LinearToGammaSpaceExact (float value) { if (value <= 0.0F) return 0.0F; else if (value <= 0.0031308F) return 12.92F * value; else if (value < 1.0F) return 1.055F * pow(value, 0.4166667F) - 0.055F; else return pow(value, 0.45454545F); } inline half3 LinearToGammaSpace (half3 linRGB) { linRGB = max(linRGB, half3(0.h, 0.h, 0.h)); // An almost-perfect approximation from http://chilliant.blogspot.com.au/2012/08/srgb-approximations-for-hlsl.html?m=1 return max(1.055h * pow(linRGB, 0.416666667h) - 0.055h, 0.h); // Exact version, useful for debugging. //return half3(LinearToGammaSpaceExact(linRGB.r), LinearToGammaSpaceExact(linRGB.g), LinearToGammaSpaceExact(linRGB.b)); }
// Standard.shader #pragma multi_compile ___ UNITY_HDR_ON
Editor API
- PlayerSettings.colorSpace
- AtlasSettings.colorSpace
Engine API
- RenderTexture.sRGB
- RenderTextureReadWrite
- GL.sRGBWrite
- SystemInfo.SupportsRenderTextureFormat( DefaultHDR )
Notes of Mobile CPU
Notes of SVN
Notes of slow Unity Functions
- Shader.CreateGPUProgram
- UpdateDepthNormalTexture, UpdateDepthTexture
- Loading.ReadObject, LoadFileHeaders, IDRemaping
- http://baba-s.hatenablog.com/entry/2015/08/11/100000
- https://ralphbarbagallo.com/2012/07/23/how-to-prevent-performance-spikes-in-unity3d-when-a-model-is-first-visible/
- http://hideapp.cocolog-nifty.com/blog/2013/01/unity-actiontt-.html
- https://docs.unity3d.com/Manual/AsyncTextureUpload.html
- https://gist.github.com/flarb/3160727
- http://answers.unity3d.com/questions/7836/preloading-caching-prefabs-unity-iphone.html
- GUI.Repaint, GUIUtility.BeginGUI, GCollect
- EventSystem.Update
- Canvas.SendWillRenderCanvases, Font.CacheFontForText
- http://takashicompany.hatenablog.com/entry/2014/12/29/162713
- https://community.unity.com/t5/Unity-UI/Performance-spike-on-Canvas-SendWillRenderCanvases-when-moving-a/td-p/2010878/page/2
- https://forum.unity3d.com/threads/massive-font-cachefontfortext-cpu-spike-using-default-gui.227022/
- http://answers.unity3d.com/questions/149762/how-to-prepopulate-font-cache.html
- Optimize
Notes of Mobile GPU
- Mali : Game Developers Conference (GDC) 2016
- Creating Truly Scalable Game Engines - Console to Mobile (Presented by Imagination Technologies)
- Profiling for Mobile GPUs : GPU 2010
- Next-Gen Tile-Based GPUs : GDC2008
- "Bringing AAA graphics to mobile platforms" GDC2012
- "BRINGING UNREAL ENGINE 4 TO OPENGL" GDC 2012
- Unity: iOS and Android -Cross-Platform Challenges and Solutions : SIGGRAPH 2012
Notes of tile-based GPU
Links
- OpenGL Insights : Performance Tuning forTile-Based Architectures
- Don't alpha that pixel
PowerVR
Mali
- The Mali GPU: An Abstract Machine, Part 1 - Frame Pipelining
- The Mali GPU: An Abstract Machine, Part 2 - Tile-based Rendering
- The Mali GPU: An Abstract Machine, Part 3 - The Midgard Shader Core
- The Mali GPU: An Abstract Machine, Part 4 - The Bifrost Shader Core
- Mali™ GPU Version: 1.0 Application Optimization Guide
Notes of Unity builds scripting
- Unity Builds Scripting: Basic and advanced possibilities
- Build Player Pipeline
- Unityのプロジェクトをコマンドラインからビルドする
- Unityを自動的にビルドする設定にしたときのメモ
Notes of Android Texture compression in Unity
- http://tsubakit1.hateblo.jp/entry/20131003/1380811651
- http://developers.mobage.jp/blog/texture-compression
- https://www.sglabs.jp/unity-android-ios-dev/
- http://unching-star.hatenablog.jp/entry/2013/06/24/095510
- https://shobomaru.wordpress.com/2013/03/24/using-etc1-texture-on-opengl-es/
- http://tsubakit1.hateblo.jp/entry/2016/09/28/235632
- http://dennou-note.blogspot.jp/2014/02/2d.html
- http://8450423.info/qun/unity_optpix_rbga4444/
Notes of Transparent shader in Unity
- Translucent Shader for Unity3D
- Cg Programming/Unity/Translucent Surfaces
- Cg Programming/Unity/Two-Sided Surfaces
- Cg Programming/Unity/Silhouette Enhancement
- Silhouette-Outlined Diffuse
Notes of stylized rendering
Notes of Multi-threads in Unity
- Unity で async/await を使って開発する
- Unityでスレッドを使う
- Unityでスレッドを使いつつUnityAPIを使う Spicy Pixel Concurrency Kit
- Unity非同期処理デザインについて
- Unity でマルチスレッドプログラム
- Unityでマルチスレッド(前半)
- Unityでマルチスレッド(後半)
- 【Unity】 スレッドを使う
- マルチスレッドで高速なC#を書くためのロック戦略
- Unityにてマルチスレッドを使う
- Safe Multithreading in Unity3D.
- Spicy Pixel Concurrency Kit
- Unity3D and C# - Coroutines vs threading