Update Reflection Vector after Displacing Tessellation Verticies

Hello,

I’ve modified M_Carpaint from Epic’s Automotive Materials pack to allow the application of damage stamps to my cars. These stamps include world displacement to represent dents. I’m also using a scene capture cube to create real time reflections.

This all works quite nicely, except that the Reflection vector does not update after I add displacement for dents. This makes the dents nearly invisible. Is it possible to update the reflection vector for the displaced vertices? If so, how can I do it? (Note: performance here is no issue)

My damageable car paint material graph is below showing all the nodes that handle vertex displacement, stamp drawing, and dynamic reflections.

Thanks!

Recalculate your world normal, using the data, involved in displacement, and plug it into custom world normal slot of reflection vector.

I tried this, and it didn’t work. Passing the displacement into the custom world displacement changed the normals everywhere. It was a neat effect and made it look like the car had adaptive camo, but it didn’t actually fix the reflections.

Thanks for the suggestion though!

So I figured out something that kinda worked. I took the value I was feeding the world displacement and divided it by 4. I then added those normals to the output of the reflection vector node prior to the connection to the scene capture cube’s texture. You can see my altered graph below. I’m not totally convinced that the effect is correctly distorting the reflection, but it looks good if you’re not staring too closely at it.

Here’s the modified graph

Here’s an example of the result:

Notice how the parking line now curves around the dent (raytrace identifies the location the dent was applied).

I’m still really interested to know if anyone knows how to get the reflection to change properly, so I’m leaving this open for now.

Thanks!