Modding the Render Engine to accommodate VR

I posted this in the Stonehearth subreddit, but the discourse seems to have a bit more activity, so I’m updating the question a bit and reposting it here.

So, I am interested in using the Oculus Rift with Stonehearth, I think the gameplay and visual style would work really well within the limitations of the device. A modder on the Stonehearth Discourse quoted the devs that the shaders were not a moddable part of the game; there was no context around the quote, so I’m not sure if there were any caveats or future promises, I have not been able to find the original quote (and now I can’t find the quoting). The way the Rift works is by warping the output to counteract the distortion caused by the lenses by use of a shader (amongst other camera related things).

So, my question is, why are the shaders off limits? Are the devs requesting people to stay out of the render pipeline for legal reasons (proprietary/3rd party stuff/etc) or is it just a case of “this is massively confusing stuff, and the potential to break everything is very high, so please don’t play with it”? I realize that any changes would wind up being kind of hack-ish, as I’m sure none of the current modding API reaches into the render pipeline, but it does seem like a lost opportunity if that is the only issue with trying this.

I would very much like to respect the wishes of the devs, as they have been so gracious with the modding community, but I would also really love to see this in VR. So if they ask me to not do this because there are reasons legal or otherwise I won’t touch it, but if it is a “we really don’t think it’s a good idea to touch this stuff yet, things are delicate as is…” I am fine with shattered glass, I can clean up my own mess, and I understand the changing nature of alpha software.

I haven’t a clue. However, I will note that Stonehearth uses the Horde3D engine, which is apparently open source software. A quick googling suggests that Horde3D is either working on Oculus Rift support or going to do so.

Also, consider this:

Based on all that, I’d say that there’s probably a good chance you’ll be able to add OR support to Stonehearth, at least in principle.

@sdee / @Ponder / @Tom - anything wrong with what I’ve said here (hopes not :wink: )?

1 Like

I think the rendering is a moddable part (maybe sometime in the future we could add our own shaders). But seeing that the devs want to make the game work even in old systems, and everything is still changing a lot, I wouldn’t go modding it yet.

But I don’t see why you couldn’t peek at the rendering pipeline at the moment, to see how it is now. Mods are meant to be shared for free, and not many people have an Oculus Rift. I don’t really now how would it feel to use Oculus, if we’re playing as gamemasters and observers :confused: but if you say so, maybe it’s worth :smile:

I might have said something wrong, wait until devs give some answer about this matter. :disappointed_relieved:


Check out stonehearth.smod/stonehearth/data/horde/shaders. Feel free to modify them and see if they work or not; I have no idea of this shader business.

However, the whole 3D pipeline isn’t even remotely accessible yet; overwriting shaders might work, but everything in that regard is likely overwrite-only.

In any way, I hope that (official) VR support is somewhere at the deep bottom of the list.


Correct me if I’m wrong, but the actual rendering engine is inside that thing called stonehearth.exe Unless you wanted to get a c++ decompiler or something and do something over complex, I am not sure if it’s possible. I’m not an expert, so maybe you can rig something up with the shaders, and the the head tracking, but then you will also have to incorporate that with the actual OR, so that means using the OR SDK doesn’t it? Not sure if that comes in LUA. Don’t get me wrong, this would be very cool, but it might be something that radiant has to handle. Good luck to you anyway!

1 Like

@not_owen_wilson, if/when you are back from your epic road-trip, this one’s for you. :wink:

Personally, I do think it would be cool to see Stonehearth from inside an Oculus, but realistically, it would be impossible to play unless we completely reworked the UI. So… I would not even begin to look for anything of this sort from us until after (long, long after!) the OSX port.


That’s why we have modders :wink: .

Seriously though, I think this is one of those niche things that more or less has to be way down the priority list. Got to get those dwarves etc done first :slight_smile: !


That was the hardest part in my mind, though I am not so delusional to think the initial implementation would be trivial, from a modding perspective. I was thinking, since the buttons and text are so big it would still be readable, that if the player had hand tracking the UI could be moved to textures on the off hand (left by default) that way it would be off the screen but could be brought up easily. But then we are making additional assumptions about what is available at the user level, and this is already quite niche.

Without hand tracking I’m not sure what could be used to pull the UI off the screen without a complete rework of the design.

1 Like

I myself see the Ui to should be “at no distance” (= rendered in the exact same position on both eyes). I sthere a reason this wouldn’t work?

The edges of the screen aren’t ideal in VR, sometimes that is outside of view, and if it isn’t it is very uncomfortable to look that far into what should be your periphery. The “easiest” fix would be to create a location that would be just ahead of the player that would house all this, and just have everything floating in front; it would shrink the UI a bit, but with how big the buttons and such are that shouldn’t be problematic. I’m not sure if a bottom edge has been made for the bottom bar UI element, that will look a bit rough. And then there are questions about whether to keep it glued to the face, or in a direction believed to be forward, both have issues.

Implementation needs to be worked out first, though. UI, while important, won’t mean anything if I can’t get the rift working.

1 Like