Mods / Panini Projection

Tags:
Utility Accessibility
Author:
Cheeki
Side:
Client
Created:
Feb 28th at 2:21 PM
Last modified:
Mar 3rd at 3:31 AM
Downloads:
439
Follow Unfollow 64
Latest release (for Vintage Story 1.21.0-pre.1 - 1.21.6, potentially outdated):
PaniniProjectionV1.0.4.zip  1-click install
For testers (for Vintage Story 1.22.0-pre.1 - 1.22.0-pre.3):
PaniniProjectionV1.0.5.zip  1-click install

Use .paniniconfig in game to change settings

Fullscreen shader that transforms the game rectilinear projection into a panini projection. Useful if you play at high FOV values.

Since it transforms the rendered image, the center of the screen might appear pixelated. Increase resolution scale if this bothers you, at a performance cost.

The projection blend setting blends the center of the screen with the normal rectilinear projection, included just for fun. Keep it at 0 if you want accurate panini projection.

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.0.5 paniniprojection
1.22.0-pre.1 - 1.22.0-pre.3
90 Mar 3rd at 3:31 AM PaniniProjectionV1.0.5.zip 1-click install

1.22 vers

configlib support

fixed default values

1.0.4 paniniprojection
1.21.0-pre.1 - 1.21.6
149 Mar 3rd at 3:31 AM PaniniProjectionV1.0.4.zip 1-click install

1.21 vers

configlib support

fixed default values

1.0.3 paniniprojection
1.22.0-pre.1 - 1.22.0-pre.3
20 Mar 2nd at 2:45 AM PaniniProjectionV1.0.3.zip 1-click install

1.22 vers

fixed block and entity selection to be in line with the projection

1.0.2 paniniprojection
1.21.0-pre.1 - 1.21.6
47 Mar 2nd at 2:45 AM PaniniProjectionV1.0.2.zip 1-click install

1.21 vers

fixed block and entity selection to be in line with the projection

1.0.1 paniniprojection
1.22.0-pre.1 - 1.22.0-pre.3
32 Feb 28th at 2:23 PM Empty PaniniProjectionV1.0.1.zip 1-click install
1.0.0 paniniprojection
1.21.0-pre.1 - 1.21.6
101 Feb 28th at 2:23 PM Empty PaniniProjectionV1.0.0.zip 1-click install

24 Comments (oldest first | newest first) (threaded | flat)

Cheeki , Mar 15th at 3:22 PM

Vwert

the issue with the rift invisibility is an easy fix. however they will still be projected using rectilinear and fixing that is non trivial, i tried some stuff that came to mind to no avail, and i do not have enough interest to make it work properly.

so the solutions right now is they are either invisible or they do wonky shit when the camera moves around. regardless, their actual visual positioning would be inaccurate unless you are looking straight at them. neither is a good solution.

as for the projection warp breaking down at high fov, it's a limit of the full screen shader.

Vwert, Mar 13th at 11:01 PM

Also the projection starts warping above 115 fov on a 32:9 monitor for me, also it seems more zoomed in than the equivalent rectilinear projection but that might just be because the projection is different.

Cheeki , Mar 13th at 6:59 PM

Vwert

yep. confirmed. i'll fix it (soon)

Vwert, Mar 13th at 4:35 PM

This appears to make rifts invisible for me.

Cheeki , Mar 5th at 7:02 PM

Jakobo

not anything that is feasible by a single unpaid dude with minimal interest

Jakobo, Mar 5th at 2:11 PM

love it so much, do you think there may be possible optimizations?

Karul, Mar 4th at 6:45 AM

Great work, a must have mod for me. Thank you!

Cheeki , Mar 3rd at 9:56 PM

SillyPrincess

have you tried latest version? lol

SillyPrincess, Mar 3rd at 9:55 PM

Hi, I don't know if my two cents are worth anything but I have experience with rendering. The issue with misaligned aiming is caused by your shader applying its changes after the game calculates any rays for collision. There aren't really any satisfactory solutions to this problem - it's kind of the reason why rectaliniar projection was chosen. Panini works fine for something like an FPS where the point of interaction is always centered in the projection. But VS (and a lot of other games) let you move your mouse around the screen to interact or collide with stuff. So you either have to align mouse movement with projection, which is gonna feel weird, or you have to do ray tracing after projection, and that's a buggy nightmare. I don't think it would be impossible to do ray tracing after projection transformation, but I've never done something like that. I've only ever done collision in coordinate space, not projection space, so I'm not sure how to fix this. I also wouldn't be surprised if it's expensive because you would essentially have to keep a second transformed copy of the gameworld on hand anytime you want to do ray tracing for collision. Light rays in panini space don't follow straight lines, so it's not going to be as simple as "do it like rectalinear but in panini." Rectalinear converges to a point in the center of the screen and that gives you a lot of advantages in calculation, but Panini converges on a squared ring around the center of the screen, so it's inverse matrix is going to be more complicated to calculate than in rectalinear.

