Hacker News new | ask | show | jobs
by daenz 3942 days ago
> I wonder if the big ones like unreal, unity and crysis are going to collapse sometime under their own weight...How are they even adding all those new features without breaking stuff all the time? This is what impresses me most.

I haven't looked at their code, but I would bet they have fantastic regression tests. Something I've added to my own engine in the past year is "pixel perfect" tests: for a given test scene employing specific effects (soft shadows, reflections, refraction, etc) the renderer should produce an image that is a pixel perfect match with a known correct image. If you begin optimizing shaders and rendering code, regressions are caught very quickly, in an automated way. Sometimes the images are close enough to be acceptable (for example, if an optimization changed floating point precision, resulting in a color that is a shade different). In that case, the test fails, and you can replace the test image with your new rendered image, after you've vetted that it "looks correct" manually.

It's not anywhere close perfect in testing all code paths, but the payoff is rather large for the effort put into creating the test.

2 comments

Things get interesting when the number of possible code paths increase. One such beast is the Unity Standard Shader. There are dozens of combinations depening on Metallic/Specular PBR, Multi-Texturing, Shadows, Light Types, Light Baking, Forward/Deferred Rendering and so on. Combine this with different backends (OpenGL, OpenGL ES, DirectX, Vulcan) and graphic card abilities and at some point adding new stuff gets quite complex.

I guess they simply throw money and play testers at this problem. (Unreal probably more so than Unity) But how long can you scale this up?

In iOS they're called snapshot tests.