Jump to content
The Dark Mod Forums

Conformal perspective as an option in TDM?


lowenz

Recommended Posts

TDM really suffers from linear perspective deformation (see the moon in the sky when turning :P ), even lowering the FOV.

 

The_Dark_Modx64_2018_07_04_15_25_10_562.image hosting site

 

Isn't worthing some efforts to implement this shader as an engine part with the possibility for the player to choose between the classic - linear - perspective a more "shape-preserving" variant?

 

https://reshade.me/forum/shader-presentation/3916-distortion-correction-conformal-perspective

 

->

 

https://github.com/crosire/reshade-shaders/blob/master/Shaders/PerfectPerspective.fx

Edited by lowenz
  • Like 1

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

Do I understand correctly that this thing works like:

1. You render full frame as usual.

2. You do a full-screen post-processing, which stretches some curvilinear part of the frame output onto the screen.

...?

 

The main problem, I guess, is that we must not distort GUI, weapons, tools, lightgem, text messages, etc.

Link to comment
Share on other sites

It's why I ask if it is possible to avoid the postprocessing shader solution and move the perspective correction to the engine rendering level way before.....no more "correction" at all.

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

Oh, thank you very much for that .fx, lowenz, I'll be adding that to my ReShade config. FoV distortion has been the biggest pet peeve for me in 3D games, it seems it's not a priority, nay, even a consideration, for most developers at all.

 

For another example of working curvilinear perspective in a game engine closer to ours, there is this mod: http://strlen.com/gfxengine/fisheyequake/

 

@nbohr Me, I've toyed with fovRatio plenty. It's not really perfect, if anything it just distorts the picture more.

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

The distortion bugs me too, so I'd be interested in a fix if it won't mess up anything else.

Link to comment
Share on other sites

Is this even fixable in software?

If the FoV is not matching the distance of the player from the screen, the projection mismatch is perceived as distortion. Changing distance from or size of the monitor would fix it as would changing the rendered FoV to the real FoV that the screen occupies from the players position in physical space.

Link to comment
Share on other sites

Out of curiosity, have you tried adjusting r_fovRatio to compensate?

Compensate which scenario?

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

I believe our Bloom post-process happens before the GUI overlay so this could be hooked into that block if so.

But it's always in a postprocessing pass, in a form of correction of the native linear perspective.

My proposal would be to implement the curvilinear perspective as a WHOLE alternative to the linear one, not just correct it.

Edited by lowenz

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

But it's always in a postprocessing pass, in a form of correction of the native linear perspective.

My proposal would be to implement the curvilinear perspective as a WHOLE alternative to the linear one, not just correct it.

It is not possible, due to how OpenGL works.

There is perspective 4x4 matrices, perspective division (clip -> ndc coords), all this is baked into rendering pipeline.

You cannot magically change all this for some nonlinear math, except if you wish to drop OpenGL and implement your own rendering engine directly on CUDA or OpenCL.

