AutoViz in HDRP – Part 1

This is the first of a series of posts on Automotive (and similar) applications for real-time engines such as Unity.  In this part, I’ll go over the basics of HDRP in 2019.1, some rendering tricks, colour grading and points of interest to do with advertising.

Porsche-935-Retro-Liveries-860x486
A typical use for automotive visualization; pixel-perfect alignment of the different versions and clean presentation. Porsche 935 (2019), Porsche AG.

First of all, the most interesting change to 2019.1’s HDRP is the move to Volumes for EVERYTHING.  All the skybox, ambient lighting and fog information is now in-scene, in a volume profile.  Very useful!  Personally I’m using 2 volume profiles ‘per-area’.  One for environment; lighting, fog, SSAO, SSR, etc.  One for post-processing; colour grading, vignetting, etc.  You could also use a third for Bloom, Chromatic Aberration, Exposure, and other Camera-Based effects, but I fold them into the other two fairly easily.  Some notes here: you should always use the new Panini Projection effect.  Always.  It’s great, like a more natural fisheye effect, makes the image look a lot better as the FoV creeps up.  And always have a SSR panel set up for custom settings, since the default ones are rubbish.

Bronze_720
The Lexus LC-500 is a wonderful car to render.  The sharp modern detailing and very exaggerated, almost retro proportions mean it looks great in any environment and colour.

The star for this post is the Lexus LC500.  It’s a modern, stylish luxury coupe and while the 3d model isn’t top notch it’ll serve for now.  As a premium brand, the paint options available are great to work with; pearlescent white, metallic finishes, bold colours, and some varied materials such as chrome, plastics, glass, and fantastic lighting elements.

For advertising, special editions (like the Zinnia Yellow LC 500, below) are a major point to consider.  Often these are premium versions, with extra equipment, and at a higher price point, so manufacturers will want to add extra emphasis and differentiation over the regular model.  These can be more likely used in print (opposed to digital) media, and there’s tricks to taking advantage of that.  For example, take the vertical image (below, top-right).  Lexus, a top-tier brand, is likely to pay more for a better ad position; ideally a full-page on the right side.  To reflect that, the lighting in the scene is biased to be from the right hand side as well; the side of the page ‘open’ to the viewer, while the darker side is towards the spine/seam.

Blue_720
Strictly speaking this wouldn’t be suitable for advertising as I’ve recolored the wheels.  Yes, someone has already noticed this and pointed it out to me.

Rendering for web use offers its own set of tricks.  Some of them are just plain simple – a monochromatic image will take up much less bandwidth for a given resolution.  Or for a given resolution, offer much higher image quality.  And by using a high-contrast image, it becomes easier to view in the wide range of lighting conditions mobile users are likely to encounter.

One increasingly-common part of rendering cars is dealing with pearl-effect paints.  These are highly view-dependent, and the more subtle effects get lost very easily.  Considering that the distance between the eyes, and the proximity of the light, it’s strange to think that the colour will not ‘resolve’ for a point on the car.  Each eye will see a slightly different hue/brightness.  My solution is to have a slight offset, in view space, of red, green and blue lighting components, no more than a few degrees.  This gives the pearl some ‘pop’ back; in the image below notice the tinted highlights near the headlight, and colour fade toward the windscreen.  Technically this isn’t 100% physically correct, but it’s fast, simple, and gives that slight strangeness back to pearlescent colours.

LC_500_W_720

Finally, one of the more unorthodox uses is creating stylized or non-photo-realistic (NPR) images.  Typically these are high-contrast, low-colour-depth pictures that mimic some existing medium (water-colour, stencil/print, etc).  You can build these fairly easily, with existing filters in Photoshop or Gimp, whatever has layers and blending options.

You can also create these in Unity.  With HDRP and access to a Main Camera outputting to a render-texture, you use that as input to a Shader Graph Editor (SGE) graph.  From there, you can sample that multiple times, blend layers, apply masks, filters, etc and output that to a fullscreen quad.  The ‘blend’ node in SGE is your friend.

abstract_720
Going beyond the photo-real, you get into the highly-stylized images.  These don’t have much real purpose beyond being a background or screensaver, but can be interesting to generate anyway.
LowBlue_720
Slightly back towards the realms of reality, you can render in a limited colour space, then remap that into your own.  For example; I’ve used a gray-scale brightness value a the input, and colored the image based on the following formula: c = (0.5,0.8,0.9) ^ (32 * (1-in)).  You may recognize this as being similar to the light absorption equation used for water, and it is!  Here, it gives a gorgeous deep ocean blue effect to the car paint and background.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this:
close-alt close collapse comment ellipsis expand gallery heart lock menu next pinned previous reply search share star