HTC Vive Template

***HTC VIVE Template (soon to be general VR template)

***[SIZE=2]Howdy there!

We already have a few templates by other community members but I’ll give it a go with one I’ll leave open so we can kind of turn this into a community template :slight_smile:

GitHub Download: [/SIZE]https://github.com/CJRobertson/HTCViveTemplate-UE4[SIZE=2]

***Version 1.0

Features:***

-Smallest VR Project EVER: So far the total project size is about 6MB, WHAT?!

-Preset Rendering Settings: Don’t have to go into ‘Project Settings’ and change anything.

-Trackpad Input Bindings included for non-room scale locomotion

-VR-Physics World: Go have some fun with picking up and throwing objects!

General:

[SIZE=1]-Added HTC Vive motion controller static meshes for “hands”

-Included the Camera Refractor and have a temporary VR “HUD” in place

-Target Hardware: Set to mobile w/ scalable 2D and 3D (this helps you achieve 6Mb project file size)

-Removed Starter Content to keep project as lean as possible
*
Render Settings Changes:*

-Default Postprocessing Settings: All Disabled (enable if you really need them…)

-Optimization Changes: Early Z-pass set to ‘Opaque Meshes Only,’ Movables in early Z-Pass enabled, Clear Scene set to ‘Do Not Clear,’ with Vertex Deformation and GBuffer rendertargets disabled

**-Instant Stereo Rendering: **Enabled

**-Framerate Settings: **Smooth rate, min 90, max 120, min desired 90 (this one is debatable depending on who you talk to)

VR-PhysicsWorld:
[SUB]
-Postprocessing volume preset (no bloom, SSRs, etc.)

-Basic material that has been instanced

-Physics Cube Actors to interact with (pickup, throw, etc.)[/SUB]

The download link is at the top of this post. It is on a public GitHub repo and community involvement would be awesome to see. I plan on making a shooting range and a few other levels so if anyone wants to beat me to those and add them to this project (regardless of it being Vive or Oculus based) then go right ahead :slight_smile:

***HTC Vive Installation Guide
***[/SIZE][/SIZE]Steam Support

[SIZE=2]***Steam VR Quick Start:
[/SIZE]https://docs.unrealengine.com/latest/INT/Platforms/SteamVR/QuickStart/index.html[SIZE=2]

Virtual Reality: Best Practices***
[/SIZE]https://docs.unrealengine.com/latest/INT/Platforms/VR/ContentSetup/index.html


Camera Refactor
***https://docs.unrealengine.com/latest/INT/Platforms/VR/VRCameraRefactor/index.html


Creating Interactions with Motion Controllers (Live Twitch Stream)***Blueprint Creat
Tom Looman-VR Templates
GitHub - tomlooman/VRTemplates: VR Templates for Unreal Engine 4.11 and above


Community Templates
***Steam VR Template - VR and AR Development - Unreal Engine Forums

This is right up my alley since I don’t need teleporting functionality at all. Thanks @BananaKing932

great template! Everything works fine except for the HMD tracking, as soon as I play the template in VR the camera wont react to HMD movement, also when I put on the Vive I only see the standard Vive grid-system with Chaperone. SteamVR is installed under Plugins and the vive is working via SteamVR.

edit: fixed it - the Problem was my secondary monitor. As soon as I unplugged him, the HMD works.

“-Optimization Changes: Early Z-pass set to ‘Opaque Meshes Only,’ Movables in early Z-Pass enabled, Clear Scene set to ‘Do Not Clear,’ with Vertex Deformation and GBuffer rendertargets disabled”

Could you elaborate on why these settings are optimal? I’m not questioning them, just want to know a little bit more.

Awesome! This is really helpful. Thanks a lot.

Cant get this to load on 4.11.2 :frowning:

Gets to 45% initialization and hangs there indefinitely.

Looks great though!

Cant get this to load on 4.11.2 :frowning:

Gets to 45% initialization and hangs there indefinitely.

Looks great though!
[/QUOTE]

It’s because of Instanced Stereo Rendering. It will eventually load, but it’s recompiling all the shaders, so that’s why it takes a while.

Edit: Just saw you mentioned you’re using 4.11.2 - not sure about that, it may have something wrong with it.

Great! I give it a try!

Cant get this to load on 4.11.2 :frowning:

Gets to 45% initialization and hangs there indefinitely.

Looks great though!
[/QUOTE]

Give it some load times. For me (i7-5820,32GBDDR4,GTX970OC,SSD) around 30-60 Seconds with 4.11.2
@BananaKing932: Awesome!

@Spring: It loaded for me eventually, after about 6-8 mins. I ran it and the tracking with head movement was working. Still compiling shaders. Thanks BK!

I adjusted the movement. Now the movement follows the view of the camera.

Ah ok, excellent! Will give it another go and leave it :slight_smile:

Cheers!

Edit - Yup, loaded super fast this time, thanks all!

I really appreciate your work. I am having a problem though. My character is hovering a meter or so above the floor. All steam games have the proper floor level so I don’t suspect it is my calibration. Any idea what could be wrong? I tried changing your character to put the camera at the bottom. I have also tried lowering the pawn in the actual scene. Nothing works.

I resolved this effect by change the following settings in the VR_PlayerCharacter Blueprint: Capsule Half Height and Radius to 5 and 3 (for me). Then i can grab objects from the ground (without hit the ground with the controller).

Sweet I will check it out. Had been doing some fiddling with another Steam VR template up on here so will compare the differences and see where best suits merging my changes.

Personally I changed it so that the movement goes in the direction of the averaged forward vectors of the two controllers (e.g., get forward vector off each controller, add together then multiply by 0.5). This works really well as you can move the controllers around to change velocity and direction without moving your thumb on the trackpad. It also means you can look in one direction and move in another, decoupled.

I did this and although it moved me closer to the ground I still was hovering above the ground a bit. My floor (and my room bounds floor) was not matching. I went as far as to put it to 0.1 half height and 0.1 radius and my controllers if I set them on the floor are still just a little but above the floor which as you can imagine throws off everything. My feet aren’t where I expect them to be.

What happen with 0.0 every setting?

Edit: Even on 0.0 the controller hover a bit over the ground. Gonna try some things.

Maybe it’s the wrong setting for that “problem”.

@n00854180t: I like the movement Idea. I’ll give it a try!

If i’m wrong, correct me. I tried this. But doesn’t have this the “problem” that you need both controller in your Run direction to not slow down? I’ve tried it and this was my effect. Both Controller in one direction = full speed. One Controller to one direction and one to another = slower.

Yup - I consider that a feature, personally, though.