In this presentation we will provide in-depth knowledge about the Unity runtime. The first part will focus on memory and how to deal with fragmentation and garbage collection. The second part on performance profiling and optimizations. Finally, there will be an overview of debugging and profiling improvements in the newly announced Unity 5.0.
This article contains information about performance optimization of Unity3D games for android. Different solutions provided both for CPU and GPU. Also here you can find methodology which will help you to detect performance problems, analyze them and perform appropriate optimization.
Optimization in Unity: simple tips for developing with "no surprises" / Anton...DevGAMM Conference
Every developer once faces the optimization of their project, but sometimes it happens quite spontaneously and at the wrong time. Developers, especially beginners, often ignore very simple and cheap techniques, which allow to make the optimization process more calm and predictable. This work is devoted to the things you should pay attention in developing to avoid inconvenience in future.
Ever wondered how to use modern OpenGL in a way that radically reduces driver overhead? Then this talk is for you.
John McDonald and Cass Everitt gave this talk at Steam Dev Days in Seattle on Jan 16, 2014.
In this presentation we will provide in-depth knowledge about the Unity runtime. The first part will focus on memory and how to deal with fragmentation and garbage collection. The second part on performance profiling and optimizations. Finally, there will be an overview of debugging and profiling improvements in the newly announced Unity 5.0.
This article contains information about performance optimization of Unity3D games for android. Different solutions provided both for CPU and GPU. Also here you can find methodology which will help you to detect performance problems, analyze them and perform appropriate optimization.
Optimization in Unity: simple tips for developing with "no surprises" / Anton...DevGAMM Conference
Every developer once faces the optimization of their project, but sometimes it happens quite spontaneously and at the wrong time. Developers, especially beginners, often ignore very simple and cheap techniques, which allow to make the optimization process more calm and predictable. This work is devoted to the things you should pay attention in developing to avoid inconvenience in future.
Ever wondered how to use modern OpenGL in a way that radically reduces driver overhead? Then this talk is for you.
John McDonald and Cass Everitt gave this talk at Steam Dev Days in Seattle on Jan 16, 2014.
Talk by Graham Wihlidal (Frostbite Labs) at GDC 2017.
Checkerboard rendering is a relatively new technique, popularized recently by the introduction of the PlayStation 4 Pro. Many modern game engines are adding support for it right now, and in this talk, Graham will present an in-depth look at the new implementation in Frostbite, which is used in shipping titles like 'Battlefield 1' and 'Mass Effect Andromeda'. Despite being conceptually simple, checkerboard rendering requires a deep integration into the post-processing chain, in particular temporal anti-aliasing, dynamic resolution scaling, and poses various challenges to existing effects. This presentation will cover the basics of checkerboard rendering, explain the impact on a game engine that powers a wide range of titles, and provide a detailed look at how the current implementation in Frostbite works, including topics like object id, alpha unrolling, gradient adjust, and a highly efficient depth resolve.
Course presentation at SIGGRAPH 2014 by Charles de Rousiers and Sébastian Lagarde at Electronic Arts about transitioning the Frostbite game engine to physically-based rendering.
Make sure to check out the 118 page course notes on: http://www.frostbite.com/2014/11/moving-frostbite-to-pbr/
During the last few months, we have revisited the concept of image quality in Frostbite. The core of our approach was to be as close as possible to a cinematic look. We used the concept of reference to evaluate the accuracy of produced images. Physically based rendering (PBR) was the natural way to achieve this. This talk covers all the different steps needed to switch a production engine to PBR, including the small details often bypass in the literature.
The state of the art of real-time PBR techniques allowed us to achieve good overall results but not without production issues. We present some techniques for improving convolution time for image based reflection, proper ambient occlusion handling, and coherent lighting units which are mandatory for level editing.
Moreover, we have managed to reduce the quality gap, highlighted by our systematic reference comparison, in particular related to rough material handling, glossy screen space reflection, and area lighting.
The technical part of PBR is crucial for achieving good results, but represents only the top of the iceberg. Frostbite has become the de facto high-end game engine within Electronic Arts and is now used by a large amount of game teams. Moving all these game teams from “old fashion” lighting to PBR has required a lot of education, which have been done in parallel of the technical development. We have provided editing and validation tools to help the transition of art production. In addition, we have built a flexible material parametrisation framework to adapt to the various authoring tools and game teams’ requirements.
Game engines have long been in the forefront of taking advantage of the ever increasing parallel compute power of both CPUs and GPUs. This talk is about how the parallel compute is utilized in practice on multiple platforms today in the Frostbite game engine and how we think the parallel programming models, hardware and software in the industry should look like in the next 5 years to help us make the best games possible
Decima Engine: Visibility in Horizon Zero DawnGuerrilla
Download the full presentation here: http://www.guerrilla-games.com/read/decima-engine-visibility-in-horizon-zero-dawn
Abstract: Horizon Zero Dawn presented the Decima engine with new challenges in rendering large and dense environments. In particular, we needed to be able to quickly query a very large set of potential objects to find which should be visible. This talk looks at the problems we faced moving from more constrained Killzone levels to Horizon's open world, and our approach to fast visibility queries using the PS4's asynchronous compute hardware. It also covers our recent work on efficiently collecting batches of object instances during the query to reduce load on the entire rendering pipeline. A basic familiarity with GPU compute will be helpful to get the most out of this talk.
Graphics Gems from CryENGINE 3 (Siggraph 2013)Tiago Sousa
This lecture covers rendering topics related to Crytek’s latest engine iteration, the technology which powers titles such as Ryse, Warface, and Crysis 3. Among covered topics, Sousa presented SMAA 1TX: an update featuring a robust and simple temporal antialising component; performant and physically-plausible camera related post-processing techniques such as motion blur and depth of field were also covered.
Rendering Technologies from Crysis 3 (GDC 2013)Tiago Sousa
This talk covers changes in CryENGINE 3 technology during 2012, with DX11 related topics such as moving to deferred rendering while maintaining backward compatibility on a multiplatform engine, massive vegetation rendering, MSAA support and how to deal with its common visual artifacts, among other topics.
How we optimized our Game - Jake & Tess' Finding Monsters AdventureFelipe Lira
Presentation I gave at Unite Boston 2015. I'll cover a few techniques we used to optimize our Unity mobile game - Jake & Tess' Finding Monsters Adventure
Screen Space Decals in Warhammer 40,000: Space MarinePope Kim
My Siggraph 2012 presentation slides on Screen Space Decals in Warhammer 40,000: Space Marine.
SSD is similar to Deferred Decals, so I focused more on the problems we had and how we solved(or avoided) them
For this year's keynote at High Performance Graphics 2018, Colin Barré-Brisebois from SEED discussed the state of the art in real-time game ray tracing. He explored some of the connections between offline and real-time game ray tracing, and presented some of the open problems. Colin exposed a few potential solutions to those problems, and also proposed a call-to-arms on topics where the ray tracing research community and the games industry should unite in order to solve such open problems.
Presentation by Andrew Hamilton and Ken Brown from DICE at GDC 2016.
Photogrammetry has started to gain steam within the Games Industry in recent years. At DICE, this technique was first used on Battlefield and they fully embraced the technology and workflow for Star Wars: Battlefront. This talk will cover their research and development, planning and production, techniques, key takeaways and plans for the future. The speakers will cover photogrammetry as a technology, but more than that, show that it's not a magic bullet but instead a tool like any other that can be used to help achieve your artistic vision and craft.
Takeaway
Come and learn how (and why) photogrammetry was used to create the world of Star Wars. This talk will cover Battlefront's use of of the technology from pre-production to launch as well as some of their philosophies around photogrammetry as a tool. Many visuals will be included!
Intended Audience
A content creator friendly talk intended for pretty much any developer, especially those involved in 3D content creation. It is not a technical talk focused on the code or engineering of photogrammetry. The speakers will quickly cover all basics, so absolutely no prerequisite knowledge required.
We present the technology and ideas behind the unique lighting in MIRRORS EDGE from DICE. Covering how DICE adopted Global illumination into their lighting process and Illuminate Labs current toolbox of state of the art lighting technology.
In the session from Game Developers Conference 2011, we'll take a complete look at the terrain system in Frostbite 2 as it was applied in Battlefield 3. The session is partitioned into three parts. We begin with the scalability aspects and discuss how consistent use of hierarchies allowed us to combine high resolutions with high view distances. We then turn towards workflow aspects and describe how we achieved full in-game realtime editing. A fair amount of time is spent describing how issues were addressed.
Finally, we look at the runtime side. We describe usage of CPU, GPU and memory resources and how it was kept to a minimum. We discuss how the GPU is offloaded by caching intermediate results in a procedural virtual texture and how prioritization was done to allow for work throttling without sacrificing quality. We also go into depth about the flexible streaming system that work with both FPS and driving games.
Bindless Deferred Decals in The Surge 2Philip Hammer
These are the slides for my talk at Digital Dragons 2019 in Krakow.
Update: The recordings are online on youtube now:
https://www.youtube.com/watch?v=e2wPMqWETj8
Talk by Fabien Christin from DICE at GDC 2016.
Designing a big city that players can explore by day and by night while improving on the unique visual from the first Mirror's Edge game isn't an easy task.
In this talk, the tools and technology used to render Mirror's Edge: Catalyst will be discussed. From the physical sky to the reflection tech, the speakers will show how they tamed the new Frostbite 3 PBR engine to deliver realistic images with stylized visuals.
They will talk about the artistic and technical challenges they faced and how they tried to overcome them, from the simple light settings and Enlighten workflow to character shading and color grading.
Takeaway
Attendees will get an insight of technical and artistic techniques used to create a dynamic time of day system with updating radiosity and reflections.
Intended Audience
This session is targeted to game artists, technical artists and graphics programmers who want to know more about Mirror's Edge: Catalyst rendering technology, lighting tools and shading tricks.
Talk by Graham Wihlidal (Frostbite Labs) at GDC 2017.
Checkerboard rendering is a relatively new technique, popularized recently by the introduction of the PlayStation 4 Pro. Many modern game engines are adding support for it right now, and in this talk, Graham will present an in-depth look at the new implementation in Frostbite, which is used in shipping titles like 'Battlefield 1' and 'Mass Effect Andromeda'. Despite being conceptually simple, checkerboard rendering requires a deep integration into the post-processing chain, in particular temporal anti-aliasing, dynamic resolution scaling, and poses various challenges to existing effects. This presentation will cover the basics of checkerboard rendering, explain the impact on a game engine that powers a wide range of titles, and provide a detailed look at how the current implementation in Frostbite works, including topics like object id, alpha unrolling, gradient adjust, and a highly efficient depth resolve.
Course presentation at SIGGRAPH 2014 by Charles de Rousiers and Sébastian Lagarde at Electronic Arts about transitioning the Frostbite game engine to physically-based rendering.
Make sure to check out the 118 page course notes on: http://www.frostbite.com/2014/11/moving-frostbite-to-pbr/
During the last few months, we have revisited the concept of image quality in Frostbite. The core of our approach was to be as close as possible to a cinematic look. We used the concept of reference to evaluate the accuracy of produced images. Physically based rendering (PBR) was the natural way to achieve this. This talk covers all the different steps needed to switch a production engine to PBR, including the small details often bypass in the literature.
The state of the art of real-time PBR techniques allowed us to achieve good overall results but not without production issues. We present some techniques for improving convolution time for image based reflection, proper ambient occlusion handling, and coherent lighting units which are mandatory for level editing.
Moreover, we have managed to reduce the quality gap, highlighted by our systematic reference comparison, in particular related to rough material handling, glossy screen space reflection, and area lighting.
The technical part of PBR is crucial for achieving good results, but represents only the top of the iceberg. Frostbite has become the de facto high-end game engine within Electronic Arts and is now used by a large amount of game teams. Moving all these game teams from “old fashion” lighting to PBR has required a lot of education, which have been done in parallel of the technical development. We have provided editing and validation tools to help the transition of art production. In addition, we have built a flexible material parametrisation framework to adapt to the various authoring tools and game teams’ requirements.
Game engines have long been in the forefront of taking advantage of the ever increasing parallel compute power of both CPUs and GPUs. This talk is about how the parallel compute is utilized in practice on multiple platforms today in the Frostbite game engine and how we think the parallel programming models, hardware and software in the industry should look like in the next 5 years to help us make the best games possible
Decima Engine: Visibility in Horizon Zero DawnGuerrilla
Download the full presentation here: http://www.guerrilla-games.com/read/decima-engine-visibility-in-horizon-zero-dawn
Abstract: Horizon Zero Dawn presented the Decima engine with new challenges in rendering large and dense environments. In particular, we needed to be able to quickly query a very large set of potential objects to find which should be visible. This talk looks at the problems we faced moving from more constrained Killzone levels to Horizon's open world, and our approach to fast visibility queries using the PS4's asynchronous compute hardware. It also covers our recent work on efficiently collecting batches of object instances during the query to reduce load on the entire rendering pipeline. A basic familiarity with GPU compute will be helpful to get the most out of this talk.
Graphics Gems from CryENGINE 3 (Siggraph 2013)Tiago Sousa
This lecture covers rendering topics related to Crytek’s latest engine iteration, the technology which powers titles such as Ryse, Warface, and Crysis 3. Among covered topics, Sousa presented SMAA 1TX: an update featuring a robust and simple temporal antialising component; performant and physically-plausible camera related post-processing techniques such as motion blur and depth of field were also covered.
Rendering Technologies from Crysis 3 (GDC 2013)Tiago Sousa
This talk covers changes in CryENGINE 3 technology during 2012, with DX11 related topics such as moving to deferred rendering while maintaining backward compatibility on a multiplatform engine, massive vegetation rendering, MSAA support and how to deal with its common visual artifacts, among other topics.
How we optimized our Game - Jake & Tess' Finding Monsters AdventureFelipe Lira
Presentation I gave at Unite Boston 2015. I'll cover a few techniques we used to optimize our Unity mobile game - Jake & Tess' Finding Monsters Adventure
Screen Space Decals in Warhammer 40,000: Space MarinePope Kim
My Siggraph 2012 presentation slides on Screen Space Decals in Warhammer 40,000: Space Marine.
SSD is similar to Deferred Decals, so I focused more on the problems we had and how we solved(or avoided) them
For this year's keynote at High Performance Graphics 2018, Colin Barré-Brisebois from SEED discussed the state of the art in real-time game ray tracing. He explored some of the connections between offline and real-time game ray tracing, and presented some of the open problems. Colin exposed a few potential solutions to those problems, and also proposed a call-to-arms on topics where the ray tracing research community and the games industry should unite in order to solve such open problems.
Presentation by Andrew Hamilton and Ken Brown from DICE at GDC 2016.
Photogrammetry has started to gain steam within the Games Industry in recent years. At DICE, this technique was first used on Battlefield and they fully embraced the technology and workflow for Star Wars: Battlefront. This talk will cover their research and development, planning and production, techniques, key takeaways and plans for the future. The speakers will cover photogrammetry as a technology, but more than that, show that it's not a magic bullet but instead a tool like any other that can be used to help achieve your artistic vision and craft.
Takeaway
Come and learn how (and why) photogrammetry was used to create the world of Star Wars. This talk will cover Battlefront's use of of the technology from pre-production to launch as well as some of their philosophies around photogrammetry as a tool. Many visuals will be included!
Intended Audience
A content creator friendly talk intended for pretty much any developer, especially those involved in 3D content creation. It is not a technical talk focused on the code or engineering of photogrammetry. The speakers will quickly cover all basics, so absolutely no prerequisite knowledge required.
We present the technology and ideas behind the unique lighting in MIRRORS EDGE from DICE. Covering how DICE adopted Global illumination into their lighting process and Illuminate Labs current toolbox of state of the art lighting technology.
In the session from Game Developers Conference 2011, we'll take a complete look at the terrain system in Frostbite 2 as it was applied in Battlefield 3. The session is partitioned into three parts. We begin with the scalability aspects and discuss how consistent use of hierarchies allowed us to combine high resolutions with high view distances. We then turn towards workflow aspects and describe how we achieved full in-game realtime editing. A fair amount of time is spent describing how issues were addressed.
Finally, we look at the runtime side. We describe usage of CPU, GPU and memory resources and how it was kept to a minimum. We discuss how the GPU is offloaded by caching intermediate results in a procedural virtual texture and how prioritization was done to allow for work throttling without sacrificing quality. We also go into depth about the flexible streaming system that work with both FPS and driving games.
Bindless Deferred Decals in The Surge 2Philip Hammer
These are the slides for my talk at Digital Dragons 2019 in Krakow.
Update: The recordings are online on youtube now:
https://www.youtube.com/watch?v=e2wPMqWETj8
Talk by Fabien Christin from DICE at GDC 2016.
Designing a big city that players can explore by day and by night while improving on the unique visual from the first Mirror's Edge game isn't an easy task.
In this talk, the tools and technology used to render Mirror's Edge: Catalyst will be discussed. From the physical sky to the reflection tech, the speakers will show how they tamed the new Frostbite 3 PBR engine to deliver realistic images with stylized visuals.
They will talk about the artistic and technical challenges they faced and how they tried to overcome them, from the simple light settings and Enlighten workflow to character shading and color grading.
Takeaway
Attendees will get an insight of technical and artistic techniques used to create a dynamic time of day system with updating radiosity and reflections.
Intended Audience
This session is targeted to game artists, technical artists and graphics programmers who want to know more about Mirror's Edge: Catalyst rendering technology, lighting tools and shading tricks.
Mathieu Muller, Field Engineer Unity Technologies - Unity 5: Easier, Better, ...How to Web
In this talk, you will see how EASIER it is to build a GUI, create your own physical based shader and mix your audio sources, how a scene can look BETTER with the new global illumination system, how FASTER your applications can be with multi-threaded physics and Metal, and how STRONGER your team and company can be with our profiling tools and upcoming cloud services.
Unity - Internals: memory and performanceCodemotion
by Marco Trivellato - In this presentation we will provide in-depth knowledge about the Unity runtime. The first part will focus on memory and how to deal with fragmentation and garbage collection. The second part will cover implementation details and their memory vs cycles tradeoffs in both Unity4 and the upcoming Unity5.
XPDS13: Zero-copy display of guest framebuffers using GEM - John Baboval, CitrixThe Linux Foundation
The current state-of-the-art in displaying guest video is to copy pixel data from domU memory into a buffer in the device model domain, and then to render the display using something like X, or VNC. The quantity of data copied is partially mitigated by dirty page tracking. However when using the VM to play video or other other tasks that require frequent full-screen updates, copying is a significant drag on system performance and power consumption. By using the DRM subsystem in dom0 on systems with a unified memory architecture, it is possible to make arbitrary pages available for direct scanout by the graphics hardware. The in-kernel graphics drivers make this relatively straight forward and maintainable. This presentation explains how the current display path works, and how to use DRM to improve it.
Data Management and Streaming Strategies in Drakensang OnlineAndre Weissflog
One of my older presentations from the Browser Games Forum 2011 about how we're managing data size optimizations and streaming in Drakensang Online. Absolute asset size number are about 3x..4x bigger today, since the game has grown a lot since 2011.
This indepth session talks about the basic concept of Memory Management and then Garbage Collector. It discusses in detail about .NET implementation of GC and best practice from personal experience
Improving Game Performance in the Browser
with Mickey MacDonald
Presented on September 17 2014 at
FITC's Web Unleashed 2014 event in Toronto
Poor performance is the easiest way to wreck the experience of any game; with web-based games, performance is even more crucial. In this talk, Mickey will discuss the various ways that we can optimize web-based games. He will look at the how the use of WebWorkers can increase performance, as well as tricks to improve load times and audio performance. So join Mickey and learn how to optimize your game to be lightning fast in every browser.
OBJECTIVE
Demonstrate techniques for increasing game performance in browsers
TARGET AUDIENCE
Web-based game developers
ASSUMED AUDIENCE KNOWLEDGE
Basic web-based game development skills
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
Using WebWorkers to increase performance
How to speed up load times
Audio performance techniques
Best practices for graphics compression
Pooling techniques
Lesson 9 - Resisting Temptation Along the Way.pptxCelso Napoleon
Lesson 9 - Resisting Temptation Along the Way
SBs – Sunday Bible School
Adult Bible Lessons 2nd quarter 2024 CPAD
MAGAZINE: THE CAREER THAT IS PROPOSED TO US: The Path of Salvation, Holiness and Perseverance to Reach Heaven
Commentator: Pastor Osiel Gomes
Presentation: Missionary Celso Napoleon
Renewed in Grace
HANUMAN STORIES: TIMELESS TEACHINGS FOR TODAY’S WORLDLearnyoga
Hanuman Stories: Timeless Teachings for Today’s World" delves into the inspiring tales of Hanuman, highlighting lessons of devotion, strength, and selfless service that resonate in modern life. These stories illustrate how Hanuman's unwavering faith and courage can guide us through challenges and foster resilience. Through these timeless narratives, readers can find profound wisdom to apply in their daily lives.
The Good News, newsletter for June 2024 is hereNoHo FUMC
Our monthly newsletter is available to read online. We hope you will join us each Sunday in person for our worship service. Make sure to subscribe and follow us on YouTube and social media.
The PBHP DYC ~ Reflections on The Dhamma (English).pptxOH TEIK BIN
A PowerPoint Presentation based on the Dhamma Reflections for the PBHP DYC for the years 1993 – 2012. To motivate and inspire DYC members to keep on practicing the Dhamma and to do the meritorious deed of Dhammaduta work.
The texts are in English.
For the Video with audio narration, comments and texts in English, please check out the Link:
https://www.youtube.com/watch?v=zF2g_43NEa0
In Jude 17-23 Jude shifts from piling up examples of false teachers from the Old Testament to a series of practical exhortations that flow from apostolic instruction. He preserves for us what may well have been part of the apostolic catechism for the first generation of Christ-followers. In these instructions Jude exhorts the believer to deal with 3 different groups of people: scoffers who are "devoid of the Spirit", believers who have come under the influence of scoffers and believers who are so entrenched in false teaching that they need rescue and pose some real spiritual risk for the rescuer. In all of this Jude emphasizes Jesus' call to rescue straying sheep, leaving the 99 safely behind and pursuing the 1.
The Chakra System in our body - A Portal to Interdimensional Consciousness.pptxBharat Technology
each chakra is studied in greater detail, several steps have been included to
strengthen your personal intention to open each chakra more fully. These are designed
to draw forth the highest benefit for your spiritual growth.
The Book of Joshua is the sixth book in the Hebrew Bible and the Old Testament, and is the first book of the Deuteronomistic history, the story of Israel from the conquest of Canaan to the Babylonian exile.
Exploring the Mindfulness Understanding Its Benefits.pptxMartaLoveguard
Slide 1: Title: Exploring the Mindfulness: Understanding Its Benefits
Slide 2: Introduction to Mindfulness
Mindfulness, defined as the conscious, non-judgmental observation of the present moment, has deep roots in Buddhist meditation practice but has gained significant popularity in the Western world in recent years. In today's society, filled with distractions and constant stimuli, mindfulness offers a valuable tool for regaining inner peace and reconnecting with our true selves. By cultivating mindfulness, we can develop a heightened awareness of our thoughts, feelings, and surroundings, leading to a greater sense of clarity and presence in our daily lives.
Slide 3: Benefits of Mindfulness for Mental Well-being
Practicing mindfulness can help reduce stress and anxiety levels, improving overall quality of life.
Mindfulness increases awareness of our emotions and teaches us to manage them better, leading to improved mood.
Regular mindfulness practice can improve our ability to concentrate and focus our attention on the present moment.
Slide 4: Benefits of Mindfulness for Physical Health
Research has shown that practicing mindfulness can contribute to lowering blood pressure, which is beneficial for heart health.
Regular meditation and mindfulness practice can strengthen the immune system, aiding the body in fighting infections.
Mindfulness may help reduce the risk of chronic diseases such as type 2 diabetes and obesity by reducing stress and improving overall lifestyle habits.
Slide 5: Impact of Mindfulness on Relationships
Mindfulness can help us better understand others and improve communication, leading to healthier relationships.
By focusing on the present moment and being fully attentive, mindfulness helps build stronger and more authentic connections with others.
Mindfulness teaches us how to be present for others in difficult times, leading to increased compassion and understanding.
Slide 6: Mindfulness Techniques and Practices
Focusing on the breath and mindful breathing can be a simple way to enter a state of mindfulness.
Body scan meditation involves focusing on different parts of the body, paying attention to any sensations and feelings.
Practicing mindful walking and eating involves consciously focusing on each step or bite, with full attention to sensory experiences.
Slide 7: Incorporating Mindfulness into Daily Life
You can practice mindfulness in everyday activities such as washing dishes or taking a walk in the park.
Adding mindfulness practice to daily routines can help increase awareness and presence.
Mindfulness helps us become more aware of our needs and better manage our time, leading to balance and harmony in life.
Slide 8: Summary: Embracing Mindfulness for Full Living
Mindfulness can bring numerous benefits for physical and mental health.
Regular mindfulness practice can help achieve a fuller and more satisfying life.
Mindfulness has the power to change our perspective and way of perceiving the world, leading to deeper se
What Should be the Christian View of Anime?Joe Muraguri
We will learn what Anime is and see what a Christian should consider before watching anime movies? We will also learn a little bit of Shintoism religion and hentai (the craze of internet pornography today).
2. Page
Who am I?
• Core developer @ Unity
• Released games
• LIMBO
• Watchmen
• Total overdose
• Unity focus areas
• CPU performance
• Memory optimizations
09-05-2013 2
3. Page
Optimizing your game
• FPS
• CPU usage
(Gamecode, Physics, Skinning, Particles, …)
• GPU usage (Drawcalls, Shader usage, Image
effects, …)
• Hickups
• Spikes in framerate caused by heavy tasks (e.g.
GC.Collect)
• Physics world rebuild due to moved static colliders
• Memory
• Maintaining small runtime memory on device
• Avoid GC Hickups by reducing memory activity
• Leak detection
09-05-2013 3
5. Page
CPU Profiler
• Cpu time consumption for methods
• Mono memory activity
• Remote Profiling of you game running on target device
• Deep profile (editor only)
• Detailed view, but large overhead, only usable for very small
scenes
09-05-2013 5
6. Page
Memory Profiler
• Simple and Detailed memory view (Unity 4.1)
• Detail view is taken as a snapshot (too expensive for per
frame)
• Reference view (Unity 4.2)
• See where an object is referenced – Good for leak hunting
09-05-2013 7
7. Page
Memory Profiler
09-05-2013 8
• Simple memory view
• Unity reserves chunks of memory from the os
• Mono allocates from a reserved heap
• GfxMemory is an estimate
9. Page
Mono Memory Internals
• Allocates system heap blocks for allocations
• Garbage collector cleans up
• Will allocate new heap blocks when needed
• Fragmentation can cause new heap blocks even
though memory is not exhausted
• Heap blocks are kept in Mono for later use
• Memory can be given back to the system after a while
09-05-2013 10
10. Page
Fragmentation
• Memory will get fragmentet if there is a lot of
activity
09-05-2013 11
Mono: 16K System:
64K
Mono: 32K System:
64K
Mono: 32K System:
64K
Mono: 48K System:
128K
11. Page
Avoiding Allocations
• Reuse temporary buffers
• If buffers for data processing are needed every
frame, allocate the buffer once and reuse
• Allocate pools of reusable objects
• Create freelists for objects that are needed often
• Use structs instead of classes
• Structs are placed on the stack, while classes uses the
heap
• Don’t use OnGUI
• Even empty OnGUI calls are very memory intensive
09-05-2013 12
13. Page
Unity Object wrapper
• Some Objects used in scripts have large native
backing memory in unity
• Memory not freed until Finalizers have run
09-05-2013 14
WWW
Decompression buffer
Compressed file
Decompressed file
Managed Native
14. Page
Mono Garbage Collection
• Object goes out of scope
• GC.Collect runs when
• Mono exhausts the heap space
• Or user calls System.GC.Collect()
• Finalizers
• Run on a separate thread
• Unity native memory
• Dispose() cleans up internal
memory
• Eventually called from finalizer
• Manually call Dispose() to cleanup
09-05-2013 15
Main thread Finalizer thread
www = null;
new(someclass
);
//no more heap
-> GC.Collect();
www.Dispose();
.....
16. Page
Assetbundle memory usage
• WebStream
• Compressed file
• Decompression buffers
• Uncompressed file
• Assetbundle
• Map of objects and offsets in WebStream
• Instantiated objects
• Textures, Meshes, etc.
09-05-2013 17
17. Page
Assetbundle memory usage
• WWW www = new WWW(assetbundle_url);
• Loads the compressed file into memory
• Constructs decompression buffers (8MB per file)
• Decompresses the file into memory
• Deallocates the decompression buffers
• One decompression buffer of 8MB is reused and
never deallocated
09-05-2013 18
18. Page
Assetbundle memory usage
• AssetBundle ab = www.assetBundle;
• Loads the map of where objects are in the webstream
• Retains the www WebStream
09-05-2013 19
WebStream
Tex
Tex
Mes
h
AssetBundle
19. Page
Assetbundle memory usage
• AssetBundle ab = www.assetBundle;
• Loads the map of where objects are in the webstream
• Retains the www WebStream
09-05-2013 20
WebStream
Tex
Tex
Mes
h
AssetBundle
Loaded objects
20. Page
Assetbundle memory usage
• Texture2D tex =
ab.Load(“MyTex", typeof(Texture2D));
• Instantiates a texture from the assetbundle
• Uploads the texture to the GPU
• On editor a system copy is retained (2x memory)
• Transferbuffer for the RenderThread will grow to fit the
largest Texture or Vertexbuffer (never shrinks)
09-05-2013 21
21. Page
Assetbundle memory usage
• Deleting the WebStream
• www.Dispose(); // will count down the retain count
• If not called, finalizers will clean the memory eventually
• Deleting the Assetbundle
• ab.Unload(false);
• Unloads the map and counts down the www retain count
• ab.Unload(true);
• Will also force unload all assets created from the
assetbundle
09-05-2013 22
22. Page
Assetbundle memory usage
• Removing the loaded objects from memory
• ab.Unload(true)
• Force unload objects loaded by assetbundle
• UnloadUnusedAssets()
• Unloads when there are no more references to the object
• Use the memory profiler to find remaining
references
• In Unity 4.1 a reason why a Object is given
• In Unity 4.2 specific scripts or Objects referencing a
given object are shown
09-05-2013 23
23. Page
Assetbundle memory usage
• For best memory efficiency do one assetbundle at
a time
• If more assetbundles are needed at the same
time, load one www object into memory at a time, to
reduce decompression buffer usage
09-05-2013 24
25. Page
Conclusions
• Avoid memory activity
• Use the memory profiler to monitor memory usage
• Load one WWW object at a time
• Use Dispose() on objects that derive from IDisposable
• Specially if they have a large native memory footprint
• Use UnloadUnusedAssets() to clean up assets
09-05-2013 26
Hi, My name is Kim Steen Riber, and will talk about memory profiling in Unity
I work at unity as a core developer. Before joining Unity I worked on a number of games:At unity I focus primarely on Performace and memory optimizations and making tools to give you the ability to make your games as performant as posibleAnd I like my LEGOs
There are several things you want to adress when optimizing your game. The obvious one ofcourse is Frames per second. This is where the user gets the smooth experience of a game that runs 30 or 60 fps. There are two limiting factors to this, namely The time the game takes on the cpu: that would be things like your gamecode, physics, skinning and other tasks that run on the cpu side. Then there is the gpu side, where things like drawcalls, shader complexity and fillrate matter. Your game will never run faster than the limiting of the 2.One other thing that can degrade the user experience is if the game has a lot of hickups. This will make the game feel stuttering. Things that can cause hickups are long running tasks like garbage collect or physics world rebuilding if for example a static collider is moved.Also memory is an imprtant thing to keep in mind when developing your game. There are 2 main reasons for this: Keeping the runtime memory low, to avoid out of memory – specially on mobile devices, and keeping the memory activity low, to avoid the garbage collecter to kick in
In unity pro we have a tool for this: the unity profiler. This has several focus areas, but I will only talk about the cpu and memory profiler.In unity 4.1 and 4.2 we have added exended functionality to get a more detailed view of your memory usage
The Cpu profiler will let you see the time consumption for each frame. This is displayed in a hierarchy view and can be sorted with the most timeconsuming methods at the top. This will allow you to pinpoint where you should focus your efforts when optimizing. Ther is also a column that tells how much mono memory is allocated by each entry in the profiler. I’ll get to that later.The profiler has the ability to connect to a running player on a device or on your computer. This allows you to profile the actial running game on for example an iphone or in the webplayer. This is done using the dropdown at the top ‘Active Profiler’In the editor you also have the ability to turn on deep profiling. This will instrument all calls in managed code, and will give you are more detailed callgraph. This however has a large performance overhead, so is only feasible on small scenes
The GPU profiler will measure the time taken by individual drawcalls, and lets you drill down into the hierarchy to find the most timeconsuming calls. As with CPU profiling it is best to record the profile when running on device, since the overhead caused by the editor can be significant.
In Unity 4.1 we have made some improvements to the memory profiler which lets you inspect memory at a much finer level than before. There is a simple view and a detailed view. The detailed view is expensive to calculate, so this is implementet as the ability to take a snapshot of the curent state.The detail view will show a list of UnityObjects like Assets and Scene objects, and will also have a calculation of some core areas of unity, like webstreams, mono managed heap, shaderlab and many more.This view will allow you to find memory consuming objects like an uncompressed or excesively large texture acidently added to your game, and focus your efforts on reducing these.In Unity 4.2 we have also implemented a reference view, which allows you to see where a given asset or gameobject is referenced from. This can help you in finding why an asset is not unloaded, by pinpointing where a script is holding a reference to it.
The simple view in the memoryprofiler shows some key numbers in the used memory.It has the Used size and the reserved size of varrious parts of the engine. Both mono and Unity reserves blocks of memory ahead of time and then allocates the requested bytes from these.The GfxDriver usage is based on an estimate calculated from when textures and meshes are uploaded to the driver.
As you could see on the simple memory profiler, The memory in unity is split up in managed and native memory.The managed memory is what is used from Mono, and includes what you allocate in scripts and the wrappers for unity objects.This memory is garbage collected by monoThe native memory is what Unity is allocating to hold everything in the engine. This includes Asset data like tex, mesh, audio, animation. It includes gameobjects and components, and then it covers engine internals like redering , culling, shaderlab, particles, webstreams, files, physics, etc….This memory is not garbage collected, and sometimes needs the UnloadUnusedAssets method call to be freed.
The managed memory used by mono reserves a block of system memory to use for the allocations requested from your scripts. When the heapspace is exhausted, mono will run the garbage collecter to reclaim memory that is no longer being referenced.If more memory is needed mono will allocate more heap space. This will grow to fit the peak memory usage of your application. The garbage collection can be a timeconsuming operation specially on large games. This is one of the reasons to keep the memory activity low.Another reason is that with high memory activity, memory is likely to fragment and the small memory fragments will be unusable and cause memory to growWhen the memory is being freed, mono can in some cases give the heap space back to the system, although this is less likely if memory is fragmentet
So the basics of fragmentation, is that, if there is a lot of allocations where some are retained and some are deleted, memory will get filled with small holes. This will look like free memory, but when trying to make a larger allocation, there is not enough contiguous memory to service that request. This means that mono will have to allocate more heap blocks even though it seams like there is enough free space.
Even though scripting happens i a managed language like C#, there are a number of ways to control the memory and reduce the amount of allocations made by your code.If there are routines in your code that needs some temporary buffers to process data, it is worth considdering to keep these buffers around instead of reallocating them every time the routine is run.Another thing to considder is creating object pools if temporary objects are shortlived and needed often. An example of that could be bullets that are short lived. Having a pool of bullets and then grabbing one when needed and putting it back when done, it will save both the object instantiation and will reduce the allocation activity.A Third thing to considder is using structs instead of classes. When using structs the data is allocated on the stack instead of the heap.Also. Don’t use OnGUI since the GUIUtility will kick in.These are all things that will reduce the memory activity, and thereby reduce the need for garbage collections and fragmentation
This is a small example where on the left side we have a script that needs a databuffer to process some data. It is written without regards to memory usage, as you can see it uses a class for the workdata, and the workbuffer in here is allocated every time the function runs.On the right side, is a version where the Workdata is a struct, and the workbuffer is placed on the class in order to only allocate it once and then reuse the same buffer.On the CPU profiler you can see how the Mono memory usage is excesively high in the allocating script and how a lot of time is used to allocate the workbuffer.In the non allocating script, no memory is allocated, and the script takes no time – like it should since there is not real work done.
Some objects that you can allocate in scripts have large native memory footprints in unity. An example of that is the WWW class which in mono is only a small wrapper, but in Unity it contains some very large allocations. This backing memory is not cleaned up until the finalizers are run, or Dispose is called manually. If this is left to the garbage collector and the finalizers, this memory can potentially live long after the reference is removed from mono.
So the way the garbage collector works is shown here.A reference is removed from mono by setting the reference to null or the object going out of scope. After a while the garbage collector will run, either because the heapspace gets exhausted, or because we manually call GC.Collect()When the memory is collected by the garbagecollector, it is put on a queue for the finalizer. This is handled by another thread, and eventually the finalizer will call Dispose on the object. At this point the unity native memory will be deallocated.To skip this roundtrip, you should call Dispose manually on the object, and then the object will not be given to the finalizers and the memory will be cleaned up imediately. I have a small example that shows this
Garbage collect / Dispose DEMODEMO:Load www, set to null and notice a quick releaseIncrease heap and do the same. Notice memory will not decrease.Use detailed view to show that webstream is still around Do GC.Collect and see memory dropLoad www and use dispose. See that memory drops
When using asset bundles, it is important to know what memory unity has allocated at various stages.For the webstream data there are several buffers depending on the settings of the stream. If it is a compressed stream loading from disk, it will have these buffers: The compressed file, some decompression buffers used by lzma, and the final uncompressed data.The assetbundle created from this www object, allocates a map of objects in the assetbundle and offsets in the decompressed data.When loading objects from the assetbundle, these objects will be created in memory from the decompressed data
When you have your assetbundle url or file, you can load this file asynchroniously by calling new WWW(). This will load the compressed file into memory and start the decompression. The decompression algorithm will need some buffers and these will require a buffer of 8MB. The decompression will construct the unpacked data and after it is done it will deallocate its decompression buffers.To avoid that the 8MB decompression buffer is reallocated for every file being loaded, we keep one buffer in memory that we reuse.Keep in mind that several parallel loads will require more of these buffers to be allocated simultaneously and will result in a large memory spike. To avoid this, load one file at a time instead of starting multiple www requestsFor Assetbundles created with Unity 4.2 we have changed the compression a bit, which has reduced the decompression buffer requirements to half a megabyte instead.
After the file is loaded, you construct the assetbundle from the file by calling www.assetBundle.This will load the map of objects and what offsets they have into the decompressed data. The assetbundle retains a pointer to the WebStream. This will prevent the data from being unloaded even if Dispose is called on the www object.
When objects are loaded from the assetbundle, the data from the webstream is used to construct the requested objects. The assetbundle will hold references to these object.
To loadobjects from the assetbundle, use the Load, LoadAll or mainAsset methods.In the example I will show later, I will load a texture. This will instantiate the texture from the assetbundle data. Then the texture is uploaded to the gpu, and on player builds the main data is then deallocated.On platforms that use our multithreaded renderer the texture is trasfered to the renderthread and the transfer buffer will grow to fit the texture data – I will show that later
When all objects you need have been loaded from the file, you can get rid of the webstream data and the asset bundle.The www object should be deleted by calling Dispose, and not left for the garbage collector to clean up.As long as the Assetbundle is still around, the webstream will not be unloaded, so the assetbundle needs to be unloaded as well, in order to release its handle to the webstream.Unloading the assetbundle can be done by calling unload with either true or false.Calling it with false will release the webstream and delete the map in the assetbundleIf you instead call unload (true) the assetbundle will travers its list of loaded objects and destroy these as well. If there are still references to these objects in scripts, these will be null after this.
When you are done using your assets, you can unload them by still having the assetbundle and calling unload(true) or you can call UnloadUnusedAssets and all assets that are no longer being referenced will be removed from memoryIf an object is not unloaded when calling unload unused assets, it is because it is still being referenced. In the profiler in unity 4.1 you will be able to see if the object is referenced from script or if it for example is marked as HideAndDontSaveIn unity 4.2 we have added additional functionality, so you can see what other objects are holding a references to your object. This should help you to find the references and unload the object
So the most memory efficiency way of loading assetbundles is, If posible, to load just one assetbundle at a time, load what is needed and destroy the assetbundle again. Here is a small example that loads a texture from an assetbundle and when this coroutine exits, both webstream and assetbundle is unloaded and there is no other memory left except the instantiated texture.To, later on get rid of this texture, set the reference to null and call UnloadUnusedAssets.
I have made a small example that shows the assetbundle loading and unloading, and how you can use the memory profiler to see what is happening and what memory is allocated. This is demoed on Unity 4.2 as this has some extra features, that I would also like to show you.DEMO:Load new(unity4.2) www. Notice mem increases. Dispose removes all memory againLoad old(pre 4.2) www. After dispose, there is +8MB left. Use detail view to investigate, and sow the cached buffer.Load www, ab and texture. Detail view – show webstream, assetbundle and texture. Notice the gfxClientBuffer.Dispose www -> nothing happens, because ab has retained handle.Unlead (true). See mem falls to 40MB -> gfxClient and cached decompression bufferLoad all. Unload (false) and Dispose().See detail ->Tex referenced by scriptSet tex= null see that nothing happens. See tex still in detail view, but not referencedCall unloadUnusedAssets. See gfx memory go down and tex is gone from detailed