could anyone give me some advice about how to make a carpaint shader that have realtime reflection? thank you!
What about http://unity3d.com/support/documentation/Components/shader-ReflectiveSpecular.html ? Or are you talking about reflection of dynamic objects?
hi,martin thank you for your answer, the built-in shader named reflective specular that you mentioned needs a cubemap for reflection and just reflect the environment I give it,but if there are other dynamic gameobjects in the scene,my shader should have a reflection both of the environment and those dynamic gameobjects just like the car surface material in the real world,does reflection of dynamic objects that you mentioned helps?If it will do some help ,could you tell me where can I get some information about how to make it or would you give me some advice about it?
The usual approach (in rasterization graphics) for small objects is to render the scene (without the reflecting object) into a cubemap as seen from the center of the reflecting object. See: http://unity3d.com/support/documentation/ScriptReference/Camera.RenderToCubemap.html For a car with objects close to the car, this might not work particularly well. Also, there won't be any "self-reflections". (As far as I remember Pixar started to include ray tracing into their REYES engine for the movie "Cars" in particular for reflections of the "eyes" of the cars.)
thank you for your help. So I can only use the "reflection specular" shader and use a cubemap to reflect the static environment?
For best performance, using cubemaps is probably the best approach. In theory you also have the option to encode your whole scene in uniforms and textures and then program a ray tracer in the fragment shader, which computes the reflections. (And I think this idea is not as crazy as it sounds but it depends very much on your scene.) There are even more theoretical options but I cannot see how they could be implemented with reasonable performance in Unity.