Questions tagged [optimization]

The process of modifying software to make some part of it work more efficiently or use fewer resources. Generally, this means it executes more rapidly, or will require fewer resources.

72 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
1 answer
565 views

On Android, How can I avoid FPS drops during sensor listener setup/tear down?

When I open my Android app after 5 or 10 seconds it sets up the sensor listener, during which I see clear stuttering and the FPS drops for a second to 40 instead of 60. Is there a way to avoid this? ...
Timothy's user avatar
  • 191
6 votes
1 answer
3k views

How do I reduce overdraw in a forest scene with lots of foliage?

Unity comes with an overdraw view that looks something like this: We've probably all seen it, and have probably been advised to check for overdraw. How do you go about actually doing anything about ...
eclmist's user avatar
  • 1,153
4 votes
0 answers
677 views

Rendering hundreds of animated characters in Unity3D

I am currently doing some research in anticipation of the development of a game where there are going to be hundreds of secondary entities which will interact with the player and among themselves (...
Marc Jacob's user avatar
3 votes
0 answers
184 views

Are GPU drivers hand optimized for specific games using low-level APIs?

The GPU drivers often have slightly different behavior depending on game or program, which is using them. It optimizes performance, bypasses bugs and improves overall experience in popular games, ...
CodeSandwich's user avatar
3 votes
0 answers
534 views

Pre-Hash Input Strings in Unity

So with the new Animator system, Unity has smartly allowed us to pre-hash the strings for looking up variables within the Animator state machine, using the Animator.StringToHash static method. This ...
Ecksters's user avatar
  • 131
3 votes
0 answers
213 views

MeshMemory causing constant spikes

I have a ready-to-launch application, cleaning everything right now. I have these strange spikes on Mesh Memory. The best part of it is that this view below is ...
Jacob's user avatar
  • 2,532
3 votes
0 answers
112 views

android unity game optimisation

I'm finishing my game, i'm in the stage of optimisation, i tried multithreaded rendering and dynamic batching, with OpenGLES3.. i get a little bit increase , but now i'm getting function Clear take ...
أيمن تليلي's user avatar
3 votes
0 answers
586 views

Add Rigidbody and MeshCollider at runtime : is it a bad practice?

Good day. To simulate an explosion of a vheicle, I decided to do this: When I need to explode veichle , at runtime, i add rigidibody for every single part of veichle (5-10 part: door, wheel, hood ...
stighy's user avatar
  • 427
3 votes
0 answers
185 views

Recognize pattern in 3D building environment

I'm currently developing 3rd person building game (as bacheleor thesis). I need to recognize constructed patterns co I can mark corresponding structure as some building (so player can start using that ...
Pavel Pája Halbich's user avatar
2 votes
0 answers
523 views

Optimal solution to render sprites with transparent edges in Unity

Since I'm currently developing a 2D game for mobiles, overdraw and drawcall count is my first priority in the design of the application I've thought initially to split each sprite in two parts: one ...
Row Rebel's user avatar
2 votes
0 answers
78 views

compiler optimixation interfering with threaded function

I'm making a block game in c++ that stores voxels in a octree and because, at least in my implementation, editing the octree is slow, I'm generating the chunks of land in a separate thread. I manage ...
Ben Beazley's user avatar
2 votes
0 answers
286 views

Improving effect performance in XNA

I'm making a 2D, top-down platformer, in which four or five layers are rendered each time the game draws. Everything is fairly performant except for the bottom layer, which is the game map. This is ...
Brian Gradin's user avatar
2 votes
1 answer
2k views

Unity Grid Layout causing multiple draw calls

We are developing a game in Unity 4.6.6 for both Android and iOS. Currently I am building the game UI with the new Unity UI system. In particular I am building a button list to create kind of ...
VicM's user avatar
  • 121
1 vote
0 answers
134 views

How to implement MLAA (like SIMD-based approach by Intel)?

I'm looking for previously available public source code sample what was originally posted here https://www.intel.com/content/www/us/en/developer/articles/code-sample/morphological-antialiasing-mlaa-...
Tim's user avatar
  • 11
1 vote
0 answers
42 views

How to quickly traverse bi-directional nodes without repetition?

I want to optimize a bidirectional node traversal algorithm. Because the node is bidirectional, it may cause an infinite loop. The current algorithm uses memory records. However, memory writing will ...
noodle_run's user avatar
1 vote
0 answers
272 views

Tilemap vs terrain vs optimized mesh for top-down game

I'm experimenting with a top down vertical scroller in Unity, with a perspective camera, NOT orthogonal. (It's unclear how 'pixelated'/pixel art I will want the graphics but that's another question) ...
James Carlyle-Clarke's user avatar
1 vote
0 answers
912 views

Untracked memory in Unity's Profiler

I am working on doing a memory optimization pass on a fully developed game on Unity2021.3.16f1. I am trying to figure out what's the pain point and for that, I need help. Before sharing the profiler I'...
Syed Munim Raza's user avatar
1 vote
0 answers
161 views

What are the limitations or downsides of using Procedural Textures extensively?

Are there negative consequences to making heavy use of 'procedurally generated textures' in Unreal Engine 5, as opposed to normal textures? I found some info in the docs that it 'saves memory', but ...
Candle's user avatar
  • 141
1 vote
0 answers
173 views

Z-Fighting mitigation performance overhead

Which of following approaches will have less performance overhead(using threejs renderer)? I am currently have an issue with z-fight for distant objects, while my near/far plane is already set to most ...
Dmytro Brazhnyk's user avatar
1 vote
0 answers
2k views

Difference between putting shaders in "Always Included Shaders" vs "Preloaded Assets"

I am developing an mobile AR application with Unity AR Foundation. After a successful android build, I was told one of the shaders was not found. ShaderNotFoundException: GLTF/PbrMetallicRoughness ...
姚一帆's user avatar
1 vote
0 answers
200 views

Basic 2D Lighting Optimization Issue in Fragment Shader with OpenGL (GLSL)

I'm using a fragment shader to implement 2D lighting (code further below). Even though I am satisfied with the visuals of the light i noticed that it has a quite big GPU usage, and when trying to add ...
BananaFructa's user avatar
1 vote
1 answer
234 views

Camera animation stutters on first launch

The camera stutter for a fraction of a second when animating a camera from one position to another position. This issue only happens when the game is launched for the first time after installation. ...
Naresh's user avatar
  • 129
1 vote
0 answers
2k views

Optimizing falling sand simulation

So, for the past couple of weeks, I've been working on a falling sand simulation inspired by games such as The Powder Toy, Noita, and Sandspiel. I've been making it in Love2D and I'm please with what ...
Garflington's user avatar
  • 1,055
1 vote
1 answer
332 views

Optimizing spawning 500 objects every 3 seconds

Using Object Pooling, assuming I'll like to spawn 500 cubes once every three seconds. How do I make it performance friendly? I need ideas, not the code itself.
Gozmetaiemax's user avatar
1 vote
0 answers
99 views

What are the pros and cons of using larger tiles in a 2d game with freely placed entities?

I am working on a 2d game with the Godot Engine and I'm about to start drawing the tiles for the ground tileset. These will be used solely for the purpose of painting the ground because the trees, ...
user9564371's user avatar
1 vote
0 answers
399 views

How to make effective permament rubble in a voxel game made in Unity3D?

I'm working on a semi-voxel game, and I already optimized the voxel structures' meshes by combining and chunking them. When I destroy a voxel, I spawn a low poly voxel fragment, with a rigidbody and ...
Tudvari's user avatar
  • 731
1 vote
0 answers
44 views

Optimization of linear solving for small matrices (10x10)

How to optimize the hell out of linear system solving for small matrices (10x10)? This would be used in an AR engine for a few games, but has to be done very fast. This solver is to be executed in ...
rfabbri's user avatar
  • 111
1 vote
0 answers
44 views

string[] preallocation to prevent using ToString() and save memory

I have some levels, with enemy waves and two Text components for: Enemies killed, like: "13/57" Waves passed, like: "68" On each enemy kill/new wave, I make a <...
Jacob's user avatar
  • 2,532
1 vote
0 answers
45 views

Unity inconsistent memory profiling when running same scene

I'm in the making of a 2D silhouette style game where I'm trying basically 2 setups: One where it consists only of sprites, One where it consists of a mix of sprites and meshes with NO texture. Now,...
agiro's user avatar
  • 269
1 vote
0 answers
2k views

Best way to reduce texture size and ensure a minimum quality

We've been working on this mobile game for about a year now, and we're very close to the end but we've started to face many problems. Mainly, our game crashes and has a huge size for a 2D game (on ...
alaslipknot's user avatar
1 vote
0 answers
628 views

Why does occlusion culling have a negative performance impact on Gear VR in Unity 5.4.03f?

I am making a GearVR game using Unity 5.4.03f and Oculus Utilities for Unity 5. I have problem with Occlusion Culling. I've set appropriate objects as static and baked the data. The culling works ...
K.L.'s user avatar
  • 795
1 vote
0 answers
1k views

Why does reverse depth buffering provide more precision? (with DXGI_FORMAT_D24_UNORM_S8_UINT Datatype layout)

I lately came around methods optimizing the use of the depth buffer, as the easiest solution reverse depth buffering is mentioned but I cannot wrap my head around why I would be gaining a better depth ...
user5716904's user avatar
1 vote
0 answers
111 views

How can I represent collection of distant but visit-able stars while using minimal resources?

I have recently started to plan a project in Unity that will be for Android. I have a database that consists of over 150,000 stars (may trim this down if I/O cripples the overhead). The game will ...
MarsYeti's user avatar
  • 135
1 vote
0 answers
126 views

Mobile game: Optimization only working on some devices / Render big texture causes stuttering after level load

I'm currently optimizing the rendering of the background of my mobile game. The background consists basically of many colored dots. Since the background is static I'm able ro render the whole ...
creiser's user avatar
  • 111
1 vote
0 answers
346 views

How can I use a SharpDX.Toolkit.Game in multiple WPF controls?

I've implemented a Game class in a WPF app. It works and the animation renders. I have task to implement another several Controls with SharpDX in the same application window. Each new Game object ...
Andrzej's user avatar
  • 111
1 vote
2 answers
1k views

Switched from immediate mode to VBOs, game runs slower

I'm trying to improve the draw performance on my c++, OpenGL, SDL game. Back in school we ...
Dylan's user avatar
  • 61
0 votes
0 answers
28 views

`textSubImage2D` inconsistent performance

I have a problem when creating a texture with WebGL. The thing that I do not understand is that the first call with texSubImage2D with a canvas leads to the ...
hoangphatmonter's user avatar
0 votes
1 answer
34 views

How do I go about Mesh Simplifcation in generating multiple LODs?

I have been recently looking for any information on creating multiple LODs (level of detail) for an inputted mesh. However, there does not appear a lot of articles or pseudo code on how to go about ...
Noah Williams's user avatar
0 votes
0 answers
133 views

How Virtual Textures work?

I'm trying to understand how Virtual Textures work. After coming across this post: https://discourse.threejs.org/t/virtual-textures/53353 And more research here: https://docs.unity3d.com/Manual/...
Miguel Myers's user avatar
0 votes
0 answers
708 views

Is there a way around using yield return null for coroutines to avoid waiting an extra frame at the end of my coroutine?

I've gotten used to using coroutines as a way to ensure a things are done sequentially in my code, i.e. instead of calling method a, method b, and method c on back to back lines I will sometimes yield ...
Kyle34562345's user avatar
0 votes
0 answers
62 views

Is there any benefit of combing Instance Meshing with quadtrees LoD?

I would like to know if there would be any benefit of combing Instance Meshing with quadtrees LoD? Besides the obvious performance improvement of only having one mesh I wanted to try and implement ...
Miguel Myers's user avatar
0 votes
0 answers
242 views

How much grass can Unity's terrain system handle performantly, and are there any optimizations?

[Unity 2021.3.0f1] I'm making an open world game, and I'm creating the open world using the Unity terrain system. My grass model is very simple, the prefab being 4 planes with a grass texture on each ...
Ross Lazenby's user avatar
0 votes
0 answers
44 views

Usefullness of a manual vertex shader optimization?

After having implemented a texturecube RGBA16F to generate shadows for 4 pointlights in one pass (forward shader), I've compared with array[4] of textucube R16F and with texturecuberarray with 4 ...
philB's user avatar
  • 129
0 votes
0 answers
473 views

Unity - determine if textures are not used, such as "blank" normal texture and black occlusion texture etc

To try to optimize for runtime load of arbitrary 3D models, many of which have "fake normal textures" (basically, just a flat shade of purple - does not really add much to the look), how do ...
ina's user avatar
  • 294
0 votes
0 answers
318 views

Unity - Creating a plane that you can deform on runtime creating a path

So I'm doing this project which is similar to Castle Raid (https://youtu.be/ZiAv1smyCKM) And I'm having trouble implementing the path creation by deforming a mesh and making the players move on it. I ...
WILO's user avatar
  • 31
0 votes
0 answers
59 views

Is it optimal to use UI Canvas for a 2D platformer background?

Using UI Panel component is convenient in the sense that the panel will always be stretched to the size of the screen at any resolution, unlike a sprite (in simple mode) the size of which depends on ...
Serg's user avatar
  • 383
0 votes
1 answer
389 views

Improve cube rendering performance in lwjgl

I've been coding a minecraft-like game in lwjgl using cubes. I've reached a point where I can render 6 chunks of blocks before it starts lagging. I've searched online for optimizations and one of the ...
xGolden's user avatar
0 votes
0 answers
155 views

Solution for efficient time-keeping in Javascript games?

I'm developing a real-time browser roguelike using an ECS and currently I'm unsure of how to handle time. As of right now, whenever I need the current time, I just call ...
Ryan Peschel's user avatar
0 votes
0 answers
470 views

SDL2 - Updating part of a texture is slower than updating all of it

I'm programing a kind of cellular automaton in which each pixel is an automaton. I'm using a SDL2 streaming texture with the SDL_LockTexture() and ...
Alex CB's user avatar
  • 376
0 votes
0 answers
79 views

How to optimize Floor Meshes with different material in unity

I have several meshes (floor tiles) that consist of unique materials as they have different textures. I see that it is taking too many batches and it has around 100m vertexes. Is there any way to ...
Muhammad Faizan Khan's user avatar