

Gorgeous Unreal Engine 4 brings direct programming, indirect lighting - asianexpress
http://arstechnica.com/gaming/2012/06/gorgeous-unreal-engine-4-brings-direct-programming-indirect-lighting/

======
kristofferR
Here's the video of the developer walktrough:
[http://www.gametrailers.com/video/exclusive-development-
unre...](http://www.gametrailers.com/video/exclusive-development-unreal-
engine/731871)

It's stunning that this runs on a single Nvidia GeForce 680GTX in an editor
without any visible lag at all. I wonder why tesselation wasn't enabled
though, it may have been because of performance issues.

~~~
alainbryden
Wow. When he popped out of full screen and revealed that he was in his editor
- _mind blown_.

~~~
rorrr
I was more impressed by the live recompilation. It didn't interrupt his
gameplay at all.

------
TrevorJ
Coming from a film background, it is clear there is a lot of conflation
happening in these articles between light that 'behaves' like it would in the
real world, and 'good' lighting. That is why you get quotes like in this
article 'I light my scene by dropping a sun in'.

In reality, there is a whole lot more to lighting then simply having lights
and materials that behave naturally. Sure, this gives you more realistic
looking results out of the box, but it doesn't mean you don't have to sculpt
and massage and tune your lighting to achieve the artistic result you want,
especially for interiors, or scenes with characters in the foreground.

~~~
gbrindisi
> In reality, there is a whole lot more to lighting then simply having lights
> and materials that behave naturally.

For example? (genuinely curious)

~~~
daenz
Achieving a specific mood or "feel" for an environment requires someone who is
very sensitive to lighting, color, and architecture, and who has knowledge of
techniques to achieve certain looks.

For example, if you want an ominous feel to a cathedral, you need to know what
light colors are more ominous than others, what direction of lighting (maybe
bottom up, rather than from the top), what types of lights...many dim point
lights? or single directional lights?, if light scattering through a medium
like fog would look good, etc etc. And also keeping in mind functional aspects
like, can the player still see items or things he needs to do, even with all
of this specific lighting.

Another example might be that while lighting and materials might behave
naturally, sometimes they still behave in undesireable ways. Suppose the angle
of the sun reflected off of a reflective surface right into the player's face
right while he was at a specific location where he needed to do something. If
you can't move the surface, can you shift the light? Will that effect the
scene much? Maybe now that you shifted the light, the rays of light that were
going through a tree branch beautifully are not there any more.

~~~
wmf
Getting back to UE4, if its lights behave more like real-world lights it may
allow game artists to translate real-world lighting knowledge into games or
let them spend less time working around kinks in the engine.

~~~
daenz
Definitely true. We draw our experience on lights from the real world, so the
closer an engine is to the real world, the faster the artists can prototype
and test lighting setups.

~~~
MartinCron
As a still photographer who sometimes works with multiple off-camera lights
(strobist-style) I would love to be able to experiment in software to see a
very close approximation of how a setup would look.

~~~
daenz
I'm not aware of any photographer-centric photorealistic 3d apps, but that
sounds like a potential niche business! Might be worth exploring.

~~~
ISeemToBeAVerb
I have a plugin for Cinema 4D called "HDRI Studio Kit" that is basically a set
of predefined studio lights and lighting setups. Makes it very simple to light
objects using traditional photographic methods. You have various tent setups,
soft-boxes, umbrella lights, etc...

------
laserDinosaur
The bit where he made a change to the source code, let it recompile on it's
own, got a little alert in the editor when it finished and then had the change
apply all without restarting the engine...WOW!

~~~
robterrell
Unity does this now. You can recompile a file while your game is playing in
the editor, and the running code is replaced. And I almost never use it -- I
should figure out why that is.

~~~
zerd
For C++? That's the impressive part.

------
jlongster
I find it hilarious that (presumably) my computer could render that smoothly
but the video itself stutters.

~~~
corysama
"The UE4 demo is running on PC, specifically an Intel Core i7 processor with
an NVIDIA GTX680 and 16GB of RAM"

