The online racing simulator
#1 - Juls
Perspective distorsion correction (useless experiment)
Edit: This is useless. Do not even try it. As crazy as it seems, the result is the same than moving the camera 25 centimeters backwards....but obtained without actually moving the camera.

Here is another experiment.
This dll introduces an FOV changing with distance.
Far away, FOV is the same as specified in LFS interface.
But as you look closer, FOV increases, up to three times for objects very close from the camera.

Advantages:
- you can see both mirrors from 60-70 degrees FOV instead of 90. At 80 degrees FOV you can see a lot on the sides like with 120 FOV, but track looks a lot bigger, not anymore like a tunnel.
Distance estimation is easier, far objects are easier to spot.
- it reduces perspective distorsion, car cockpit stretches far less when you turn your head.



Just unzip the d3d8.dll close from LFS.exe (save previous d3d8.dll if there is one there...maybe you have another similar mod...). Delete when you want to remove it. Does not change anything in LFS install.

Forgot to say...you have to disable Haze effect in Graphics for it to work properly.

Default view, 90 degrees FOV:


New view, 90 degrees FOV:

Far range FOV is still 90 degrees, but close range FOV is larger.
Camera position is unchanged.

For people interested, discussion about FOV:
http://www.lfsforum.net/showthread.php?t=27179
Attached files
d3d8.zip - 36.6 KB - 221 views
looks interesting, trying it
Loving this kind of experiments, but:
LE: Nice fog.
Attached images
lfs_00000046.JPG
fog.JPG
Quote from Ovidiu23 :Loving this kind of experiments, but:
LE: Nice fog.

Disable haze effect... but this should be fixed
Still there are bugs, it seems it needs to disable driver too.
Attached images
sss.JPG
#6 - Juls
Yes many problems with objects close from camera. Increase FOV or disable driver or move camera forward. That's why it is an experiment
I know, that's why I posted them... for the purpose of being resolved if you can.
Quote from Ovidiu23 :Still there are bugs, it seems it needs to disable driver too.

Since it's not fixed oficially, you can "improvise" a fix. Go to your view options and change your Z offset to around 0.115.
I thought it was interesting at first, but I think if you move the camera forward to compensate, you end up with everything the same as it looked without the dll.
Attached images
FOVdllOFF.JPG
FOVdllON.JPG
What does this actually do?

Other than giving you a bigger FOV at 90 degrees FOV... Quite what the purpose of that is, I'm not sure, because what is wrong with simply increasing the FOV anyway?

Or am I missing the point?
-
(NightShift) DELETED by NightShift
a bigger field of view w/0 the distortion. i like!
#12 - Juls
Quote from JO53PHS :What does this actually do?

Other than giving you a bigger FOV at 90 degrees FOV... Quite what the purpose of that is, I'm not sure, because what is wrong with simply increasing the FOV anyway?

Or am I missing the point?

When you increase FOV, let's say to 120, objects far away shrink. It makes distances difficult to evaluate, cornering more difficult.

With this gadget, if you chose FOV 90, FOV is really 90 degrees far away, so track keeps it's normal size. But FOV increases close from the car. So you can see more on the sides like with 120 degrees FOV. So you have advantages of large FOV to see more on the sides, without inconvenients (far objects shrinking). Second advantage....objects are less distorted when they get closer from monitor side.
Quote from DaveWS :I thought it was interesting at first, but I think if you move the camera forward to compensate, you end up with everything the same as it looked without the dll.

Interesting. So the dll is effectively an "FOV = Options Menu + 15°" hack?
-
(AndroidXP) DELETED by AndroidXP
#14 - Juls
There is something wrong with your screenshots. There is no way I can get the same view with dll on and off, even with camera moved full forward. I think you somehow disabled the dll in both screenshots.

Here is the default LFS view, I chose FOV to match exactly the FOV from your screenshots (palmtree on the left, writing on the right). I have bigger horizontal FOV because I have different aspect ratio but we only look at horizontal FOV.

And second view with the DLL on, and camera moved full forward. No way it can give the same view. Notice how mirror is less distorted, how the windshield shape is more square too, and the windshield border does not hide the same part of the landscape than in previous view too. Notice how the short range ground changes between the two screenshots while far range remains unchanged.
Attached images
lfs_DLL_OFF.JPG
lfs_DLL_ON.JPG
Quote from tristancliffe :Interesting. So the dll is effectively an "FOV = Options Menu + 15°" hack?