Two easy options come to my mind: a killswitch that enables you to turn off panini and go back to rectalinear, something like the unlock cursor key that you hold down. It could be visually jarring, but including something like a vignette that darkens the warped edges would probably defeat the purpose of creating the option to facilitate screen movement.
Another option would be some kind of particle effect that shows in world where you are aiming. Yes, it will still be misaligned with the mouse, but the player will at least have immediate feedback, which is more important. It would only have to show when the mouse is unlocked so it shouldn't be too intrusive being a particle effect. If you do this, I would justify the particle's size to the screen size so that they are always small no matter if you are aiming at something close or far.

Another idea came to mind. Maybe it would be cheap to calculate your azimuth in panini, convert it to rectalinear, and then peform a ray trace with that azimuth in coordinate space instead of whatever the game wanted to use. There should be some 3rd order equation out there that describes how to do this in general, and its probably buried in a dusty mathbook at the bottom of Cambridge. Maybe ask some linear math nerds if they can think of anything.

Maybe as a suppliment you could hack v and h fov into the game, because at the moment i believe all you can control is vfov. This would get around any rendering-collision issues, and give people an option to help control the nausia-enducing effects of rectalinear. I think that's the main reason somebody would want something like Panini so something else that gets it done is just as good.

I hope that gives you some ideas. 

Cheeki , Mar 2nd at 10:19 PM (modified Mar 2nd at 10:23 PM)

jvaler

shit my bad. i didn't notice i set it to 2x by default in the code, i'll fix it next update when i can be arsed to make a configlib patch for this (soon)

jvaler, Mar 2nd at 9:53 PM (modified Mar 2nd at 11:49 PM)

the mod page should probably warn people that this doubles your resolution scale by default lol. as it is it sounds like an optional suggestion, and i got very confused why my performance was tanked by like 40% lmao

Feyd, Mar 2nd at 1:41 AM

OrekiWoof thank you for this! I'm going to give this mod a try for sure. The standard FoV settings are a bit lean. 

Cheeki , Mar 1st at 4:23 PM

Aarkan

i am aware of this, and i am looking into it

Aarkan, Mar 1st at 3:34 PM

When holding down alt to unlock the mouse cursor it doesn't seem to align the highlighted voxel to the mouse location. It's making clay forming kinda difficult for me.

OrekiWoof, Mar 1st at 1:39 PM (modified Mar 1st at 1:40 PM)

I was wondering how it would look like in VS after seeing that one video on YT, thanks for this

Feyd I don't have an ultra wide, but I made my window shorter to try, to me it seems good, here's a static comparison gif (during live gameplay it looks even better when moving the camera):

Cheeki , Mar 1st at 11:06 AM

Feyd

i dunno. you tell me. i run a 16:9 monitor.

Feyd, Mar 1st at 5:18 AM

Is this mod designed for ultrawide displays? I run VS 3440x1440 and can never find a FOV sweet spot.

Cheeki , Feb 28th at 9:55 PM (modified Feb 28th at 9:56 PM)

Stern

indirectly. i was asked to do it by other people. i have no interest or use for this, but people seemed to want it so...

Stern, Feb 28th at 9:45 PM (modified Feb 28th at 9:45 PM)

I wonder which youtube video was the genesis of this, cant possibly imagine, cool to see a nich implementation ;).

Xpopy, Feb 28th at 8:35 PM (modified Feb 28th at 8:44 PM)

I've always wondered why panini projection wasnt more common. This is really amazing, thank you!

Cheeki , Feb 28th at 5:52 PM

Skabbit

.paniniconfig in the game's chat

Skabbit, Feb 28th at 5:41 PM

where can i access the GUI for config?

Lamarian, Feb 28th at 4:33 PM

same and seems nice to have

SoupInCat, Feb 28th at 3:16 PM

Lol i just watched a youtube video and learned about panini projection yesterday, how awesome! Can't wait to try this.