RosaryMala / armok-vision

A 3d realtime visualizer for Dwarf Fortress
MIT License
319 stars 27 forks source link

Add SteamVR support, fix unit rotation #33

Closed PeridexisErrant closed 8 years ago

PeridexisErrant commented 8 years ago

Unit sprites now rotate to face the camera, rather than matching the rotation of the camera (which produced a disturbing parallax effect in VR. Imported the SteamVR toolkit. Added the VRTK toolkit.

The result allows me to walk and teleport around in VR, exploring Dwarf Fortress in a way previously thought impossible.

However, there are a few issues and further enhancements I couldn't work out.

Future work should focus on making the menu accessible from VR mode (ie bound to the menu button on the controller and intractable), and supporting VR while zoomed-out to world scale. More whimsically, a small pick could be attached to the controllers :smile:

Time to strike the virtual earth!

RosaryMala commented 8 years ago

Regarding stairs, right now, they're managed by translating the position of the feet into a a collision info enum, which says if it's stairs, water, solid, or air. Could that be used for the VR script?

Otherwise, I'd need to make separate colliders for all climable objects (Right now, every 16x16 tile block is merged into a single one in nearly all respects)

RosaryMala commented 8 years ago

Also, what's the reason for needing to use forward rendering? Is it just because of Antialiasing?

PeridexisErrant commented 8 years ago

Forward rendering is because deferred simply doesn't work in the VR pipelines and at the required framerate - I don't entirely understand it myself, but there's black GPU magic happening. AA is part of the answer, but shaders and lens-correction are bigger.

Not a Unity expert, but anything you can attach that script to should work... so you may need to make more objects. Or, if we don't mind everything being climbable (which it feels like it is sometimes...) you could just attach it to the whole mesh I guess?

RosaryMala commented 8 years ago

Well, In DF, everything IS climbable, pretty much.

Though right now, stairs have no colision meshes, but that's easy to change.

PeridexisErrant commented 8 years ago

@JapaMala - remaining things to do before a release can be made with these changes:

RosaryMala commented 8 years ago

I'm pretty sure Unity has a VR mode commandline switch.

I'd probably use that.

PeridexisErrant commented 8 years ago

You could also test if a VR headset is attached, I guess, but commandline makes sense!

RosaryMala commented 8 years ago

It's complaining about a bunch of things after I merged the code, so I'm trying re-importing the asset store and seeing if that fixed things.

PeridexisErrant commented 8 years ago

That's why I did it as two commits! Are you on Unity 5.4? I think the rendered requires that.

The only settings you need to accept when importing are the forward rendering, and the GPU setting (I forget the exact name)