No, it's effectively a move viewpoint 0.250m or so back from original LFS viewpoint.

Quote from Juls :There is something wrong with your screenshots. There is no way I can get the same view with dll on and off, even with camera moved full forward. I think you somehow disabled the dll in both screenshots.

Here is the default LFS view, I chose FOV to match exactly the FOV from your screenshots (palmtree on the left, writing on the right). I have bigger horizontal FOV because I have different aspect ratio but we only look at horizontal FOV.

And second view with the DLL on, and camera moved full forward. No way it can give the same view. Notice how mirror is less distorted, how the windshield shape is more square too, and the windshield border does not hide the same part of the landscape than in previous view too. Notice how the short range ground changes between the two screenshots while far range remains unchanged.

There is nothing wrong with my screenshots, you need to use custom view to allow you to move the camera forward enough.

I've taken 2 more screenshots, at 640x480, both with FOV at 90 degrees. Both are taken in custom view, with wheels and body on, and driver arms and wheel on to simulate cockpit view. The first screenshot is without the dll. The second is with the dll, but with the view moved forwards 0.250m.

Like I said to Tristan, all I can see this does is move the graphical viewpoint something like 0.250m (depends on your FOV, but it's 0.250 for 90 degrees) backwards from the original viewpoint that LFS thinks you have, hence why the reflections on the car look different. If you want further evidence, move the rotation slider around and see how the view pivots 0.250m around the original viewpoint.
Attached images
FOVdllOFF.JPG
FOVdllON.JPG
Interesting, I'll test it out in a while.

Idea for further development: larger fov when looking to sides -> safer driving.
#17 - Juls
Haha, you are right. It looks like I managed to obtain a translated view without moving at all the view point. I explain:

In games, world coordinates are projected on screen. To do so, x and y coordinates are divided by z-> objects get bigger when they get closer (z->0)...infinitely bigger when z reaches 0 ->distorsion.

To moderate the distorsion, I change the projection matrix to divide by a*z+b (a,b positive constant). This is a mix between an orthographic projection (objects size unchanged with distance for a=0 b=1) and classic perspective (a=1 b=0).

Then when z->0, objects become larger but not infinitely.

I update the other components of the matrix to keep the same clipping planes, the same FOV far away, and I calculate a and b to get 3 times more things displayed on the nearest clipping plane.

And finally, as you say, the result is like looking from 25 cms back, but without actually moving the camera (I do not change anything in camera, only the final 3D->2D projection). Like being out of your body.

This is very strange, because if a=0 and b=1 then I have an orthographic projection which is a really very different projection without perspective. But as you say as soon as I introduce a very little part of perspective (a>0) it becomes immediately a full perspective projection, translated. I was trapped by this.

I suppose it comes from the way I mix perspectives, because many ray tracing programs use what they call weak perspective...a kind of mix between orthographic and perspective. Maybe it can not be achieved with a projection matrix like directx uses.

Fail. All this matrix stuff to get a translation...loss of time.
Quote from Juls :...

Hehe. Thanks for trying to explain, I think I understood most of what you said. An interesting experiment regardless though.
Quote from Juls :This is very strange, because if a=0 and b=1 then I have an orthographic projection which is a really very different projection without perspective. But as you say as soon as I introduce a very little part of perspective (a>0) it becomes immediately a full perspective projection, translated. I was trapped by this.

hm im a bit puzzled by why a doesnt seem to have any influence on the perspective... are you sure you apply it correctly?

that b has the same effect as moving the camera is pretty obvious though since all youre doing with it is adding a bias to the z values
#20 - Juls
Quote from Shotglass :
that b has the same effect as moving the camera is pretty obvious though since all youre doing with it is adding a bias to the z values

Yes but it was not so obvious. The projection matrix scales x, y and z, and calculates w using x,y and z. Later, x, y and z are divided by w.

I do not add a bias to z, but to w...
Quote from Juls :Yes but it was not so obvious. The projection matrix scales x, y and z, and calculates w using x,y and z. Later, x, y and z are divided by w.

this kind of sounds like youre applying the transformation through 'a' twice

Quote :I do not add a bias to z, but to w...

isnt that the same? hard to say without seeing the equations
I don't think this .dll was a complete fail. It did _something_, but it was hard to position the viewpoint the way i like it. When looking to sides my view was blocked by the windscreen..

FGED GREDG RDFGDR GSFDG