14 ms·
How Unreal Renders a Frame
- RoboTeddy 9y agoSheesh. How many engineer-hours have gone into Unreal?
- krige 9y agoA hell of a lot, the engine itself was in development for around three years IIRC
- onion2k 9y agoAnd that was from 1995 to 1998. It's had a lot of energy spent on it since then. It's an incredible piece of tech.
- Nition 9y agoAccording to the Wikipedia page at least, even just the current version (Unreal Engine 4) has been in development for 14 years now! With 2003-2008 apparently being just Tim Sweeney.
- visarga 9y agoI have high expectations from simulation. I hope they will be able to reach 99.9% realism so we can use it to recreate any situation we want, for fun (games) and profit (pre-training robots). <rant>Self driving cars already train on simulated roads because that allows the creation of any scenario. Even human pilots use simulators to train, especially for those rare situations. And since robot training is expensive and slow in the real world, the only alternative is to do it in a sim. Simulation allows the composition of any scene that might be very hard to record in the wild - for example, an octopus sitting as a hat on the head of an elephant... where would you be able to get that photo? but surely you imagined it in 0.1 seconds, using your imagination - a powerful simulator humans have in their heads. Such images are crucial in training AI. I think AI will reach human level when it will be equipped with a sandbox where it can try out its ideas and concepts, similarly to how scientists use labs to test their theories. When AI gets its world simulator, it will be able to learn reasoning and meaning that is grounded in verification. Just like us. We have the world itself as our fundamental "simulator" and experiment on it to learn physics, biology and AI. AI needs a simulator too.</>
- pault 9y agoCool, but what does this have to do with the comment you replied to?
- maccard 9y agoRemember that the people who worked on the engine for three years also have years and years and years of experience prior to this.
- pjmlp 9y agoWhich is why there is the games industry saying that one either builds an engine or a game. Also why commercial game developers usually don't whine about 3D APIs like FOSS indie devs do. Adding support for yet another graphics backend is a trivial task, compared to the overall feature set of a game engine.
- daemin 9y agoThe engine has engineering effort in it since the late 1990's since some of the code is that old. (I say this because I remember learning from the mod SDK back in the day, and I've looked into what it is now). So almost 2 decades worth of engineering effort has gone into it. Granted a bunch of that effort has been in rewriting systems which needed to be updated (like rendering).
- hashmal 9y agoan unreal amount?
- deleted 9y ago[deleted]
- 2sk21 9y agoSo all of this processing happens for one frame? And this is going on at 60 Hz?
- maccard 9y agoYes, and more. You’ve also got a rigid body (physics) simulation, ai/pathfinding, animation, networking, audio and gameplay logic all to run. If you’re making an open world game, you also need to have streaming code to load and unload parts of the game on the fly. It doesn’t always happen at 60hz (which is 16ms total processing time for all the above plus what’s in the post). Some games run at 30hz(33ms), some run unlocked (varying times), and some can even run at 144Hz (7ms). As an extreme example, VR headsets normally require rendering twice (once for each eye), and run at 90FPS, which is 11ms to do your entire game, and render it twice. Furthermore, these aren’t normally just guidelines, these are caps. If your game runs at 60hz, and you miss your target by 1ms, on most hardware you’ll end up missing the hardware refresh which means either you get a temporary drop to 30hz, or you get tearing (half the old image and half the new image), neither of which are particularly pleasant.
- royale93 9y agoThe situation has changed a little bit recently with the introduction of adaptive synchronization monitor standards(GSync and Freesync). On PC this means that framerates above some minimum target can drift without experiencing tearing or missed deadlines.
- consp 9y agoYes, but it still drops the frame as far as I know (works like a charm by the way, in my experience).
- maccard 9y agoIndeed, that's what I meant by "most hardware", but that hardware is definitely outside the reach of most people right now. Firstly, consoles don't support adaptive sync, and most tv's don't either, so that eliminates all PS4/XB1 (and their derivatives). Then to actually get a screen with GSync, you're talking ~350 pounds [0] for an entry level one, and realistically you're going to need a medium to high-end graphics card (looking on nvidia's website seems their support is actually far better than I expected it to be). Unfortunately, for the majority of people adaptive sync is still a few years off, and I'd be surprised if we saw it this decade. [0]https://www.scan.co.uk/shop/computer-hardware/monitors/monitors-nvidia-g-sync https://www.scan.co.uk/shop/computer-hardware/monitors/monit...
- lordnacho 9y agoThis is why I don't get why the game industry has such a bad rep for overworking people. It's genuinely hard to do this kind of code so you'd think they take care not to scare away the few people who can do it. I recall at one point Goldmans was bragging to my team about how they'd hired a game dev to do their click-to-trade currency UI. Seemed like the guy found an easier job for more pay.
- mschaef 9y ago> Goldmans ... hired a game dev to do their click-to-trade currency UI. Seemed like the guy found an easier job for more pay. Not necessarily easier... but definitely a different set of difficulties.
- smcl 9y agoI interpreted "easier" as in "I don't have to work 16+ hour days regularly"
- hacker_9 9y agoThis is just capitalism at work; in the game industry there is no guaranteed reward at the end of the development cycle, so you have to keep up the pressure in order to beat out your competitors, and increase your chances of winning. This leads to crunching, 60 hour weeks and mass layoffs when you lose - lookup any of the top AAA game companies on Glassdoor and you will find they are awful places to work (Projekt Red, Rockstar, the now extinct Crytek, EA - consistently voted 'Worst Company', etc).
- staticelf 9y agoLooked up several of the companies you mention and most of them have a pretty high ratings. EA is voted worst company by consumers, not by employees which is pretty misleading. Please stop lying.
- hacker_9 9y agoI'm not lying, read the actual reviews and don't just look at the review score. The good reviews come from people who don't mind working 60 hour weeks, being paid lower salaries, and getting overworked.
- jokoon 9y agoThis is why I like minimalist 3D graphics.
- pault 9y agoDoes anyone know of a good book or course that does a deep dive into unreal engine source? I'm trying to level up my graphics programming skills and that seems like it would be an amazing reference, but I don't currently have the knowledge to navigate it myself.
- zfedoran 9y agoI'm not sure about unreal engine, but for a general overview the "Game Engine Architecture" book is a great starting point.
- hesdeadjim 9y agoThat book is great, but it’s discussion of graphical techniques is shallow (by design, it’s an overview book). Real-time Rendering was the book given to me back when I was first learning game development: http://www.realtimerendering.com/book.html http://www.realtimerendering.com/book.html
- pfranz 9y agoLike the other commenter said, game engines are a huge topic. The game engine architecture book has a nice overview (even though it's hefty), you would probably want an equal size book on each aspect of a game engine; graphics, networking, dynamics, audio, ai, etc. I haven't read it, but also heard good things about the real time rendering book. I did look at the game engine architecture book looking for info about deferred rendering and it was fairly shallow (but thats not the goal of the book). If I remember correctly--the book actually points you to more detailed resources (papers) and books.
- zfedoran 9y agoI agree, each topic in the game engine architecture book could be another book on its own. However, it does give a good introduction and briefly touches on most of the topics in this diagram https://i.imgur.com/SxydAoF.png https://i.imgur.com/SxydAoF.png (diagram is from the book)
- 9y ago
- kevindqc 9y ago> For stationary lights and dynamic props, Unreal uses per object shadows, meaning that it renders one shadowmap per dynamic prop per light Isn't that a TON of shadowmaps?
- deleted 9y ago[deleted]
- iainmerrick 9y agoI'm a little surprised at how surprised people are here, at how much work is done per frame! Sure, game engines are really complex and impressive, but the same is true of a lot of other kinds of software. If you work on websites, have you thought about how much processing goes on when loading and rendering a page?
- blattimwind 9y agoHow much work the parsers, layout engine and renderer have to do in a browser is far more opaque than what a game engine does. For game engines there is a lot of material out there explaining the basic processes and data flows; there are free or open source games and game engines around as well: Unreal engine, used in the article, is free, including full access to the source code. (This is by far the most widely used game engine in the entire gaming industry). And with a graphics debugger (free) you can look fairly easily at how games (pretty much any game you can run on your PC) render things as well. That's not to say that game engines are simple, however, it is relatively easy to understand how they work on a basic level (i.e. what they have to accomplish and how they do so in general terms) and, specifically considering graphics, simple renderers are not particularly hard to develop yourself as a small side project. With browsers, this is a lot more difficult. There are perhaps three modern browser engines, which are mostly open source but also very large pieces of software. There are no books or tutorials explaining how to develop browser engines. And the debugging tools in the browser only tell you how often a "DOM update" or "render" happened and perhaps how long it took.
- iainmerrick 9y agoVery good point! You don't get "how to write a browser" books in the same way you do with game engines. I wonder if it's because game engines are just more appealing? And also, you can build your own cut-down game engine and that's still useful, whereas there's a very high threshold of functionality needed before a browser is useful. They're actually similar in some ways -- there are a handful of browers and a handful of AAA game engines, and they're all either open source or at least licensable source.
- 9y ago
- ilaksh 9y agoI personally believe much of this will become passe within five years or so. I have seen a few demos of real-time path tracing software running on GPUs. I know GPUs are fast, but I wonder if there is a way to do the same math on an ASICs or FPGA that could be even faster? The main issue with existing things seems to be being able to do enough iterations to get a clear picture. Anyway I believe a lot of the tricks related to triangle meshes and lighting approximations will be thrown out and replaced with procedural generation and real time path tracing.
- katastic 9y agoPerhaps. Too bad we hit a GHZ wall, so the only thing we can do now is add more cores. FYI: For 6K and 8K, both nVidia and AMD tech reps have said that "multi-GPU" (not CORE) solutions will be required to reach those. But they also said once they hit 16K, they'll have "real eye quality" in terms of DPI which comes with lots of extra "realism" for free. Like, watch the new Jungle Book in 4K and certain scenes of mountains will blow your mind and feel "real" (without any 3d glasses) and your brain is like "holy shit, I'm not watching a movie (for this split second), this is something real." But most scenes still don't. We're so close to photorealistic, I can taste it! (Like that GTA 5 photorealism mod on HN yesterday.) That's why they're all moving to Vulkan. OpenGL is single-threaded and a PITA to easily exploit multiple GPU solutions. (Global state, one draw thread.)
- MattRix 9y agoEhh, I'm kind of doubtful. I'm sure that stuff will get more popular, but it's not going to replace triangle-based rendering for MOST games for a very long time... especially since we're moving into the realm of VR where games need to render tons of pixels at very fast refresh rates.