Forums
How to add back mirrors - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Community (https://www.vdrift.net/Forum/forumdisplay.php?fid=3)
+--- Forum: Help (https://www.vdrift.net/Forum/forumdisplay.php?fid=5)
+--- Thread: How to add back mirrors (/showthread.php?tid=1313)



How to add back mirrors - duc_ttm - 07-13-2010

Hi,
I have tried to search if VDrift supporting displaying back (rear-view) mirrors but could not have found any thing. Have they not supported?
If so, could you tell me how to (change the code or do some thing else) to add back mirrors (both side mirrors and room mirror) to the HUD (or car model or somewhere else).
Thanks and regards.


- joevenzon - 07-13-2010

There's support for assigning a control to a temporary rear view, but it just shows you the rear view as long as you hold the button down and then returns to the front view.

We do render a rear view all the time if you have reflections set to high, so it wouldn't be too tough to add code to display that somewhere.


- duc_ttm - 07-15-2010

Oh, thank you very much!
Hight reflection may be very good idea :-)
Will try it


- duc_ttm - 07-21-2010

Hi.
I am thinking about creating the rear-view mirrors as following:

- Step 1: Enlarge the Field of View so that the room mirror and side mirror are moved into the screen
- Step 2: Set the texture of the mirrors so that they will have a 100% reflection.

But I don't know how to do the Step 2, I tried to change the body-misc1.png image but it seems to be not effected. (The thing is that it is slightly reflexed but very very difficult to see...)

[Image: shot003.jpg]

Could you show me how to do the Step 2 with the best quality?


- joevenzon - 07-24-2010

Hmm, the most reflective you can get with the current shaders is to make the diffuse texture black and the misc1 texture white. If that doesn't work, we will need some other way to mark the object as fully reflective so the shaders can treat it specially.


- duc_ttm - 07-24-2010

Thank you for your reply.
May be I have to think about a different way.

joevenzon Wrote:We do render a rear view all the time if you have reflections set to high, so it wouldn't be too tough to add code to display that somewhere.
Considering your above statement, I would like to have two questions:
- Could you tell me which VDrift version is supporting the above function (I am using the 2009-06-15) ?
- Where is the rear-view buffer? Can I use glCopyTexImage2D to copy it to the texture of the mirror ?


- joevenzon - 07-24-2010

I don't think the 2009 release supports realtime reflections. You need 2010-06-30, and you have to set the reflection quality to "high" for it to work. You should get this release and give it a try with the misc1 set to white and see how well that works before trying something more complicated. It may give you exactly what you want.

The rear-view buffer is in a framebuffer object on the GPU and is already available for use as a texture.


- duc_ttm - 07-24-2010

Thank u thank u many more!!!
The 2010 version has a very dramatic car reflection.

That is the result after upgrading the mirrors:
[Image: shot005.jpg]

The right mirror may look down so it has not enough light to show.
....
B......b.....but I like slightly more and more reflection for the mirrors.
Can we have the Blue channel of the misc to distinguish reflective effect...
Sorry because I have no experience about shader.
Could you show me how to.....


- joevenzon - 07-27-2010

I'll look at doing something like that.

Hmm, it might be tough to get the mirrors pointing in the correct direction. Any ideas for that?


- duc_ttm - 07-28-2010

Thank you for considering this issue.

For the direction of the mirrors, I am thinking about creating the joints between the body and mirrors so that we can control the mirror direction from keyboard.

I haven't understood exactly the code but I think it is something like the joint in Bullet and/or like the joint between the body and wheels...

If I can help something, please tell me, I also like to develop this program very much...


- NaN - 07-29-2010

Hi duc_ttm,

Quote:control the mirror direction from keyboard.
I think that is overkill. It should be enough to be able to set mirror position, orientation in the car config file.

There are plans to support more carparts(like we are doing for the wheels/tires). I just haven't had the time to implement it. http://vdrift.net/Forum/viewtopic.php?t=1351


- duc_ttm - 08-01-2010

Thank NaN very much for the suggestion.
But I am wondering why the Mini Cooper has a very good reflection on the room mirror while TC6 or CT could not (although having the black diffuse and white misc).... ???
You can see it if set the exterior painting to black.