Skip to content

Commit

Permalink
Merge pull request #168 from BastiaanOlij/baseline_300_alpha
Browse files Browse the repository at this point in the history
Restructure plugin to include a baseline demo
  • Loading branch information
BastiaanOlij authored Jul 27, 2022
2 parents 093d1aa + 233a505 commit 42c419c
Show file tree
Hide file tree
Showing 29 changed files with 898 additions and 27 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Workflow to automatically create deliverables
name: Build on push

on:
[push, pull_request]

jobs:
build:
name: Assembling artifacts
runs-on: ubuntu-20.04

# Note, to satisfy the asset library we need to make sure our zip files have a root folder
# this is why we checkout into demo/godot-xr-tools
# and build plugin/godot-xr-tools
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: demo/godot-xr-tools
- name: Create XR tools plugin
run: |
mkdir plugin
mkdir plugin/godot-xr-tools
mkdir plugin/godot-xr-tools/addons
cp -r demo/godot-xr-tools/addons/godot-xr-tools plugin/godot-xr-tools/addons
cp demo/godot-xr-tools/LICENSE plugin/godot-xr-tools
cp demo/godot-xr-tools/CONTRIBUTORS.md plugin/godot-xr-tools
cp demo/godot-xr-tools/VERSIONS.md plugin/godot-xr-tools
rm -rf demo/godot-xr-tools/.git
rm -rf demo/godot-xr-tools/.github
- name: Add OpenXR Plugin
run: |
wget --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://github.com/GodotVR/godot_openxr/releases/download/1.3.0/godot-openxr.zip"
unzip -qq godot-openxr.zip
cp -r godot_openxr_1.3.0/addons/godot-openxr demo/godot-xr-tools/addons
- name: Create XR tools library artifact
uses: actions/upload-artifact@v2
with:
name: godot-xr-tools
path: |
plugin
- name: Create XR tools demo artifact
uses: actions/upload-artifact@v2
with:
name: godot-xr-tools-demo
path: |
demo
- name: Zip asset
run: |
cd plugin
zip -qq -r ../godot-xr-tools.zip godot-xr-tools
cd ../demo
zip -qq -r ../godot-xr-tools-demo.zip godot-xr-tools
cd ..
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
- name: Create and upload asset
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "godot-xr-tools.zip,godot-xr-tools-demo.zip"
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
*.o
*.os
# Godot files to ignore
.import/
*.dblite
*.exp
*.lib
*.obj
*.TMP

# Filesystem files to ignore
logs
Thumbs.db
.DS_Store

# Addons sourced externally
addons/godot-openxr/
File renamed without changes.
File renamed without changes.
66 changes: 66 additions & 0 deletions Main.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[gd_scene load_steps=13 format=2]

[ext_resource path="res://addons/godot-openxr/scenes/first_person_controller_vr.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/godot-xr-tools/assets/LeftHand.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/godot-xr-tools/assets/RightHand.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/wahooney.itch.io/green_grid.tres" type="Material" id=4]
[ext_resource path="res://addons/godot-xr-tools/functions/Function_Direct_movement.tscn" type="PackedScene" id=6]
[ext_resource path="res://addons/godot-xr-tools/assets/PlayerBody.tscn" type="PackedScene" id=7]
[ext_resource path="res://addons/godot-xr-tools/functions/Function_Teleport.tscn" type="PackedScene" id=8]
[ext_resource path="res://addons/godot-xr-tools/misc/VR_Common_Shader_Cache.tscn" type="PackedScene" id=9]

[sub_resource type="ProceduralSky" id=1]

[sub_resource type="Environment" id=2]
background_mode = 2
background_sky = SubResource( 1 )
ambient_light_sky_contribution = 0.62

[sub_resource type="PlaneMesh" id=3]
material = ExtResource( 4 )
size = Vector2( 200, 200 )

[sub_resource type="BoxShape" id=4]
extents = Vector3( 100, 1, 100 )

[node name="Main" type="Spatial"]

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( 2 )

[node name="DirectionalLight" type="DirectionalLight" parent="WorldEnvironment"]
transform = Transform( -1, 0, -8.74228e-08, -5.44721e-08, 0.782152, 0.623088, 6.83779e-08, 0.623088, -0.782152, 0, 6.82119, 0 )

[node name="FPController" parent="." instance=ExtResource( 1 )]

