Skip to main content

Featured

Learning To Work With Python Frameworks: FLASK vs DJANGO

                 Image:  https://www.bitcot.com/flask-vs-django/ Breakdown I had experience building with Python and other APIs, but I’d never worked with a web framework. I wanted to learn how a full-stack web application fits together, so I learned two of the most popular Python ones: Flask first, as the small and simple option, then Django, as the larger one with more built in. This post breaks down what I learned from each, and how they compare. Tools Python 3.14 VS Code Virtual Environments Flask Django The Use Cases For Each Flask Built for simple projects, with a small core and a minimal set of features. Easy to install and quick to get started with. Fast and lightweight, but not designed for high-workload projects. Built on a synchronous model, so each worker handles one request at a time. Handling several requests at once means running multiple workers or threads. Best for quick projects and prototyping, like getting a ...

Level Optimisation: Using Relooted's "Convince Fred" Level To Demo Key Aspects


Breakdown

Levels were dressed in phases. The first stage was macro dressing, which covered the gameplay elements and the level blockout. Stage two revolved around micro dressing, which is where the detail began breathing life into the level. Working in any agile environment with deadlines to meet, this is also where iterations and minor changes start compounding technical debt, whether artistic or technical: a small change here, an update there, a rework of something. The flip side of the agile method is that it becomes harder to lock in changes, and by extension some optimisation techniques, without spending too much time on them. After optimising a few levels from the vertical slice through to the final product, I noticed several recurring issues that I now look out for going forward. After optimising a few levels from the vertical slice through to the final product, the same problems kept turning up, and these are the ones I now check first.


Key Things I Look For When Optimising


Dynamic Shadows & Lights

Technical Bottleneck: Every dynamic light is calculated in real time, every frame, and a dynamic shadow means the scene’s geometry is rendered again from that light’s point of view. The cost scales with both the number of lights and the amount of geometry in reach of each one. A few lights placed during dressing can quietly multiply the cost of every mesh they touch.

Approach: Look for dynamic lights first, and always look for dynamic shadows. This level was no different. I kept some dynamic lights in the player space, swapped others for stationary lights in areas with a lot of lights, and set everything in the background to static or disabled its shadows completely. The type of light mattered too. Omni lights get expensive because they light in every direction, so I swapped them for spotlights, which keep the light inside a cone and let me control light overlap and the areas lit. That’s the whole point of intentional light usage.


LODs

Technical Bottleneck: The GPU processes every vertex on every visible mesh on every frame. Without an LOD chain, a 50,000 polygon hero asset in the background costs the same as it does in the foreground. The vertex pipeline has no awareness of whether a polygon contributes to visible detail or is entirely lost in noise at the player’s viewing distance.

Approach: Creating LODs was one of the most overlooked processes during level dressing, yet it felt like a free performance layup. Every mesh needs an LOD chain, no exceptions. Hero assets need a minimum of three LODs, and small props need at least four, with the minimum LOD set to LOD 01. The absence of LODs started compounding during micro dressing & iteration, so a standardised approach to LODs for assets of different priorities was key.


Mesh Batching & Instancing

Technical Bottleneck: Every separate mesh submitted to the GPU costs a draw call, and those add up quickly. Rendering is most efficient when similar meshes are drawn together, referencing the original mesh & material instead of being submitted again for every copy. This was a common diagnosis across all levels, which made it an easy performance win to look for on the levels I was responsible for.

Approach: As a former artist, I understand why we want to make everything perfect & bespoke. Once you understand how things render on screen, you quickly realise that a player might not notice all that effort during gameplay. For the sake of performance, we batch and instance similar meshes to reduce draw calls.



Foilage

Technical Bottleneck: Foliage itself wasn’t the issue. It became one when it was spread across the whole level and every instance also carried shadows, whether dynamic or baked, on top of the draw call cost of batching & instancing. This was one of the biggest culprits in the levels I optimised. There were instances where the level would crash instantly when loaded from the previous level, simply because of the amount of data loaded into an 8GB VRAM GPU, which was the ceiling for max settings.

Approach: My approach was to batch a lot of the background foliage, disable all shadow casting, and start the initial LOD lower than LOD0. For everything in the foreground, shadows were set to static to still maintain some artistic integrity.

 

Textures Sizes & Number of Texture Samples

Technical Bottleneck: Every texture sample in a shader requires the GPU to fetch data from memory. Because memory is physically separate from the shader processors, each fetch introduces a potential stall while the processor waits for the data to arrive. Texture bandwidth is one of the most common GPU bottlenecks. Depending on screen presence, a 2K texture was rarely necessary.

Approach: My thought process was to cap standard materials at four to six texture samples by packing any black and white textures into the RGB channels of a single texture. Complex shaders with more than six high-resolution textures were reserved for hero characters. Textures were imported at 2K, then mipped down by type: normals to half of that (1K), base colour to a quarter (512), and ORMs (occlusion, roughness, metallic) to an eighth (256).


Material Translucency, Number of Materials per Asset & Texture Sampling

Technical Bottleneck: Opaque surfaces use depth testing. If a closer surface has already written to a pixel, the GPU skips anything behind it. Translucency breaks this, because translucent surfaces don’t write depth, so the GPU must evaluate every layer to blend them correctly. This forces a separate render pass and means every translucent pixel is evaluated, regardless of any other translucent layers in front of it. On a large surface, this can roughly double or triple the pixel shader workload for that screen area.

Materials add to the cost in two ways. Every material slot on an asset adds a draw call, and every texture sample inside a material adds a memory fetch and more shader instructions. Fewer texture samples means fewer instructions, which is why the sample cap from the previous section matters here too. Stack these on top of translucency and the performance hit can start snowballing, which is why batching to reduce draw calls is important.

Approach: Default to Opaque for everything solid, then use Masked for cutout geometry like foliage, fences & hair. Translucency should be reserved for effects where it is genuinely necessary, and screen coverage kept as small as possible. With this in mind, optimisation should have begun in DCC (digital content creation) packages. Assets got a second material slot only if part of them was meant to be tiled, and in those cases we would sometimes skip texturing in the DCC package and apply a pre-existing tileable material in the engine instead.


What I Learned

My biggest takeaways were, funny enough, that being an artist helped me predict what other artists would probably do, and that the job was also about enforcing the standards we set and improving my soft skills. Even before opening Unreal Insights, I could make educated guesses about what the problem might be, and by the time Insights was open, it was confirmation most of the time. On top of that, having to justify why something looked “worse” was a constant teacher, because it forced me to break down my entire thought process. If anything, the technical side is never the scary part once you understand optimisation principles. 


Conclusion

Across this level and the others I worked on, optimising once you understand the principles felt like the easy part, while maintaining the artistic vision was generally the hardest. I had to keep the artistic vision in charge, because it was easier to gain performance at the expense of the art direction. The real challenge is optimising the bells & whistles without destroying the artistic integrity.



Comments