A Taste of Live Code Editing With Visual Studio’s Tracepoints

Needless to say that from one software project to another, compile times vary greatly. When debugging we often spend a significant amount of time changing some lines of code, recompiling, waiting and then relaunching the software. While it is true that one has to change their debugging “style” from one project to another (i.e. having a thorough understanding of the problem before “poking around” code is definitely a plus when dealing with big code bases where edit-and-continue is not possible), waiting for the compiler and linker when debugging is never fun. It’s also very unproductive.

In parallel, some of the tools we use everyday allow us to greatly improve our debugging efficiency, though sometimes we are completely oblivious to the power that is available to us. Regardless of how fast or slow compile and link times are on your current project, any tools that can mitigate the recompile cycle when debugging are welcome. One such tool is Visual Studio’s tracepoint: a breakpoint with a custom action associated to it.

Continue reading “A Taste of Live Code Editing With Visual Studio’s Tracepoints”

Approximating Translucency – Part II (addendum to GDC 2011 talk / GPU Pro 2 article)

Thanks to everyone who attended my GDC talk! Was quite happy to see all those faces I hadn’t seen in a while, as well as meet those whom I only had contact with via Twitter, IM or e-mail.

For those who contacted me post-GDC, it seems the content I submitted for GPU Pro 2 didn’t make it into the final samples archive. I must’ve submitted too late, or it didn’t make it to the editor. Either way, the code in the paper is the most up-to-date, so you should definitely check-it out (and/or simply buy the book)!

Roger Cordes sent the following questions. I want to share the answers, since it covers most of the questions people had after the talk:

Continue reading “Approximating Translucency – Part II (addendum to GDC 2011 talk / GPU Pro 2 article)”

GDC 2011 – Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look

As presented at GDC 2011, here’s my (and the legendary Marc Bouchard) talk on our real-time approximation of translucency, featured in the Frostbite 2 engine (used for DICE’s Battlefield 3). These are the slides that we presented, along with audio. Enjoy! 🙂

 

 

Marc and I would like to thank the following people for their time, reviews and constant support:

For those we managed to meet, we had such a good time with all of you at GDC. Always happy to interact with passionate game developers – this is what makes our industry so great! We hope to see you soon again! 🙂

GDC 2011 Talks You Should Attend

As seen in the previous post, I’ll be presenting at GDC 2011. We also have several AMAZING speakers from EA (Electronic Arts) whose talk you should attend:

SPU-based Deferred Shading in BATTLEFIELD 3 for Playstation 3

[Speaker]

Christina Coffin (DICE), @ChristinaCoffin

[Description]

This session presents a detailed programmer oriented overview of our SPU based shading system implemented in DICE’s Frostbite 2 engine and how it enables more visually rich environments in BATTLEFIELD 3 and better performance over traditional GPU-only based renderers. We explain in detail how our SPU Tile-based deferred shading system is implemented, and how it supports rich material variety, High Dynamic Range Lighting, and large amounts of light sources of different types through an extensive set of culling, occlusion and optimization techniques.

[Takeaway]

Attendees will learn how SPU based shading allows a rich variety in materials, more complex lighting and enables offloading of traditional GPU work over to SPUs. Optimization techniques used to minimize SPU processing time for various scenarios will also be taught. Attendees will understand how to technically design, balance and analyze the performance of a game environment that uses an SPU based shading system. Attendees will learn key points of creating and optimizing code and data processing for high throughput shading on SPUs.

[Intended Audience]

This session is intended for advanced programmers with an understanding of current forward and deferred rendering techniques, as well as console development experience. Knowledge of lower level programming in vector intrinsic, assembly language, and structure-of-arrays versus array-of-structures data processing is recommended.

[Links]

http://schedule.gdconf.com/session/12273

Lighting You Up in BATTLEFIELD 3

[Speaker]

Kenny Magnusson (DICE)

[Description]

This session presents a detailed overview of the new lighting system implemented in DICEs Frostbite 2 engine and how it enables us to stretch the boundaries of lighting in BATTLEFIELD 3 with its highly dynamic, varied and destructible environments. BATTLEFIELD 3 goes beyond the lighting limitations found in our previous battlefield games, while avoiding costly and static prebaked lighting without compromising quality. We discuss the technical implementation of the art direction in BATTLEFIELD 3, the workflows we created for it as well as how all the individual lighting components fit together: deferred rendering, HDR, dynamic radiosity and particle lighting.