[node name="ARVRCamera" parent="FPController" index="1"]
far = 1000.0

[node name="vr_common_shader_cache" parent="FPController/ARVRCamera" index="0" instance=ExtResource( 9 )]

[node name="LeftHandController" parent="FPController" index="2"]
hide_for_no_tracking_confidence = true

[node name="LeftHand" parent="FPController/LeftHandController" index="0" instance=ExtResource( 2 )]

[node name="Function_Teleport" parent="FPController/LeftHandController" index="1" instance=ExtResource( 8 )]

[node name="RightHandController" parent="FPController" index="3"]
hide_for_no_tracking_confidence = true

[node name="RightHand" parent="FPController/RightHandController" index="0" instance=ExtResource( 3 )]

[node name="Function_Direct_movement" parent="FPController/RightHandController" index="1" instance=ExtResource( 6 )]

[node name="PlayerBody" parent="FPController" instance=ExtResource( 7 )]

[node name="Floor" type="StaticBody" parent="."]

[node name="MeshInstance" type="MeshInstance" parent="Floor"]
mesh = SubResource( 3 )

[node name="CollisionShape" type="CollisionShape" parent="Floor"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 )
shape = SubResource( 4 )

[editable path="FPController"]
46 changes: 32 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,29 @@ This repository contains a number of support files and support scenes that can b
Official releases are tagged and can be found [here](https://github.com/GodotVR/godot-xr-tools/releases).

The following branches are in active development:
| Branch | Description |
|-----------|---------------|
| master | Godot 3 development branch |
| 4.0-dev | Godot 4 development branch |
| Branch | Description | Godot version |
|-----------|-----------------------------|-----------------|
| master | Current development branch | Godot 3.4+ |
| 2.x | Current stable release | Godot 3.4+ |
| 4.0-dev | Future development branch | Godot 4.0 |

## How to Use

Information about how to use this plugin can be found [in our WIKI](https://github.com/GodotVR/godot-xr-tools/wiki).

### Demo

This repository now contains a full demo for XR Tools with the XR Tools add on included in this demo.

After cloning this repository you will need to install the OpenXR plugin for it to work. The OpenXR plugin is not included within this repository.
You can obtain the OpenXR plugin [here](https://github.com/GodotVR/godot_openxr/releases) or download it from the asset library within Godot.

Note that the demo was created using Godot 3.5.

### XR Tools library

To obtain just the XR Tools library for your own project, please check [releases](https://github.com/GodotVR/godot-xr-tools/releases) or download it from the asset library within Godot.

### Preventing hickups

As many of the functions in this module will hide objects that are later shown as the user performs actions, the user will experience a hickup as Godot compiles the shader used to draw the object on screen.
Expand All @@ -29,17 +43,21 @@ To combat this you will find a scene in this module called `misc/VR_Common_Shade
Add this scene as a child node to your ARVRCamera. This will trigger the required shaders being
compiled the first time your main scene loads.

Licensing
---------
## Licensing

This repository is licensed under the MIT license.
See the full license inside of the addons folder.

About this repository
---------------------
This repository was created by and is maintained by Bastiaan Olij a.k.a. Mux213
## About this repository

This repository was created by Bastiaan Olij a.k.a. Mux213

It is primarily maintained by:
- [Bastiaan Olij](https://github.com/BastiaanOlij/)
- [Malcolm Nixon](https://github.com/Malcolmnixon/)

You can follow me on twitter for regular updates here:
https://twitter.com/mux213
For further contributors please see `CONTRIBUTORS.md`

Videos about my work with Godot including tutorials on working with VR in Godot can by found on my youtube page:
https://www.youtube.com/BastiaanOlij
Further resources:
- [Bastiaan Olij on Twitter](https://twitter.com/mux213) for regular updates
- [Bastiaan Olij on Youtube](https://www.youtube.com/BastiaanOlij) for tutorials
- [Malcolm Nixon on Youtube](https://www.youtube.com/user/MalcolmANixon) for demonstrations of Godot XR Tools.
5 changes: 4 additions & 1 deletion addons/godot-xr-tools/VERSIONS.md → VERSIONS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 3.0.0 Alpha
- Included demo

# 2.6.0
- Fixed enforcement of direct-movement maximum speed

Expand All @@ -14,7 +17,7 @@
- Modified hand meshes (blend and glb) to be scaled, so the hand scenes can be 1:1 scaled
- Modified hands to scale with world_scale (required for godot-openxr 1.3.0 and later)
- Added physics hands with PhysicsBody bones
- Fixed disabling of _process in XRToolsPickable script
- Fixed disabling of `_process` in XRToolsPickable script

# 2.4.1
- Fixed grab distance
Expand Down
1 change: 1 addition & 0 deletions addons/godot-xr-tools/images/icon.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
Expand Down
5 changes: 2 additions & 3 deletions addons/godot-xr-tools/images/ring.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/ring.png-34d9c9e9780f2732148a5b14fcac48dd.s3tc.stex"
path.etc2="res://.import/ring.png-34d9c9e9780f2732148a5b14fcac48dd.etc2.stex"
path.etc="res://.import/ring.png-34d9c9e9780f2732148a5b14fcac48dd.etc.stex"
metadata={
"imported_formats": [ "s3tc", "etc2", "etc" ],
"imported_formats": [ "s3tc", "etc" ],
"vram_texture": true
}

[deps]

source_file="res://addons/godot-xr-tools/images/ring.png"
dest_files=[ "res://.import/ring.png-34d9c9e9780f2732148a5b14fcac48dd.s3tc.stex", "res://.import/ring.png-34d9c9e9780f2732148a5b14fcac48dd.etc2.stex", "res://.import/ring.png-34d9c9e9780f2732148a5b14fcac48dd.etc.stex" ]
dest_files=[ "res://.import/ring.png-34d9c9e9780f2732148a5b14fcac48dd.s3tc.stex", "res://.import/ring.png-34d9c9e9780f2732148a5b14fcac48dd.etc.stex" ]

[params]

Expand Down
1 change: 1 addition & 0 deletions addons/godot-xr-tools/images/teleport_arrow.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
Expand Down
1 change: 1 addition & 0 deletions addons/godot-xr-tools/images/teleport_target.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
Expand Down
2 changes: 1 addition & 1 deletion addons/godot-xr-tools/materials/highlight.tres
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ operator = 2

[sub_resource type="VisualShader" id=6]
code = "shader_type spatial;
render_mode specular_schlick_ggx;
render_mode specular_schlick_ggx, async_visible;

uniform vec4 Color : hint_color;

Expand Down
2 changes: 1 addition & 1 deletion addons/godot-xr-tools/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Godot XR Tools"
description="Godot XR Tools plugin"
author="Bastiaan Olij and Contributors"
version="2.5.0"
version="3.0.0 alpha"
script="plugin.gd"
1 change: 1 addition & 0 deletions assets/wahooney.itch.io/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Textures were created with: https://wahooney.itch.io/texture-grid-generator
Binary file added assets/wahooney.itch.io/blue_grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions assets/wahooney.itch.io/blue_grid.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="StreamTexture"
path.s3tc="res://.import/blue_grid.png-785a01a697c0777376608d81454e4958.s3tc.stex"
path.etc="res://.import/blue_grid.png-785a01a697c0777376608d81454e4958.etc.stex"
metadata={
"imported_formats": [ "s3tc", "etc" ],
"vram_texture": true
}

[deps]

source_file="res://assets/wahooney.itch.io/blue_grid.png"
dest_files=[ "res://.import/blue_grid.png-785a01a697c0777376608d81454e4958.s3tc.stex", "res://.import/blue_grid.png-785a01a697c0777376608d81454e4958.etc.stex" ]

[params]

compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
8 changes: 8 additions & 0 deletions assets/wahooney.itch.io/blue_grid.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="SpatialMaterial" load_steps=2 format=2]

[ext_resource path="res://assets/wahooney.itch.io/blue_grid.png" type="Texture" id=1]

[resource]
albedo_texture = ExtResource( 1 )
uv1_offset = Vector3( 0.5, 0.5, 0.5 )
uv1_triplanar = true
Binary file added assets/wahooney.itch.io/brown_grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/wahooney.itch.io/brown_grid.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/brown_grid.png-5cbd37038e3ea1da588854d56a43bef6.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/wahooney.itch.io/brown_grid.png"
dest_files=[ "res://.import/brown_grid.png-5cbd37038e3ea1da588854d56a43bef6.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added assets/wahooney.itch.io/green_grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 42c419c

Please sign in to comment.