With this curvilinear perspective even 3D triangles are no longer triangles on-screen (if I'm not mistaken), so GPU cannot rasterize them as it usually does.

 

The only possibility is to render something in traditional perspective, then bind the obtained picture as texture and perform full-screen post-processing to get bended view.

So you either render player's view as usual and then stretch it, or you render cubemap (much slower) and then apply post-processing to it.

 

If there is a clear place where this postprocessing could be applied, then I guess it won't need much changes in renderer.

If it is so, someone can try to implement it even now (for 2.07) under cvar.

Link to comment
Share on other sites

It is not possible, due to how OpenGL works.

There is perspective 4x4 matrices, perspective division (clip -> ndc coords), all this is baked into rendering pipeline.

You cannot magically change all this for some nonlinear math, except if you wish to drop OpenGL and implement your own rendering engine directly on CUDA or OpenCL.

With this curvilinear perspective even 3D triangles are no longer triangles on-screen (if I'm not mistaken), so GPU cannot rasterize them as it usually does.

 

The only possibility is to render something in traditional perspective, then bind the obtained picture as texture and perform full-screen post-processing to get bended view.

So you either render player's view as usual and then stretch it, or you render cubemap (much slower) and then apply post-processing to it.

 

If there is a clear place where this postprocessing could be applied, then I guess it won't need much changes in renderer.

If it is so, someone can try to implement it even now (for 2.07) under cvar.

Bloom stage, as proposed before, is good but as a postprocessing option it could blur the image in a non-uniform (much more blur in the center of the image) way AND generate some clipping problem at the borders of the scene :/

Edited by lowenz

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

Goddamnit. This isn't something I even noticed before you mentioned it... now I can't seem to ignore it. :(

 

The weird thing is that it seems to be pretty obvious in TDM now that I pay attention to it, but most other games don't seem to have this issue. Either that or I'm just noticing a more "fish-eyed" lens in TDM for some reason.

Large (>80/90) HORIZONTAL FoV causes the issue, in every engine using linear perspective.

Using 16:9 resolutions you must set an higher FoV than good old 4:3 ones, so the issue is always there and sometimes very noticeble.....

 

It's why back in the days devs started using norrow horizontal fov angles (65) - see Crysis 2/3 and so getting a "tunnel vision" :( - but the problem lies in the linear perspective itself.

Edited by lowenz

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

:( - but the problem lies in the linear perspective itself.

No. If you change perspective, you get non-straight lines. They are much more annoying than non-perfect circles.

The real problem here is, that the distance between player and monitor does not match the rendered FoV for most people, because the screens are only occupying a small part of the humand FoV (except when playing on really big screens or with really low distance between screen and player).

Getting a bigger screen (or a VR headset) could fix it. Lowering the distance between player and screen could fix it too. Changing the projection will only make things worse.

Link to comment
Share on other sites

No. If you change perspective, you get non-straight lines. They are much more annoying than non-perfect circles.

I know (see the shader!), but you can tweak the parameters value to avoid a heavy curvature!

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

  • 2 years later...

This is interesting because I recently felt that there was something off about the FOV. By default it's set to 90 but the actual FOV seems more like 105, at least from visual comparison to games like Quake 3 when set to such FOVs. In the bug report linked above, @stgatilov has a comment suggesting the FOV is based off a virtual 640x480 screen (so a 4:3 resolution). This makes sense since in Doom source ports it's convention to have the FOV specified by the user mapped to a 4:3 display as well (reference), so while the default in GZDoom is 90, the rendered FOV is also more like 105. An actual FOV of 90 feels much closer which can be seen in modern games with FOV sliders that tell you the specific horizontal FOV (e.g. Dishonored).

A word of warning, Agent Denton. This was a simulated experience; real LAMs will not be so forgiving.

Link to comment
Share on other sites

3 hours ago, Xolvix said:

This is interesting because I recently felt that there was something off about the FOV. By default it's set to 90 but the actual FOV seems more like 105, at least from visual comparison to games like Quake 3 when set to such FOVs. In the bug report linked above, @stgatilov has a comment suggesting the FOV is based off a virtual 640x480 screen (so a 4:3 resolution). This makes sense since in Doom source ports it's convention to have the FOV specified by the user mapped to a 4:3 display as well (reference), so while the default in GZDoom is 90, the rendered FOV is also more like 105. An actual FOV of 90 feels much closer which can be seen in modern games with FOV sliders that tell you the specific horizontal FOV (e.g. Dishonored).

I agree with this. I play a lot of FPS type games, both retro and newer, and always use the same monitor setup. Most games I crank up to about 100 fov and things look pretty good for my setup to my eye. TDM looks higher than that at its default of an apparent 90 degree fov. Its the only game I actually turn down to 80, even 85 makes a surprising difference. It does feel somewhere slightly over 100 by default to me as well.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...