XaiJu
x4fab
x4fab

patreon


Vertex AO for cars

Do you have that one well made mod which however doesn’t have AO baked into it, and UV mapping is not good enough for a quick fix? Or maybe some Kunos car bothers you a bit with its flat look? Great news! Turned out that bakery using NVIDIA’s OptiX Prime is great for baking AO for cars, it’s fast and, in most cases, surprisingly good-looking.

All the advantages are here: it’s zero FPS cost, doesn’t require extra RAM, bakes any mesh, doesn’t care for UV or materials and only affects reflections and ambient lighting. And adapted for cars bakery loads and uses animations, rotates wheels and steering wheel, bakes blurred rims, LODs and low-resoltion cockpit properly.

Notice how steering wheel looks. This way, it wouldn’t look strange when rotated. What I found especially interesting though is that it helps even with some of Kunos cars, especially with interiors of some of them: comparison for Porsche 911 GT3 Cup 2017.

There are a couple of issues though: first of all, it requires GPU supporting CUDA for baking (I’m working on CPU-only option, but while CUDA baking takes seconds, casting more than million rays per second, CPU baking would require tens of minutes). And another problem is that most interiors look way too dark with AO applied. That’s why now Vertex AO patches can also define shader adjustments, increasing ambient brightness by factor of two or so. Plus, now Vertex AO got gamma option, allowing to adjust brightness more carefully for complicated cases. But in general, now, there is a tool allowing to make this change  fully automatically and just in half a minute (I couldn’t bake this car in particular before no matter how I tried, its exterior mesh is just unmappable). Also, of course, it might fail and look buggy with some meshes, but from what I found so far, in almost all cases, it does the job nicely (unlike my silly bakery for tracks, that OptiX-powered monstrosity takes samples not in vertices, but along the surface; it’s basically this tool, but adapted to work with AC models).

Average patch for car with LODs weights about 500 KB, I’m thinking soon CM could download those automatically when necessary, similar to vertex AO patches for tracks.

Vertex AO for cars

Comments

You got “main_geometry.vao-patch”, right? Just leave it in car’s folder. It has AO for all LODs and driver model as well. (Just in case, when baking, please launch bakery and then select main KN5 from car’s folder, don’t move it next to EXE-file. This way, bakery will detect other LODs, driver model, car data and animations.)

Ilja Jusupov aka x4fab

I am trying to apply this to a car, but i am not sure where to put the generated vao file, and how to make CSP use it? sorry if i am overlooking somthing obvious

Also, I have to add, in preview198, vertex AO also affects dynamic lighting, which is a mistake (similar thing, makes tunnels unlightable). Fixing that right now.

Ilja Jusupov aka x4fab

The way shaders are set, they use minimum value of HBAO+/SSAO and vertex AO for ambient lighting (since I apply HBAO+/SSAO during main pass rather than in post-process, it’s an easy and cheap thing to do). For dynamic lighting, only HBAO+/SSAO is used. For reflections, have to admit, I’m still thinking about it. So far, it’s “min( VAO × 2, SSAO )”, but that means there’ll be no reflections in fully black tunnels, and yet dimming reflections in very dark areas of cars looks great. I think I’ll try to make it behave differently for cars and tracks.

Ilja Jusupov aka x4fab

I find the vertex AO will cancel the HBAO+ post-process effect, make it look weird in many way . The calculated result seems only lights from the sky, make it too dark for most car's instrument area. Is there any conflict between Vertex AO and HBAO+/SSAO?

allensakura

That Porsch 911 comparison is crazy ! Nice one, especially since it won't cost FPS afterwards :)

That's just amazing! Can't wait to test it out!

Jone Klemo Øverland


More Creators