Live data from Hacker News

How Unreal Renders a Frame

interplayoflight.wordpress.com

91–100 of 167 posts

Re: How Unreal Renders a Frame

#91
post #38
post #8

Earlier quoted context omitted.

Yes, 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 un…

I'm curious how you would relate in-browser WebGL performance vs. performance of native software such as Unreal. Is running it in a browser 10x worse? or 100x?

Unreal can target WebGL: https://www.pcper.com/news/General-Tech/Epic-Games-Releases-...

(There are also older demos for asm.js + WebGL 1)

Re: How Unreal Renders a Frame

#92

Earlier quoted context omitted.

WebGL isn't trying to be competitive with full blown game engines, is it? For one, game engines normally don't use OpenGL unless they have to. The GL drivers on PC tend to be very weak. High end games target Direct3D on Windows/Xbox and these days are moving to Vulkan/Metal, even on mobile. On Windows the GL driver situation is so bad that Chrome translates GL to Direct3D. This obviously will impose some overhead and…

WebGL isn't trying to be competitive with full blown game engines, is it? Sure it is! Not right now maybe, but the web standards people working on it would love to be a viable platform for AAA games. Every so often they tout a new WebGL port of a well-known game as the harbinger of things to come.

I'd love to build webgl multiplayer games. I hope to get the chance working on these things in the future.

Re: How Unreal Renders a Frame

#93
I'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?

Re: How Unreal Renders a Frame

#94
post #68

Earlier quoted context omitted.

> in the game industry there is no guaranteed reward at the end of the development cycle The same is true for any product industry. There are things you can do (customer development, short iterations that involve your potential customers, etc) to increase the chances, but if you're not doing work for clients directly, then there is no guarantee. Note that the "doing work for clients directly" exists in game developme…

Games don't have inherently have crazy crunch times, they are simply going to fire a lot of people so they don't care about burning them out. It's completely rational behavior that has nothing to do with games, just look at MMO's for a more reasonable development process.

Of course there’s nothing inherent about it, but it does seem that many games companies do follow some rather predatory practices.

Re: How Unreal Renders a Frame

#95

I'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?

How 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.

Re: How Unreal Renders a Frame

#96
post #6

So all of this processing happens for one frame? And this is going on at 60 Hz?

(I havent read the whole article, but havent seen other replies mention this)

Unreal uses an architecture called deferred rendering[1]. It's more complex, but allows for a lot more tricks and the main benefit is that lighting performance is closer to constant, instead of increasing or decreasing with how many lights you have.

Forward rendering is the simpler alternative[2]. For Unreal, they had a forward renderer for mobile and were introducing one as an option for VR since the minimum frame time can be shorter.

[1] https://en.wikipedia.org/wiki/Deferred_shading

[2] https://gamedevelopment.tutsplus.com/articles/forward-render...

Re: How Unreal Renders a Frame

#97
post #38

Earlier quoted context omitted.

I'm curious how you would relate in-browser WebGL performance vs. performance of native software such as Unreal. Is running it in a browser 10x worse? or 100x?

In principle WebGL should be competitive with OpenGL. Once it hits the GPU, it's the same. Some of the bottlenecks in WebGL are: - Javascript. Modern JS engines are great, so the overall speed can be good, but you're still missing things like 64-bit ints, SIMD and threads. (Do game engines make heavy use of threads though? I don't know, but many influential games programmers seem to be wary of them!) - The WebGL -> O…

> Do game engines make heavy use of threads though?

Boy do they, yes.

Re: How Unreal Renders a Frame

#98

I'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?

How 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…

Very 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.

Re: How Unreal Renders a Frame

#99
post #46

Does 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.

Like 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.

Re: How Unreal Renders a Frame

#100
post #97

Earlier quoted context omitted.

In principle WebGL should be competitive with OpenGL. Once it hits the GPU, it's the same. Some of the bottlenecks in WebGL are: - Javascript. Modern JS engines are great, so the overall speed can be good, but you're still missing things like 64-bit ints, SIMD and threads. (Do game engines make heavy use of threads though? I don't know, but many influential games programmers seem to be wary of them!) - The WebGL -> O…

> Do game engines make heavy use of threads though? Boy do they, yes.

Can you go into more detail? (Or point me at some up-to-date books or blog posts!)

I'm specifically curious about CPU-intensive stuff that is sharded out to multiple threads. That's your classic multithreaded programming, the sort of thing you'd do in scientific computing, but I always got the impression games people were skeptical about it, due to unpredictable performance and the high risk of bugs.

Post reply on HN