[Takeaway]

Attendees will learn the workflow we use to light our worlds, as well as memory and performance considerations to hit our performance budgets from a technical art perspective. Attendees will also get a thorough insight into an exciting new approach to lighting both open landscapes and indoor environments with dynamic radiosity in a fully destructible world.

[Intended Audience]

Attendees should understand the fundamentals of lighting systems used in contemporary game development as well as basic principles of rendering technology. Primarily directed at technical artist and rendering programmers, the presentation is accessible enough that anyone attending will gain an insight into the world of lighting.

[Links]

http://schedule.gdconf.com/session/12139

Advanced Visual Effects with DirectX 11

[Speakers]

Johan Andersson (DICE, @repi), Evan Hart (NVIDIA), Richard Huddy (AMD), Nicolas Thibieroz (AMD), Cem Cebenoyan (NVIDIA), Jon Story (AMD), John McDonald (NVIDIA Corporation), Jon Jansen (NVIDIA Corp), Holger Grn (AMD), Takahiro Harada (Havok) and Nathan Hoobler (NVIDIA)

[Description]

Brought to you with the collaboration of the industry’s leading hardware and software vendors, this day-long tutorial provides an in-depth look at the Direct3D technologies in DirectX 11 and how they can be applied to cutting-edge PC game graphics for GPUs and APUs. This year we focus exclusively on DirectX 11, examining a variety of special effects which illustrate its use in real game content. This will include detailed presentations from AMD and NVIDIAs demo and developer support teams as well as some of the top game developers who ship real games into the marketplace. In addition to illustrating the details of rendering advanced real-time visual effects, this tutorial will cover a series of vendor-neutral optimizations that developers need to keep in mind when designing their engines and shaders.

[Takeaway]

Attendees will gain greater insights into advanced utilization of the Direct3D 11 graphics API as used in popular shipping titles.

[Intended Audience]

The intended audience for this session is a graphics programmer who is planning or actively developing a Direct3D 11 application.

[Link]

http://schedule.gdconf.com/session/12078

Culling the Battlefield: Data Oriented Design in Practice

[Speaker]

Daniel Collin (DICE), @daniel_collin

[Description]

This talk will highlight the evolution of the object culling system used in the Frostbite engine over the years and why we decide to rewrite a system for BATTLEFIELD 3 that had worked well for 4 shipping titles. The new culling system is developed using a data oriented design that favors simple data layouts which enables very efficient computation using pipelined vector instructions. Concrete examples of how code is developed with this approach and the implications and benefits compared to traditional tree-based systems will be given.

[Takeaway]

Attendees will learn how to apply data oriented design in practice to write simple but high throughput code that works well on all platforms. This is especially important for the current consoles.

[Intended Audience]

Intended for programmers on all levels but some background on vector math and basic threading would be beneficial.

[Link]

http://schedule.gdconf.com/session/12251

Four Guns West

[Speakers]

Ben Minto (DICE), Chuck Russom (Chuck Russom FX), Jeffrey Wesevich (38 Studios), Chris Sweetman (Splash Damage Ltd.), and Charles Maynes (Freelance)

[Description]

This session aims to give an insight into the shadowy world of audio in AAA FPS titles. Featuring the sound designers behind MEDAL OF HONOR, BRINK, BLACK, HBO’s THE PACIFIC, and CALL OF DUTY. The face off is split into bite size chunks concentrating on key areas that are required to design the weapon audio for a AAA shooter. Areas of focus will include insight into Weapons Field Recording headed up by Charles Maynes, Sound Design with Chuck Russom, Creating Believable Worlds and Mixing Practices with Ben Minto, and Real vs Hyper Real with Chris Sweetman. The panel will also discuss the emotional power of weapon sound design in Video Games & Film.

[Takeaway]

New attendees will get tips and tactics on approaching audio in an FPS which can then be applied to their own productions. It will empower producers and game designers to consider audio early in a titles development which will increase the player’s experience and enjoyment tenfold.

[Intended Audience]

Target audience will be sound designers,producers, game designers and creatives from all aspects of video games wanting insight into the tricks behind great sounding AAA titles. The session will be structured to allow for all levels of knowledge in the specific fields.

[Link]

http://schedule.gdconf.com/session/12109

GDC 2011 – Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look

This year, I’ll be presenting at GDC (Game Developers Conference), along other great speakers from EA (especially DICE).

