Jump to content
  • Advertisement
  • entries
    75
  • comments
    81
  • views
    84302

Creating a VR Teleporter in Leadwerks

Josh Klint

1309 views

I'm building the VR project template for Leadwerks 4.5.  Although you can enable VR in any project, this template is specifically designed to provide some of your most common room-scale VR features:

  • Teleportation movement, which prevents motion sickness.
  • Picking up and throwing objects. (It's actually really fun!)

To start with I am creating the art assets for the teleport effect. This is basically what I want:

thelab.jpg

Your controller shoots a beam which ends in an indicator when it hits an upwards-facing slope. Typically this beam will be somewhat arced.  Why the curve? This allows you to climb up to areas above you:

Image1.jpg.df8356f46b3a9d9ed37bdfd895c76609.jpg

As always, I am starting with the game assets. I don't believe in using programmer art because it hurts your understanding of what you are trying to create, it's uninspiring, and you will end up writing your code twice once you get the final artwork and realize all the mistakes you made.

I started with textures. I know I want a circular indicator on the floor, a misty spinning effect rising off it, and a beam. I'm going to make all my textures grayscale so that I can control the color with the entity color value and dynamically change it in the game.  Here are my textures I created in about ten minutes in Paint Shop Pro:

teleport1.png.9a150b10a9b3c7533b9bd369724b92e7.png

teleport2.png.81a0eb54d0b873ea4275a5be147d3b48.png

teleport3.png.986ee249c09e764c238ef13acbfdc4ae.png

The first texture above is clamped along the X and Y axes and the second one is clamp along the Y axis.  I am using uncompressed textures for all of these because they have a lot of soft gradients.

I created my materials with the following settings, again leaving everything white:

Image2.jpg.2551ded38dcd838eeb1bc14c810161a1.jpg

In 3ds Max I created my indicator model. It's just a plane with a cylinder on top, with the end caps removed:

Image1.thumb.jpg.1643781cb380cad1292c02cc79cfa670.jpg

When I import it into Leadwerks and apply my materials, the model looks like this:

Image2.jpg.b133743a98fe0641e36f6882f12bdb65.jpg

I'll show you why I am using uncompressed textures. You can see in this shot the edge of the ring has some ugly artifacts when texture compression is used:

Image3.jpg.c9bd686cd3a547308fd878be23ae7525.jpg

Here's a closeup. Not something I want to see in VR:

Image4.png.7dd080b001152328f83a071142c26251.png

Now I am going to create an instance of the model in the editor and adjust the color. I want a bright blue glowy color. I am setting the color to RGB 128,255,255 and cranking the intensity way up to 2.0. This effectively sets the entity color to 256,512,512. This color is multiplied by the texture color at each pixel and then clamped to 0-255 (the maximum color range of the monitor). That means that the brightest spots on the material will reach a full 255,255,255 white color and look really intense, while darker parts will be tinted blue:

screenshot203.thumb.jpg.cc0c884f3c71e087456bec5a04f31115.jpg

Notice the object isn't just a flat color, but has a range of color from blue to white. To get this effect I had to increase the intensity over 1.0 to create colors brighter than RGB 255,255,255, and I had to have some red in the color. If I had set the color to RGB 0,255,255 the red channel would never increase and I would have a flat color like this. Not so good:

screenshot197.thumb.jpg.f173a701b955bc7e8fe2c78080eae449.jpg

If I had set the color to RGB 128,255,255 but left the intensity at 1.0 I would also have a solid color:

screenshot198.thumb.jpg.b760ebdb1c0804cf50fb325fdfb361f0.jpg

Finally I added a script to the model and saved it as a prefab. The script just rotates the model around slowly on its Y axis, which I think will look pretty good. I'm going to perform the rotation in the Draw() function so it doesn't get called if the object is hidden or offscreen, and I don't think anyone will notice if the rotation doesn't update when they look away:

function Script:Draw()
	self.entity:Turn(0, 0.1 * Time:GetSpeed(), 0)
end

That's it for now. The next step will be to create my teleportation mechanic in VR.



0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By GameDev.net
      It's no secret that what makes or breaks a VR experience is whether or not the player feels immersed in the VR world you've built. Here are a collection of tested guidelines for creating a more captivating VR experience.

      Introduction
      In recent years, virtual reality (VR) technology has progressed exponentially to enable immersive environments in which users feel a heightened sense of realism—that “you’re really there” feeling in the created environment. Across the board, CPU performance, GPU performance, VR headsets’ visual fidelity, and VR-enabled software have all advanced tremendously.
      Games are the most obvious beneficiaries of VR technology and are already beginning to make the most of it. Other software genres can benefit from VR’s immersive capabilities as well, including education, training, and therapeutic usages.
      However, as with many new technologies, it’s easy to implement VR that looks cool on the surface but has fatal flaws that pull you out of the immersive experience or ultimately make you wonder why someone went to the trouble of creating the software. Developers run the risk of having an initial “Oh, wow!” quickly become “What’s the point?”
      Read more
    • By GameDev.net
      Arizona Sunshine* found success in the VR space after following Intel® Guidelines for Immersive VR Experiences. See how they became the fastest-selling non-bundled virtual Reality title to date.

      With a dazzling launch in early 2017 that saw Arizona Sunshine* become the fastest-selling non-bundled virtual reality title to date, and instant recognition as the 2016 “Best Vive Game” according to UploadVR, the zombie-killer game is not just another VR shooter. Combining immersive game play with intriguing multi-player options, this game takes full advantage of VR capabilities to promote playability in both outdoor and underground environments.
      Through its association with Netherlands-based Vertigo Games and nearby indie developer Jaywalkers Interactive, Intel helped add sizzle to Arizona Sunshine by fine-tuning the CPU capabilities to provide end-to-end VR realism. The power of a strong CPU performance becomes apparent with every jaw-dropping zombie horde attack. From the resources available when a player chooses and loads a weapon, to the responsiveness of the surrounding eerie world, the immersive qualities of the VR interface make it easy to forget that it’s just a game.
      Read more
    • By SandWitchStudio
      Hello everyone
      I would like to introduce you to a game created by me and my friends.
      Below is a link to the aforementioned game,
      I would be grateful for feedback and advice regarding what we can add to the game or change.
      This is our first game, so maybe it doesn't impress, but we hope you like it and then you like our fanpage. 
      Greetings
      SandWitchStudio
       
      https://www.facebook.com/SandWitchStudio/videos/2107253369590028/
       
    • By icetea54
      The School of Information is accepting applications for the PhD program, for the incoming fall 2019 cohort. We are seeking students with interests in machine learning, natural language processing, text retrieval, virtual/mixed reality, or game development/design.
      Preferred incoming doctoral students for the fall 2019 cohort will bring strong computational skills. Having advanced object-oriented programming skills, experience with machine learning toolkits such as scikit-learn or Keras, or experience with widely used real-time development platforms such as Unity, would be a plus. Instructional experiences are also beneficial, and should be highlighted in application materials, but are not required. Funded positions will be available for select graduate students, those students will receive tuition remission and a stipend in exchange for research- related, grant support, or instructional work.
      The School of Information is an academic unit in the College of Social and Behavioral Sciences at the University of Arizona, Arizona’s only public land grant university. The School’s mission: “As Arizona’s iSchool, we collaborate across disciplines, drive critical research and development, and educate the information intellectuals and professionals of tomorrow to further positive social change that is rooted in the places where we live and that impacts the world.”
      The school and the College of Social and Behavioral Sciences are dedicated to creating a serious, open, free intellectual space for inquiry, one in which faculty, students, staff members, and community partners can participate fully, regardless of race, ethnicity, gender identity, sexual orientation, age, socio-economic status, citizenship status, size, abled status, language, religion, or any other characteristic. Strategically positioned to lead the University of Arizona’s status as a Hispanic Serving Institution, SBS foregrounds our awareness of the deep ancestral footprint of our region’s populations and cultures, including the Tohono O’odham and Pascua Yaqui people whose lands we inhabit. We honor diverse knowledge traditions and lived experiences, and we strive to foster accessibility and equity, the conditions in which our members together can produce new, rigorous, urgent, and evidence-based knowledge
      For more Information, please see: https://ischool.arizona.edu/phd-information.
      With quick questions about the applicant process or application materials, feel free to reach out to our administrative support team through Barbara Vandervelde, barbv@email.arizona.edu.
    • By SimonDarksideJ
      After months of hard labour, cross words and more debates that you can shake a relatively large stick at, the Mixed Reality Toolkit finally entered the Beta phase. This marks the first “release” ready for developers to start prototyping, building projects and hacking away to build fantastic Mixed Reality experiences.
      Featuring:
      A new cross-platform architecture Scriptable configuration A new componentized layout Support for WMR and OpenVR right out of the box (Just hit play) And Much, much more. It’s not at feature parity with its predecessor the HoloToolkit, but it showcases a new path / generation for the Toolkit, seeking to be more open, resolve old issues and strive to be the one toolkit to take on the world of Mixed Reality (or Cross-Reality if you prefer). It’s also not recommended for production use just yet (although legend tells, that it’s already being used for future projects by Microsoft and other MR Partners already).
      Dig in, try it out, see what you think and let the team know Good or Bad what you like or would want to see improved.
      Learn more about the Mixed Reality Toolkit here.

      View full story
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!