[http://www.eurogamer.net/articles/digitalfoundry-vs-
unreal-e...](http://www.eurogamer.net/articles/digitalfoundry-vs-unreal-
engine-4)

------
dualogy
Incredibly stunning tech. Now, I'm gonna go fantasize about an open-source
version of this with updates every month (instead of every 3 years) -- as a
compromise, I could do without the whole hot-reloading IntelliEditor shebang
and consoles support -- a concentration on PC hardware that "will be commodity
in 2 years, on mobile in 4 years, but can already be bought as state of the
art now" (aka Kepler GPUs) would be enough.

To the pros: in your opinion, which of the many FOSS engines out there (many
of which carrying a large legacy code-base of supporting soon-outdated modes
of operation such as DX9 or lower or GL < 4.0) is the most likely candidate to
offer a deferred pipeline incorporating lighting / particles such as we see
here in this UE4 demo, at that level of performance and (expected but also
demoed) robustness? Again, their "industry" tack (smart editor / console
support, "we license only to pro developers" stance etc) would _not_ be
required ... only the "metal".

~~~
dualogy
Also I'm wondering about the lighting. Some folks on Twitter called it dynamic
Global Illumination but here they just call it indirect lighting. I wonder --
are they still using an ambient light? More specifically, what's their GI
algorithm? Might be something like the voxel approach sported by @icare3D but
then it seems that one's just barely interactive, not as "real-time" as this
stuff -- or well it might be on a GTX680 with a really-lo-res voxelization.

~~~
photon137
Voxels would be too heavy. I have worked with volume rendering before and it's
way too expensive to do it at this scale (although their scene with the light
passing through the volumetric smoke column kind-of defied this).

Some real-time version of PRT? "RTRT"?

~~~
dualogy
Turns out it IS voxels!
<https://twitter.com/Icare3D/status/211404654062481408>

(Of course the (fairly lo-res compared to your screen) voxelized geometry
representation is not rendered directly to screen ala Atomontage or Gigavoxels
-- the the GI is based on RT scene voxelization and approximate cone-tracing.)

Well that's awesome because at least there's (A) a paper for this (grokking it
is another matter) and (B) seems like it runs really smoothly on next-gen
GPUs!

~~~
photon137
lo-res being the key :) I can see how the voxel representation would be
computed and made resident in GPU memory. What's amazing to me, that such a
highly branched computation algorithm is now possible in real-time on a GPU!
(we had branching available since SM 3.0 - but was "not recommended")

------
adrianm
This stuff is really fascinating. Does anyone have any recommended reading or
general advice as to how to learn more about game/graphical engine
implementation? I mean, from the ground up. (I'm a CS undergrad and the
closest we've gotten to learning about this has been the computational
geometry chapter in CLRS, but that was a mildly esoteric introduction to
everything that is possible in this field.)

~~~
photon137
NeHe's OpenGL tutorials used to be a good (although now kind of outdated)
starting point. Shaders didn't use to exist back then. But still a good start:

<http://nehe.gamedev.net/>

A game engine is much more complex than a graphics engine. Maybe somebody can
point to guides for creating physics/sound engines and AI/gameplay stuff as
well?

~~~
malexw
When I started learning I spent a lot of time reading NeHe tutorials. But
modern OpenGL feels so far removed from those tutorials that it feels like
learning a completely different API.

The best tutorials I've found for modern OpenGL is "Learning Modern 3D
Graphics Programming" by Jason McKesson. The only problem I have with these
tutorials is that there aren't enough! <http://www.arcsynthesis.org/gltut/>

