Paint metallic

Started by
1 comment, last by JoeJ 4 years, 6 months ago

Hi. I want make metallic shader for cars. I use DirectX 9.0 and shader model 3.0.
I want understood what characterizes the material as "metal".

I use cubemap reflection and as to mix colors?

```
float3 ReflectionVector = reflect(CameraDirection, PS.Normal);
float4 Reflection = texCUBElod(gReflectionSampler, float4(-ReflectionVector, 2.5));
Reflection.rgb *= Reflection.rgb * Reflection.rgb * gVehicleColor;
```


I tried to multiply the reflection by itself three times and then multiply by the color of the car. The reflection becomes very blue (when black is used on car) and looks very unrealistic, white looks dirty, has nothing to do with reality.

As I understand it, I need flakes for specular reflection and roughness map.

But I still have a few questions. The main one is how to correctly mix color of reflection with the color of a car and how to implement metallic color simulation?

Advertisement

Found this on quick google search: http://www.chrisoat.com/papers/Oat-Tatarchuk-Isidoro-Layered_Car_Paint_Shader_Print.pdf

Doing this correctly might be harder than you think. While we have some basic understanding of how to model approximate reflection for simple materials, which is already complicated: https://learnopengl.com/PBR/Theory

It becomes very complex for multi layered materials like car paint, which has a clear coat layer on top.
So we could model each layer as its own simple PBR material and blend, but this misses how light interacts between those layers.
Usually that's no big problem, but just to explain why material shading will remain a research topic forever, why different people come up with different approximations, and why there is no single true answer about correctness.

However, as long as the material is conserving energy, we can always claim we have invented an artificial material that could exist in reality and would look like shown.
In contrast, if we make a material shader that emits more light than it receives, and we plug this into a radiosity solver to compute correct GI, it could blow up.
This makes energy conservation probably the most important and non subjective factor to judge correctness and realism.

This topic is closed to new replies.

Advertisement