Trinus PSVR integration with ReShade
- loxai
- Topic Author
I'm Xavier (known as loxai), developer of Trinus PSVR. I had reports for the last 2-3 years of users combining awesome ReShade (and awesome Depth3D) with Trinus.
Shader injection is certainly the most efficient way to get VR elements, like sbs and lens distortion, into non-VR games.
Trinus had been using a slow method (which I might upgrade for compatibility reasons), so now decided to integrate the better ReShade approach to deliver a more immersive VR experience.
Trinus was actually born as that, about 5 years ago. A converter for nonVR games to be played on the smartphone+cardboard or, later on, psvr. Back then the choice in native (Steam)VR was scarce so it made a lot of sense.
But it still does make sense now, cos even though there are some very cool VR games and experiences, choice pales in comparison to the amount and quality of standard games released in the last 25 years (yeah, going back to original doom times).
You can argue that only native games can give you the full sense of immersion. True. Still, the increased immersion in games like... GTA, Half-Life, Mario Kart, etc. is really worth it.
That's me anyway.
back to ReShade (and Depth3D), kudos to the devs (@crosire, @blueskyknight and collaborators). You've created really useful tools and features.
so comfy to edit shaders (I have little xp on that), the ui to uniform integration, the ui itself... well, just great job crosire
as I was saying I've done an initial integration of ReShade with Trinus. I manage the install/uninstall of the binaries, set the preset, and the game launches with the injection working.
well some games (in the compatibility list) don't work for me, either crashing or no injection... maybe it's something with my setup.
I was hoping you guys, who have ReShade experience, could test it out and let me know if it works for you, and your thoughts about it.
current test implementation can be tested even without a PSVR:
- start trinus
- go to nonVR tab and click Select game. Choose folder and Render API. ReShade should now be installed
- start the game, verify the injection worked (binaries will be removed when closing Trinus to restore previous status, just make sure you close the game before you close Trinus)
this can be downloaded from... first time poster so not sure links will go through
trinusvirtualreality.com/files/TrinusPSVRSetup-Reshade.exe
still some tasks to work on, like calibrating the lens params for psvr but results are promising so far.
there's this shader I have created: moveUI
this is a shader that is given source and dest rects to move the texture pixels from one place to another.
basically allows customising the game UI to be located in a more VR visible place.
there's one feature I haven't been able to implement, and would be great to get help from someone who doesn't suck at maths
it's having round ui elements. so I have a rounding float to be applied on the ui rects to create square (rounding=0) or circle(rounding=1)... I just can't figure out how to implement
this would be handy for the usual circle minimap, for example. (I guess the ideal would be to use a ui mask, but this is a start)
as it is now, moveUI is quite functional and, thanks to the ReShade UI, easy to edit and save as a preset for a specific game.
I have created a tiny tool to prepare game UI presets. It simply shows the given png to the indicated display (eg. viewer.exe c:\screenshot.png 0) with ReShade injected, so you can take a screenshot of a game and then go edit with this tool (you can do it in game anyway, just maybe screenshots are quicker and easier to handle).
as a primitive tool it works just as well to do your first experiments with shaders
here's a screenshot with some UI tests for Doom (using Depth3D). screenshot I used is missing some pixels at the bottom, that's why some ui elements are cut off at the bottom:
this can be downloaded from...
trinusvirtualreality.com/files/uiShader.zip
Note that shader currently doesn't adjust for res ratio, so UI presets are different for 16:9 and 4:3
I think at least @shoterxx will be interested in trying that (I saw his post on Trinus PSVR)
(probably using the @ symbolically, hope mentioned parties get to read this)
one question I have regarding ReShade. Is there anyway to communicate uniforms dynamically from another process (ie. Trinus) via shared mem, udp, ...
the reason I ask is cos I'd like to rotate the texture at roll angle given by the psvr (to simulate roll in a 2dof mouse based game).
didn't see any docs on that, so I'll assume it's not possible. something like freepieIO support would be neat. allow devs to create more complex shaders using python to write those external vars... to do simple things that are not possible on shader side, like static counter, input based on a gamepad, or that roll delivery)
well, that would be a good chunk of work... maybe something simple...
when I saw the mouse position input, I thought for a moment I could do an awkward hack of setting mouse wheel delta (hoping it doesn't interfere with the game) and then use shader uniform mouse wheel to apply the roll. but I see there's only position and buttons, no wheel data. plus this would be a really a bad solution even if it worked
one suggestion: implement a new keyMap attribute to source="key", alternate to keyCode, you could set keyMap="shaderToggleUI",
Then in preset file: shaderToggleUI = 0x20
so that it is easier for users (no shader edit) to remap a key if it is used in-game
(I understand such feature is not currently available, is it?)
once again, thank your for your great work.
looking forward to some feedback on this.
thanks for reading
Xavier
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
Thank you.
Please Log in or Create an account to join the conversation.
- loxai
- Topic Author
Please Log in or Create an account to join the conversation.
- loxai
- Topic Author
This version can use a UI mask instead of UI rects.
Using a mask like this:
The update also does better management of the setup (generating the presets file depending on selected preset). Two tests presets are included, for GTA5 and Hitman2
I've also been able to handle the key mapping I wanted: I parse the shader before start, changing special string for the keycode user assign in Trinus
I'm drafting the instructions to create UI game profiles here .
Please Log in or Create an account to join the conversation.
reshade.me/forum/shader-presentation/5104-vr-universal-shader
It has some lens distortion algorithm that can interest you.
If you like, I can develop Trinus-dedicated VR shader in collaboration.
Please Log in or Create an account to join the conversation.
- loxai
- Topic Author
I'm using the lens distortion in Depth3D atm, but haven't calibrated the params yet. When I go ahead with the calibration process I can check both shaders to see which one gives a better approximation.
In Trinus/ext/reshade/presets folder there's a basic.ini, tec.ini and tec3d.ini. You can edit these to set shader params and techniques used.
So it should be easy to switch Depth3D with your shader
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
loxai wrote: I will check it out.
I'm using the lens distortion in Depth3D atm, but haven't calibrated the params yet. When I go ahead with the calibration process I can check both shaders to see which one gives a better approximation.
In Trinus/ext/reshade/presets folder there's a basic.ini, tec.ini and tec3d.ini. You can edit these to set shader params and techniques used.
So it should be easy to switch Depth3D with your shader
I didn't know so many people used Polynomial lens distortion shader for PSVR.
I corrected the Polynomial Distortion Model. I had a long-standing mistake in the code. That should be corrected now. Just update the shader from my GitHub.
This correction should let you just copy over K1_RGB and K2_RGB values without effort. Also, keep in mind in the PBD.fx you can store your own Profiles.
github.com/BlueSkyDefender/Depth3D/blob/...or_HMDs.fx#L192-L269
The reason I didn't add K3, was that 3rd order distortion factor was not listed on most HMD's.
dylanmckay.io/psvr-protocol/ Where I got the K1 & K2 values.
I don't really use my PSVR HMD since it's in storage. I also added a Distortion mesh as it's useful, on the latest update.
I also wanted to let you know that crosire has this. github.com/crosire/reshade/tree/openvr
An openvr build of reshade. It has Headset Movement simulation. I love it. But, it studders now and then. Other than that I still love using it. Too bad, it was not updated in 2 years.
crosire seems like a busy man so I don't want to bother him with it.
As always you can come on to my Discord channel or if you have your own invite us to yours.
Please Log in or Create an account to join the conversation.
- loxai
- Topic Author
- better UX to manage the VR conversion (ReShade + presets) install/uninstall
- fixed some bugs with mouse conversion
- mask for Alien Isolation (and a few generic ones)
I still have to do the lens correction calibration. Did some tests but had trouble tuning, specially the chroma correction. Will test Fubax soon.
in any case, there's a custom preset editor option that makes it easy to plug any other shader
will also update the online instructions soon with more detail on how to use the new features
Please Log in or Create an account to join the conversation.
- loxai
- Topic Author
I'm sticking with BlueSky's shaders for this release, but will probably add user switch to choose between Fubax and Depth3D.
For both cases, I'll be doing donations to the shader projects and include the donation links (hoping it bumps user donations).
I'm quite happy with this new Trinus PSVR 1.0. I think the conversion experience is very good, and look forward to work on the TODOs of ideas and features that will come next. One of the next steps would be adding native PC VR headsets (Vive/Rift) to benefit from this VR Conversion... starting to look at it and it seems it will be a good chunk of work
Cheers!
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
Please Log in or Create an account to join the conversation.
- CeeJay.dk
github.com/crosire/reshade/tree/freepie
BlueSky have been running some tests and it seems to be working so we might see FreePIE support in the next version of Reshade.
Please Log in or Create an account to join the conversation.