~~~
adrianm
I really appreciate all of the responses and have already put many of the
recommended texts on my wishlist. (And I just bought Game Engine Architecture
as well, too bad you didn't post an Amazon affiliate link for yourself!) But I
just wanted to point out that since this tutorial is free, I immediately
checked it out, and I am absolutely blown away. This will certainly keep me
busy until GEA arrives! Thanks so much, it looks to be a great starting point
for learning more.

Edit: I also wanted to point out that in the author's preface, he discusses
what he considers the downside to most introductory texts and tutorials in 3D
graphics programming - presenting "fixed functionality" that allows newcomers
to more quickly use the tools at hand by abstracting much of the foundational
information away.

While this is certainly useful for experienced developers learning a new
derivative technology on top of what they already know, I have always found
this approach for introductory stuff frustrating. At the end of the day I may
come away pseudo-understanding a "higher level" concept, but ultimately much
has been abstracted away and I am left ignorant and, as the author says,
"Programming thus becomes akin to magical rituals: you put certain bits of
code before other bits, and everything seems to work."

I wish I knew of more texts like this for other fields where over or premature
abstraction could endanger comprehension. (For example, I know I would like to
see a similar approach taken to other complex topics, like networking.)

~~~
malexw
Hey, glad I was able to give you some useful information! If you ever find
yourself in Toronto, say, for an indie game jam
(<http://www.tojam.ca/home/default.asp> hint hint), you can buy me a beer ;)

If you're looking for something lower level, the book you probably want is the
white book - Computer Graphics: Principles and Practice. I have the 2nd
edition from 1992, which is the still the standard intro graphics textbook for
many CS departments. Though Amazon says there will be a 3rd edition coming out
at the end of this year!

[http://www.amazon.com/Computer-Graphics-Principles-
Practice-...](http://www.amazon.com/Computer-Graphics-Principles-Practice-
Edition/dp/0321399528/ref=sr_1_2?s=books&ie=UTF8&qid=1339214116&sr=1-2&keywords=computer+graphics+principles+and+practice)

Another highly recommended book (also recommended in another comment here) is
Real-Time Rendering, but I've only used bits and pieces from this one, so I
don't know how good it is for folks just starting out. Still probably one
you'll want to add to your shelf if you continue on in the field.

[http://www.amazon.com/Real-Time-Rendering-Tomas-
MOller/dp/15...](http://www.amazon.com/Real-Time-Rendering-Tomas-
MOller/dp/1568814240?tag=realtimerenderin)

Oh, and also also, head over to YouTube with some snacks and a drink, sit
down, and watch the weekly Overgrowth game developer videos from Wolfire
Games. It's both inspirational to see what other people are doing, and a great
demo of concepts that you'll read about in GEA, such as animation blending:
[http://www.youtube.com/playlist?list=PLA17B3FAA1DA374F3&...](http://www.youtube.com/playlist?list=PLA17B3FAA1DA374F3&feature=plcp)

------
pka
The graphics stuff is amazing, but I'd be also interested to know how they
achieve hot-loading with C++. It seems to me that Erlang's philosophy (or FP
in general) would be of great advantage here - just have the engine handle
entity state and make all of the game world manipulating functions
referentially transparent. This way one can swap code between world "ticks"
(or update cycles) without worrying about breaking something.

I don't know how efficient something like that would be though; somebody
mentioned cache issues with lumping heterogenous properties together, but
maybe this could be optimized behind the scenes.

------
rsaarelm
At this point, seeing this kind of extremely high production value animation
used to enact this kind of fantasy scene instantly makes me think of hackneyed
backstory and plot focus-group optimized to death to appeal to slightly dull
14-year-olds. You don't throw out that sort of development budget to try out
something with even a hint of narrative experimentalness, and you can always
rely on there being kids with disposable income who haven't yet been saturated
with cliches to the point of fatigue.

"This looks very well done, it's probably bad" is a strange heuristic to have.

~~~
pavlov
_"This looks very well done, it's probably bad" is a strange heuristic to
have._

It's the same for Hollywood movies, isn't it?

When the producers want to focus your attention on how expensive and uniquely
complicated a game or movie production was, that's a sign that the actual
content was a secondary concern.

------
mgkimsal
We've certainly come a long way since Demon Attack and Pitfall! :)

I remember 23 years ago, trying to do 'ray tracing' on my Amiga would take...
hours for one frame. It looked pretty good, but... wow. This is jaw-droppingly
cool.

------
ameyp
Why are people getting so excited about realtime global illumination and code
hot-swap? CryEngine 3 already supports both, and has done so for the past year
or so.

Realtime global illumination has been possible for the past few years. I
believe Crytek was the first studio to make a game engine with support for the
same (www6.incrysis.com/Light_Propagation_Volumes.pdf)

And the code hot-swap feature in the freely-available CryEngine 3 SDK isn't
just for Lua, there's the CryMono project which adds support for hot-swapping
C# scripts.

------
jebblue
I still have Unreal III in a box new that I bought in 2007 because they said
they would have a Linux Client for it.

------
photon137
Very Beautiful! The demo has a nice Skyrim/LOTR feel to it and the lava flows
were just gorgeous! If that lava flow generation is completely procedural then
I'm extremely impressed.

Writing a highly parametrized engine like that with JIT script compilation is
plain awesome!

~~~
forrestthewoods
There is no script. It's all done in C++ with the project broken up cleverly
into DLLs which can be reloaded at run-time without interruption. And I
believe the lava flow is done with animated meshes.

~~~
photon137
I thought Kismet was pseudo-script (albeit with a GUI).

Edit: <http://www.unrealengine.com/features/kismet/>

~~~
forrestthewoods
UE3 had Unreal Script which was a custom scripting language and that has been
removed from UE4. Kismet is more data than script. There's no JIT-compilation.

~~~
barrkel
I have mixed feelings about this. UnrealScript had a lot of interesting ideas;
particularly its module system (a kind of sideways inheritance where you could
override an ancestor in a package, but not have to override all the
descendants to have them inherit the behaviour - really handy for third-party
plugins); the synchronous animation playback, effectively using continuations
behind the scenes; how it handled synchronization of variables for
client/server; and to a certain degree the "modes" that objects could be in, a
way of switching behaviour of a whole slew of methods en masse.

On the other hand, object-oriented approaches are not great for simulating
huge numbers of entities, where column-major array-based layouts are a lot
more efficient.

I wonder if Kismet data-flow graphs may end up getting too complicated for
their own good. They look like they could do with a textual representation.
The obvious manual iteration involved in the creation of the orrery in the
gametrailers demo video posted in the comments elsewhere here shows how
painful this approach can be.

~~~
psykotic
> a kind of sideways inheritance where you could override an ancestor in a
> package, but not have to override all the descendants to have them inherit
> the behaviour - really handy for third-party plugins

This sounds like the virtual classes that Tim were talking about ten years
ago. (For the curious, the first programming language with virtual classes was
BETA from Aarhus University.) They never made it into UnrealScript. His
language research after that time was less incremental and sought to uproot
almost everything about programming games. He moved away from object-oriented
programming and more towards functional programming, specifically type theory.
When I arrived in 2004, he was all about dependently typed languages, the big
inspiration being David McAllester's Ontic. For a long time his plan was that
his new language would be used to implement most if not at all of UE(n+1).
Eventually that ambition had to be tempered by reality and thrown aside; I'm
not sure if he's still working on programming language design.

~~~
barrkel
Yes, it's been 10+ years since I last seriously looked at UnrealScript; I must
have misremembered that feature, virtual classes.

------
asianexpress
In a way, this system reminds me of Light Table[1] in its ability to change
some code/settings and get instant feedback. It totally changes the way people
create content because it becomes so much more accessible and so much faster
to see changes -- you can play around with a lot of different approaches more
quickly, resulting in more room for experimentation.

Pretty amazing stuff! Really curious to see the tools that power all of this,
as well as hear the architect's (or architects') vision for all of this

[1] <http://www.kickstarter.com/projects/ibdknox/light-table>

~~~
teamonkey
Being able to compile code and reload it while the engine is running is
something that has existed in many engines for several years. What's cool here
is that the engine keeps running while editing and compiling, then it auto-
reloads and pushes the changes when compiled.

~~~
asianexpress
Yeah definitely -- I guess what I meant was that there's now an interface to
manipulate code, without having to touch code, and then it automatically goes
through the process you mentioned

------
mck-
What a leap forward since Unreal/UT .. Hope the gameplay stays at least as
good..

------
wtracy
I just have to say: Realtime rendering has finally become interesting to me.
o_O

------
mochizuki
I read about this is the latest issue of Wired. This looks amazing.

