Live data from Hacker News

How Unreal Renders a Frame

interplayoflight.wordpress.com

121–130 of 167 posts

Re: How Unreal Renders a Frame

#121
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 has support for compiling to WebAssembly. Not sure how solid it is. But, you can check out a demo here: https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGard... 200MB download. Probably requires FireFox.

In general, WebGL and asm.js have done a great job of keeping up with the capabilities of whatever is the current-gen iPad.

Re: How Unreal Renders a Frame

#122
post #97

Earlier quoted context omitted.

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

Here’s a good talk on a system used for the PS4 - https://www.gdcvault.com/play/1022186/Parallelizing-the-Naug... And another one on multithreading a cross platform game - https://m.youtube.com/watch?v=v2Q_zHG3vqg

There’s also this talk - http://developer2.download.nvidia.com/assets/gameworks/downl... which talks about collision detection and collision resolution on the GPU that actually explains the architecture of the cpu engine quite well and shows what parts are serial and what parts are well parallelised.

Re: How Unreal Renders a Frame

#123

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…

Just think of all the bloat in a browser. Don't mistake size for complexity. Graphics/game engines are complex. Browsers are big.

Whilst true, your simple renderer analogy does not work because it is like me saying that if I can create a program to draw some scrolling text then I can create a browser. I presume you have not had to optimise GPU graphics code whilst maintaining compatibility on multiple GPU vendors with a common code base?

One game engine is not the same as another and therefore not suitable for bulk comparison with any particular thing. Each game/graphics engine has their own set of requirements, and quality level, and the level of understanding required to "understand" what is actually going on.

Re: How Unreal Renders a Frame

#124

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…

Yeah I agree, the problem applies to most of the entertainment industry. As a result more investment is put into sequels of successful games, artists, TV shows, movies, books etc. Edit: as for crunch times, I expect this is to do with the interactive element of gaming. There is whole lot more work involved when the client has the ability to break your product.

Publishers give advances, have milestones, etc. It is uncertain whether a game will make money out in the market, but part of a publisher's role is supposed to be to have a portfolio and be able to spread that risk, funding some of the development of both the losers and the winners.

Re: How Unreal Renders a Frame

#125

Earlier quoted context omitted.

Also the people who buy business apps are often not the people who actually have to use them every day. So UI/UX ends up being a much lower priority than say cost.

And, if the program processes data too quicky, users think it isn't working. (Managers, perhaps, think it isn't working hard enough.)

Fortunately, there is a rails library for that. https://github.com/airblade/acts_as_enterprisey

Re: How Unreal Renders a Frame

#126
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.

Have you actually taken a look at it (the source code?). It's actually very well written and easy to understand even for me (a sysadmin, not a programmer). I have a side-project in ue4 that I've been trying to dev on gnu+linux only and have been working hard to avoid the issues that games like pubg have that make them unable to run on linux (mostly because Epic has not been taking care of us linux users like they promised and the marketplace assets often only work on windows, so when a dev like the pubg guys just throws a bunch of assets in, that's why they can't get things to work on linux)

My problem is I don't know much C#, but it really confuses me why Epic decided to use C# for the framework of a C++ engine...

That project is on hold while I play with vulkan directly via https://github.com/KhronosGroup/Vulkan-Hpp.

I have too many projects.

Re: How Unreal Renders a Frame

#127
post #112
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…

That's not exactly actually (UE VR dev here). When you render a game at 90hz (or 60 or really anything), that means your total throughput needs to be 90hz, NOT that the frame needs to render in 11ms. Since you're dealing with multithreaded CPUs + an asynchronous GPU, you can parallelize and sequentialize all this. How UE works in its DX11 and OpenGL renderers, on a 90hz game, is that you're gonna have the Game Thread…

At some point the perception of the human eye means you cannot increase latency further. Especially if the game is something where reaction time is important, like a twitchy first person shooter.

I wonder what the cutoff is where someone starts to notice, but I imagine it's not much greater than 50-100ms

Re: How Unreal Renders a Frame

#128
post #62
post #57

Earlier quoted context omitted.

Its kind of amazing how Unity forced change on Epic though. In the X360-PS3 era they absolutely _dominated_ the market, the list of games built on UE during that time is insane. However, after that, Unity started to come up as it had much nicer licensing and as a response to that Epic made UE almost free to use for small studios and more palatable for big ones.

I don't think Unity forced change on Epic, Unity targeted the nascent indie market very well and was a great replacement for the deprecated XNA. I can't think of a AAA Unity title aside from Microsoft's Recore - which launched with problems at $40. Epic's AAA market ended up with bigger budgets and a demand for more control, so many of them simply created their own engines. So most UE games seem to be big budget indi…

Hearthstone is built with Unity.

Re: How Unreal Renders a Frame

#130
I 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.

Post reply on HN