Car mirrored shader

someone can help me telling me about how to make a car mirrored shader, like when the car reflect the objects around?
Its possible?
I know about the mirror script, but, how can I implement it for a car for example?

The trick with the mirror script, and real-time mirrors in general, is it takes a fair amount of resources just to make a single reflection on a single plane. For a non-flat surface, you would need to make a different reflection for each tri in the object which would murder your framerate. Also, there’s the limit of 1 mirror per scene to deal with.

Most games generate a cube map for each area, and just switch to using whichever is the closest. (for example, take a look at the reflections in the scope of the crossbow in HL2 as you walk from room to room)

Alternately, and I’ve never seen this done before (probably because it would most likely look like crap) you could have a mirror plane that renders your reflection to a texture, and then project that texture onto your car. You can do that simply by using the same texture on both the mirror object and the car, but only running the mirror script on the mirror object.

you never saw on blender you mean right? I just want to know if there is a way to make it on blender , it will be very nice if we have it, its almost essential to make a good quality car game.
Thanks so far

It is currently not possible in realtime. But the BGE devs are working on it, I think.

You can make a fake reflection. Just UV as usual. In UV/Image Editor -> Image Realtime texture mapping -> reflection.

It looks quite cool, but do not expect realistic reflections.

This is an example of how to make it, but im having problems with the UV, I need to figure out how to make the UV works withe mirror. take a look at the blend, the reflection is a little incorrect unfortunably!
thanks for the help till now

the reflection here is mutch more accurated but I dont know why the botton part of the car shows up on the mirror

someone knows how this mirror script works? i think that it simulate a camera or something like that and make it go to the mesh because its UV, there is a way program this to make the image reflected dont get the botton part of the car?

SO it s really impossible to a decent real time reflection on BGE(for a car)?
I dont really know yet, I try this solution but I dont have too mutch succes on that since the script get the lower part of the car on the reflection, I dont understand why.
If someone cold give an idea or something or just say that it s impossible, i ll really appreciate.

The reflection shows the lower part of the car because of the UV Map. Try unwrapping the car differently maby Cylinder from view or any of the other.

thanks weeman i tried a lot of uv stiles and the botton of the car appear allways, I think that its not very easy to implement this, since the problem is linked with the bge itself, and as captain oblivion said maybe if someone create another kind of script that runs on all the faces the framerate will drop considerably but because of the bge.not because it is isnt possible.
thanks everyone for the help if someone find a way to make it please share with use.

I’m not really sure (I’m in a hurry now), but it has serious alpha issues, that’s why some part disappear, try making it all opaque, or start separating the mesh depending on the material. Also double check the normals orientation just in case.

Okay played around with your file, I modified a previous version, this is what I did:

-The reflected texture Map input I changed it from UV to Norm, at least I find it more interesting to look at (probably not accurate at all with reality but what the hell looks nice).

-since you were worrying about realistic looking, I changed the reflection texture instead of mix to add, and made the material red, so it has a red paint look.

Hope you like it better.

Side note:
since the car is reflecting what surrounds it, and the frame buffer is planar, maybe you should make the reference object that detects the environment to point in a direction contrary to the one you are looking at, in this case making a camera that looks at what is behind the car, and this texture render it i the car to make it look like it is reflecting what is behind it, isn’t it?


car shader mirrored2.blend (647 KB)

yeah, thank cloud GL sorry about the delay in answearing your reply, I was on my parents house.
Now the paint effect is mutch more realistic, the problem is this reflection, i think that with this script we ll not have sucess on this reflectiong stuff.
Thanks a lot for the help!

HEY …here is a modification.reflection with texture…
not a script modification…just a simple thing… download to see

thanks Blending BGE, its mutch better than mine, but the reflection isnt is perfect, we ll need a specifc script for that i think, or an inplementation on the bge!
Thanks for everyone that helps me here!