Jump to content
  • entries
    75
  • comments
    81
  • views
    83852

Creating a VR Teleporter in Leadwerks

Josh Klint

1149 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 Aileen Chen
      2019 Asia VR&AR Fair&Summit (VR&AR Fair 2019)
      Date: May 9-11, 2019
      Venue: China Import&Export Fair Complex, Guangzhou, China
      Address: No. 382, Yuejiang Zhong Road, Guangzhou, China
      Website: http://www.vrarfair.com/index.php?lang=en
      Hosted by: Guangdong Grandeur International Exhibition Group
      Co-organized by: Guangzhou Virtual Reality Industry Association, Guangdong VR Industry Alliance, Shenzhen Virtual Reality Industry Federation, Shenzhen Virtual Reality Industry Association
       
      Overview
      As a thematic exhibition of China Guangzhou International Leisure & Recreation Expo (GILE),VR&AR Fair has been successfully held for two consecutive years (Twice a year, Guangzhou and Wuhan), becoming the One and Only Professional Demonstration and Trade Platform of the VR&AR Industry in Guangzhou. Over the years, we has gathered numbers of famous companies at home and abroad to display their latest products and technologies at VR&AR Fair, including JD.COM, 3Glassess, DP VR, Leke VR, PiXYZ Software (France), ICAROS(Germany), Ai6tech (Taiwan), VRway, Hirain, Royole, Super Captain, TPCAST VR, Shenlinqijing, Foldspace, NineD, TPcast, etc. 
       
      VR&AR Fair 2019 is estimated to host over 250 exhibitors and co-located with 2019 Asia Amusement&Attractions Expo (AAA 2019) on a show floor of 10,0000 sq.m, which are going to cover sectors like VR helmet accessories, VR all-in-one machine, interactive multimedia products, immersive games and devices, immersive digital cinemas, virtual walk-through products, auto stereoscopic (glasses-free), 3D-9D cinema devices, multi-touch devices, AR equipment, AR game, environment modeling technology, realistic sensor (real-time) rendering technology, amusement equipment, Theme Park Facilities,etc. 
       
      Concurrent event:
      2019 Asia Science Museum & Exhibition Hall Facilities Expo
      2019 Asia Multimedia Technology & Interactive Projection Expo
      The 10th Asia Theater & Filming Equipment Fair 2019
      2019 Asia Amusement & Attraction Expo
       
      Why VR&AR Fair 2019?
      1. Win face-to-face business opportunities
      2. Seek professional buyers
      3. Come into contact with business decision makers
      4. Maintain existing clients and find new clients
      5. Effectively improve brand image & awareness
      6. Accurately position your company and brand
      7. Grab market shares
      8. Get access to the latest industrial development
      9. Vigorously expand product and service scope
      10. Establish extensive agent and investment attraction network
       
       
      Discover Your Opportunity at VR&AR Fair 2019!
      Aileen Chen
      Director of Guangdong Grandeur International Exhibition Group
      Tel: 82-20-29806525  
      Fax: 86-20-82579220 
      Mobile/Wechant: 15089702986
      E-mail: grand.fi@grahw.com 
       
       
       
    • By Liam Weston
      Greetings fellow gaming enthusiasts!
      I am the Product Manager for a VR game called Funny Farm VR.
      https://www.funnyfarmvr.com/
      We have already have a proof of concept build of the game that is published on iOS, Android, Oculus Rift, Oculus Go, GearVR, Pico and Niburu platforms. Not a bad start eh? 
      It's a 3D VR game built on the Unity platform. We are now looking to further develop the game concept and build on what we have to achieve the following:
      Introduce a game economy (power ups / rewards / currency) Add more levels We need 1 or 2 developers with experience in developing on the Unity 3D platform as well as a 3D artist and animator.
      This is a great opportunity to work on a fun game and inject your own ideas / personality into it.
      If you're interested in getting involved drop me a message and I'll get in touch.
      Looking forward to putting a team together!
      Liam
       
    • By Questengine
      I made a VR game for Oculus Rift.  It feature complete, but of course some assets are incomplete and balance needs work.  If you have an Oculus Rift and you're looking for something to do with it, you could do worse!
      It's a puzzle/resource management game disguised as a space shooter.  You're in a space ship cockpit and the guns are shooting the aliens, but that's all automatic and passive.  You just maintain ammo supplies, manage heat, recover loot and keep the ship shielded.  There's lots of switches and do-dads scattered all around the cockpit to keep you busy. It's very VR friendly: you have a mostly stationary cockpit, lots of reasons to turn and look and use you motion controllers, and games can be very short.
      This beta is very configurable too.  There's a plain old text file where you can change lots of the static values the game uses.  I'd actually like help balancing everything to be honest as it's a bit complicated.  
      If you have an Oculus Rift I hope you'll take a look.  
      http://www.questengine.com/vercs


    • By OfficePassenger
      Dear frends, I would like to try myself as a composer for games, I make unusual music with an unusual mood and atmosphere, I like to work on sounds and details in music, below I attach examples of my works, [deleted by moderator]
      1.mp3
      2.mp3
      3.mp3
      4.mp3
      5.mp3
      6.mp3
      7.mp3
      8.mp3
    • By sdef Lab
      Hi,
      We have designed VR project with a large area database and when we are making our aircraft to move around the scene , we are facing a spatial jittering when trying to move far from origin
      any solution???.
×

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!