Navigating huge (UE4 (rendering)) code

Slides:



Advertisements
Similar presentations
Windows Basics An Introduction to the Windows Operating System.
Advertisements

© Copyright Khronos Group, Page 1 COLLADA FX Update and FX Composer 2.0 Daniel Horowitz & Ignacio Castaño.
Unit 3 Day 4 FOCS – Web Design. No Journal Entry.
Introduction to Programming
Testing and Debugging pt.2 Intro to Complexity CS221 – 2/18/09.
Programming Fundamentals. Programming concepts and understanding of the essentials of programming languages form the basis of computing.
 Adding Background image  Creating internal links  Creating external links  Save your document as a webpage(.mht) file.
Adobe Photoshop CS Design Professional ADOBE PHOTOSHOP CS GETTING STARTED WITH.
Memory & Storage Architecture Seoul National University Computer Architecture “ Bomb Lab Hints” 2nd semester, 2014 Modified version : The original.
Eclipse IDE. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as teaching.
Microsoft Office Illustrated Fundamentals Unit B: Understanding File Management.
Module 1.4 File management. Contents Introduction Windows Explorer The need to organise More about files Working with files Test and improve your knowledge.
TH-OCR NK. content introduction go to next page background assumptions overall structure chart IPO for overall structure dataflow diagram of overall structure.
TERMS TO KNOW. Programming Language A vocabulary and set of grammatical rules for instructing a computer to perform specific tasks. Each language has.
A First Program Using C#
Operating Systems What do you have left on your computer after you strip away all of the games and application programs you bought and installed? Name.
Getting Started with Expression Web 3
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
11 A First Game Program Session Session Overview  Begin the creation of an arcade game  Learn software design techniques that apply to any form.
1 Phase Testing. \ 2 Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine subphases) Define Coding Standards.
With Windows 7 Introductory© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 Windows 7 Introductory Chapter 2 Managing Libraries Folders, Files.
15.1 Fundamentals of HTML.
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  The course describes the performance analysis and profiling tools.
HTML Comprehensive Concepts and Techniques Second Edition.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Clustering Prof. Ramin Zabih
Chapter 1 Getting Started with Adobe Photoshop CS4.
Operating Systems. An operating system (os) is a software program that enables the computer hardware to communicate and operate with the computer software.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
File and File Systems Compiled by IITG Team Need to be reorganized and reworded.
Chapter 6 Testing and running a solution. Errors X Three types Syntax Logic Run-time.
1© 2009 Autodesk Hardware Shade – Presenting Your Designs Hardware and Software Shading HW Shade Workflow Tessellation Quality Settings Lighting Settings.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Windows 7 and file management
IUIE Reporting Basics Workshop
An Eclipse Plugin for Creating Windows Graphical User Interfaces
May 17th – Comparison Sorts
ATS Application Programming: Java Programming
Auburn University COMP 2710 Software Construction xCode Development Environment for C++ Programming in Mac OS Dr. Xiao.
Chapter Lessons Start Adobe Photoshop CS
Deferred Lighting.
WORKSHOP 3 GSE IMPORT.
The life cycle.
CompSci 230 Software Construction
Microsoft Access 2003 Illustrated Complete
Introduction to Events
TerraForm3D Plasma Works 3D Engine & USGS Terrain Modeler
Electronic Communication
Install WordPress Premium Theme & Customization. Every developer knows that WordPress is a free content management system, such as a easy blogging tool.
Computer Architecture “Bomb Lab Hints”
Intro To Design 1 Elementary School Library: User Sub-System Class Diagrams Software Engineering CSCI-3321 Dr. Tom Hicks Computer Science Department.
Unreal Engine and C++ We’re finally at a point where we can start working in C++ with Unreal Engine To get everything set up for this properly, we’re going.
Compilers, Make and SubVersion
UMBC Graphics for Games
CSE 303 Concepts and Tools for Software Development
Planning and Storyboarding a Web Site
Min Heap Update E.g. remove smallest item 1. Pop off top (smallest) 3
Computer Basics Applications.
Microsoft Office Illustrated Fundamentals
Chapter 1 Introducing Small Basic
An Eclipse Plugin for Creating Windows Graphical User Interfaces
Review of Previous Lesson
Chapter 4 Enhancing the Graphical User Interface
Games Development 2 Tools Programming
Chapter 4 Enhancing the Graphical User Interface
Intro to Programming (in JavaScript)
Running & Testing :: IDEs
Presentation transcript:

Navigating huge (UE4 (rendering)) code UMBC Graphics for Games

UE4 is BIG For the 4.20.2-release tag in github C++ (*.h, *.cpp) 51,074 files 14,494,615 lines of C++ code C# (*.cs) 1813 files 496,550 lines of C# code Shaders (*.ush, *.usf) 332 files 86,359 lines of HLSL code

Navigating large software Mostly not really just about UE4 or just about rendering At some point, you will need to make changes to a large pre-existing software base Tools and strategies are the same

Tools of the trade Paper or text editor for notes IDE File search Know how to bookmark / set breakpoints Know how to step through & examine code For UE4, VS extensions in Engine/Extras File search VS Find in Files / Xcode search VS Visual Assist extension (VAX) External search tool like ripgrep

Types of knowledge Big picture Local view Basic idea of what it is doing Don’t sweat the details Local view How does one thing work Usually to make changes there or create something similar Find & understand the local code Understand who calls it, and with what assumptions Understand what it calls, and what they do (but not necessarily how)

Big picture: Know what to expect What algorithms do you expect to see? What data, inputs and outputs? For rendering, this class

Example Two common rendering strategies UE4 supports both Forward shading Deferred shading UE4 supports both

Forward shading Compute per-pixel shading while rendering objects Redundant shading computation for pixels that are overwritten More per-object control over shading Supports transparency for sorted objects Usually limits on type and number of lights

Deferred shading When rendering objects, just save shading parameters per-pixel In later passes, apply shading and lighting computations per pixel Culling lights by coverage allows tons of lights Base shading code needs to be similar for all objects Rise of Physically Based Shading in games Transparent objects in a separate forward pass

Big picture: Look for documentation Rendering overview docs.unrealengine.com/latest/INT/Programming/Rendering/Overview Some independent blog posts interplayoflight.wordpress.com/2017/10/25/how-unreal-renders-a-frame medium.com/@lordned Ask someone who knows

Big picture: See what it does PC: RenderDoc Install RenderDoc Enable plugin Restart UE4 UE4: r.CompositionGraphDebug Shows all passes Use vis console command to see pass outputs

Big picture: Step through the code Constrain to the level you care about Optimizers make life hard Reorder code, eliminate variables, limit variable lifetime, … Turn off optimization in just one file VS: #pragma optimize( "", off ) Xcode: #pragma clang optimize off DON’T CHECK THIS IN!!! Breakpoint & step FDeferredShadingSceneRenderer::Render FPostProcessing::Process

Details: Where to start Find a starting point in the code Build your understanding out from there Keep the window small You’re changing a black box in a chain of black boxes Just be sure to honor the interfaces and assumptions

Details: Finding code Find in files VS: Solution search box, Ctrl-Shift-F, Ctrl-T Xcode: Magnifying glass, search bar Limit by path, file type, previous search results Try a few different words Looking for a page or two of results. Too many isn’t useful. If you know a log string or cvar name, start with that. For blueprint or material node, look for node name Given several choices, look for the more unique one

Details: Understanding code you find Read the code Add breakpoints Look at the call stack on break Step through May help to add ONETHREAD command line argument For shader compiler, bAllowCompilingThroughWorkers=False

Details: Finding something similar How to make a material node Find a uniquely named one, similar to what you want Copy & rename everything it does Modify to new purpose How to make a blueprint node Find a uniquely named one , similar to what you want How to make a new postprocessing pass