Jump to content


Photo

Conformal perspective as an option in TDM?


  • Please log in to reply
21 replies to this topic

#1 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 04 July 2018 - 08:24 AM

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/f...mal-perspective

 

->

 

https://github.com/c...tPerspective.fx


Edited by lowenz, 04 July 2018 - 11:18 AM.

  • nbohr1more likes this

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.


#2 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 889 posts

Posted 04 July 2018 - 09:48 AM

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.



#3 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 04 July 2018 - 11:20 AM

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.


#4 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 04 July 2018 - 11:50 AM

The_Dark_Modx64_2018-07-04_18-47-20.jpg
 
The_Dark_Modx64_2018-07-04_18-47-23.jpg

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.


#5 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8797 posts

Posted 04 July 2018 - 12:12 PM

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


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#6 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8797 posts

Posted 04 July 2018 - 12:34 PM

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


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#7 Spooks

Spooks

    Member

  • Member
  • PipPip
  • 466 posts

Posted 04 July 2018 - 01:29 PM

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/gf...e/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!


#8 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37173 posts

Posted 04 July 2018 - 02:21 PM

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



#9 Abusimplea

Abusimplea

    Member

  • Member
  • PipPip
  • 364 posts

Posted 04 July 2018 - 03:04 PM

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.



#10 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 04 July 2018 - 06:20 PM

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.


#11 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 04 July 2018 - 06:24 PM

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, 04 July 2018 - 06:25 PM.

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.


#12 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 889 posts

Posted 04 July 2018 - 09:25 PM

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.



#13 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 05 July 2018 - 05:29 AM

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, 05 July 2018 - 05:30 AM.

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.


#14 Atomica

Atomica

    Member

  • Member
  • PipPip
  • 77 posts

Posted 06 July 2018 - 07:59 AM

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.


Oh my God! JC! A bomb!


#15 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 06 July 2018 - 11:24 AM

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, 06 July 2018 - 11:39 AM.

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.


#16 Abusimplea

Abusimplea

    Member

  • Member
  • PipPip
  • 364 posts

Posted 06 July 2018 - 01:16 PM

:( - 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.



#17 AluminumHaste

AluminumHaste

    Darkmod Contributor

  • Development Role
  • PipPipPipPipPip
  • 6189 posts

Posted 06 July 2018 - 02:32 PM

Quake2XP has this working and it's open source.

 

https://sourceforge....code/HEAD/tree/

 

https://sourceforge....ke2xp/code/883/


I always assumed I'd taste like boot leather.

 

#18 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 06 July 2018 - 04:08 PM

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.


#19 Atomica

Atomica

    Member

  • Member
  • PipPip
  • 77 posts

Posted 06 July 2018 - 06:24 PM

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.

I was under the impression devs used a narrow FOV because a lot of games were being designed for the console first and PC later, and consoles are connected to a TV that the player is (generally) much further away from compared to a monitor (even if it's a lot larger than the typical monitor), hence you needed a lower FOV so things are shown closer. There's probably other reasons too like not needing to render as much per frame due to the lower FOV, but that's the primary reason.

 

I dunno. I'll probably just have to learn to ignore it. On a fresh TDM install of 2.06 with no config and the resolution set to 1920x1080 (with 16:9 AR), the default selected FOV is 90, and this problem reveals itself. But it's more noticeable in some maps rather than others.


Edited by Atomica, 06 July 2018 - 06:24 PM.

Oh my God! JC! A bomb!


#20 AluminumHaste

AluminumHaste

    Darkmod Contributor

  • Development Role
  • PipPipPipPipPip
  • 6189 posts

Posted 10 July 2018 - 10:30 PM

I think this is what you guys are talking about:

 


I always assumed I'd taste like boot leather.

 

#21 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 11 July 2018 - 02:37 AM

Yes!


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.


#22 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1788 posts

Posted 11 July 2018 - 02:54 AM

Ah, the correction strategy in Q2XP is the same shader I posted :P


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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users