The talk is about a very cheap and fast approximation of translucency that will allow developers to add convincing subsurface scattering to their scenes with minimal impact on performance. The technique is excellent in a wide variety of scenes, using anything from minimal to massive numbers of lights. Here’s a quick summary of my talk, which you can also find on the GDC website.

[Title]

Approximating translucency for a Fast, Cheap, and convincing Subsurface Scattering Look

[Description]

In real-time computer graphics, the interaction of light and matter is often reduced to local reflection described by Bidirectional Reflectance Distribution Functions (BRDFs). While this mathematical model is valid for describing surface reflectance of opaque objects, many objects in nature are partly translucent: light travels within the surface. To simulate translucent properties of objects in real-time, such as subsurface scattering (in human skin and other surfaces), developers rely on complex and expensive techniques. Conversely, this talk presents a fast and scalable approximation of translucency for a convincing subsurface scattering look which can be implemented on current and next generation video gaming systems.

[Takeaway]

Developers attending this session will be able to improve their game’s visuals by adding real-time translucency to their scenes with minimal impact on the run-time, as demonstrated using EA DICE’s Frostbite engine. Moreover, this effect, once limited to offline rendering, will undeniably help developers in creating a more complete and immersive gaming experience.

[Intended Audience]

Reaching stakeholders from several disciplines of video game development, this talk is intended for all individuals that share common goals in terms of real-time graphics and that strive towards improving the visual quality of tomorrow’s games: rendering programmers, technical artists, art directors and technical art directors.

Visit this website for more info on other great talks to be presented.

See you at GDC!

Tools of The Trade: RockScroll & MetalScroll

Every once in a while you stumble onto a tool that makes your life (as a software developer) so much easier. What’s even better is when the tool is so great that you can’t  (or really hard to) work without it anymore! Over the years, many have fallen into this category. I recall when I was first introduced to Whole Tomato Software’s Visual Assist X and Perforce (coming from the pre-changelist era SCMs): it was hard to even consider working on a project without the latter (especially side projects at home – luckily these are affordable/available for home/side projects). So many people have made so many great add-ons for current IDEs and external tools, finding some that suit your code poet style will definitely make your life easier.

This new addition to my list of must-haves is called RockScroll:

Developed by Rocky Downs from Microsoft and publicly released by Scott Hanselman, Rockscroll is an add-on for Microsoft’s Visual Studio which replaces the scroll bar with a zoomed-out/graphic view of the file you’re currently editing. Acting as a graphic replacement to the default scroll bar, the current section of code you’re editing is highlighted, allowing you to quickly identify where you’re positioned in that file. This is especially useful for big files in which you keep scrolling from section to section. As you work, you will recognize the various sections from the zoomed-out image/bar (i.e. sections of comments, big blocks of code, etc), and instinctively jump to them as you progress with your modifications. Additionally, the bar will update itself and show supplementary information as required. For example, if you double-click on a word or variable, it will highlight all the other sections of code that have that same word/variable. Also, RockScroll will show differences in color based on saved/unsaved code.

RockScroll is free and available here.

In parallel, Mihnea Balta has released an open-source and improved version: MetalScroll. Here are some of the improvements, taken from the Google Code page where this nifty variation resides:

  • double-clicking the scrollbar brings up an options dialog where the color scheme and various other things can be configured.
  • the width of the scrollbar is configurable.
  • the widget at the top of the scrollbar which splits the editor into two panes is still usable when the add-in is active.
  • you must hold down ALT when double-clicking a word to highlight all its occurrences in the file. RockScroll highlights words on regular double-click, which can be annoying when you actually meant to use drag&drop text editing, for example when dragging a variable to the watches window. People who prefer the old behavior can disable this in the options dialog.
  • pressing ESC clears the highlight markers.
  • lines containing highlighted words are marked with 5×5 pixel blocks on the right edge of the scrollbar, to make them easier to find (similar to breakpoints and bookmarks).
  • multiline comments are recognized.
  • hidden text regions and word wrapping are supported.
  • it works in split windows.
  • middle-clicking the scrollbar shows a preview of the code around the clicked line
  • it’s open source, so people who want to change stuff or add features can do so themselves.

Whether you settle for the original RockScroll or the improved MetalScroll, you will never want to code without these ever again. Luckily, both are free, so you should definitely check them out, and see which one you prefer.

Happy coding, and Happy Holidays 🙂