Skip to content

Commit

Permalink
Upgrade to Unity 2018 (#535)
Browse files Browse the repository at this point in the history
- Updated documentation and actual project to 2018.4.14f1
- Overhauled the Travis build to use a docker image of a matching version of Unity. (Includes running the playmode and editmode tests)
- Updated the skybox to individual images, since the .dds appears unsupported in 2018 (it was never officially supported)
- Updated lighting and unit tests, bringing them even closer to the provided sample images (though still quite a ways off from being able to image compare against them instead of our own _EXPECTED images).

Changes to Main and TestScenePrefab are primarily re-serialization from the Unity upgrade. Practically the changes were adjusting the lighting and fixing the Model List to point at the loader.
  • Loading branch information
mhochk authored Jan 9, 2020
1 parent c645392 commit eaf628b
Show file tree
Hide file tree
Showing 128 changed files with 1,208 additions and 1,377 deletions.
48 changes: 41 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,45 @@
os: osx
sudo: required
language: csharp
env:
global:
- BUILD_NAME=UnityGLTF
- PROJECT_PATH=UnityGLTF
- UNITY_VERSION=2018.4.14f1
services:
- docker
before_install:
# Decrypt the Unity license to UNITY_LICENSE_CONTENT
- openssl aes-256-cbc -K $encrypted_98a45b338031_key -iv $encrypted_98a45b338031_iv
-in ./scripts/Unity_v2018.x.ulf.enc -out ./Unity_v2018.x.ulf -d
- export UNITY_LICENSE_CONTENT=`cat Unity_v2018.x.ulf`
- rm Unity_v2018.x.ulf
# Pull down docker image for this job
- docker pull $IMAGE_NAME
install:
# Build GLTFSerialization for the Unity project
- nuget restore ./GLTFSerialization/GLTFSerialization.sln
- sudo python2 ./scripts/install-unity.py --package Unity 2017.4.16f1
before_script:
- sudo chmod -R a+rwx /Applications/Unity
script:
- msbuild ./GLTFSerialization/GLTFSerialization.sln /t:GLTFSerialization /p:TargetFramework=net35
- "./scripts/build-unity-project-and-run-tests.sh"

# Mark all the scripts as executable
- chmod -R +rwx ./scripts/*
jobs:
include:
- name: "EditMode Test"
stage: test
script: "./scripts/docker_test.sh"
env: TEST_PLATFORM=editmode IMAGE_NAME=gableroux/unity3d:$UNITY_VERSION
- name: "PlayMode Test"
stage: test
script: "./scripts/docker_test.sh"
env: TEST_PLATFORM=playmode IMAGE_NAME=gableroux/unity3d:$UNITY_VERSION
- name: "StandaloneLinux64 Build"
stage: build
env: BUILD_TARGET=StandaloneLinux64 IMAGE_NAME=gableroux/unity3d:$UNITY_VERSION
script: "./scripts/docker_build.sh"
- name: "StandaloneOSX Build"
stage: build
env: BUILD_TARGET=StandaloneOSX IMAGE_NAME=gableroux/unity3d:$UNITY_VERSION-mac
script: "./scripts/docker_build.sh"
- name: "StandaloneWindows64 Build"
stage: build
env: BUILD_TARGET=StandaloneWindows64 IMAGE_NAME=gableroux/unity3d:$UNITY_VERSION-windows
script: "./scripts/docker_build.sh"
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,51 @@

[![Build Status](https://travis-ci.org/KhronosGroup/UnityGLTF.svg?branch=master)](https://travis-ci.org/KhronosGroup/UnityGLTF) [![Join the chat at https://gitter.im/KhronosGroup/UnityGLTF](https://badges.gitter.im/KhronosGroup/UnityGLTF.svg)](https://gitter.im/KhronosGroup/UnityGLTF?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Unity3D library for importing and exporting [GLTF 2.0](https://github.com/KhronosGroup/glTF/) assets.
Unity3D library for importing and exporting [GLTF 2.0](https://github.com/KhronosGroup/glTF/) assets.

The goal of this library is to support the full glTF 2.0 specification and enable the following scenarios:
The goal of this library is to support the full glTF 2.0 specification and enable the following scenarios:
- Run-time import of glTF 2.0 files
- Run-time export of glTF 2.0 files
- Design-time import of glTF 2.0 files
- Design-time export of glTF 2.0 files

The library will be modularized such that it can be extended to support additional capabilities in Unity or support additional extensions to the glTF specification. The library is designed to work with Unity 5.6 and above.
The library will be modularized such that it can be extended to support additional capabilities in Unity or support additional extensions to the glTF specification. The library was designed to work with Unity 5.6 and above, but is currently only tested/maintained/supported with Unity 2018 and above.

## Current Status

Work Items and Issues targeting a 1.0 release of the library can be found in
[Road to 1.0](https://github.com/KhronosGroup/UnityGLTF/projects/1)

## Getting Started

- This section is dedicated to those who wish to contribute to the project. This should clarify the main project structure without flooding you with too many details.
- UnityGLTF project is divided into two parts: the GLTFSerializer (Visual Studio Solution), and the Unity Project (which is the package we wish to make available to users)
- UnityGLTF project is divided into two parts: the GLTFSerializer (Visual Studio Solution), and the Unity Project (which is the package we wish to make available to users).

### [GLTFSerializer](https://github.com/KhronosGroup/UnityGLTF/tree/master/GLTFSerialization)
- **Basic Rundown**: The GLTFSerializer is a C# DLL implemented to faciliate serialization of the Unity asset model, and deserialization of GLTF assets.

- **Basic Rundown**: The GLTFSerializer is a C# DLL implemented to facilitate serialization of the Unity asset model, and deserialization of GLTF assets.

- **Structure**:
- Each GLTF schemas (Buffer, Accessor, Camera, Image...) extends the basic class: GLTFChildOfRootProperty. Through this object model, each schema can have its own defined serialization/deserialization functionalities, which imitate the JSON file structure as per the GLTF specification.
- Each schema can then be grouped under the GLTFRoot object, which represents the underlying GLTF Asset. Serializing the asset is then done by serializing the root object, which recursively serializes all individual schemas. Deserializing a GLTF asset is done similarly: instantiate a GLTFRoot, and parse the required schemas.

- **Building**: You will need to build this library into the Plugins folder of the core Unity project:
1. Open `GLTFSerialization\GLTFSerialization.sln` and compile for release. This will put the binaries in `UnityGLTF\Assets\UnityGLTF\Runtime\Plugins`
2. Open the Unity project located in `UnityGLTF\`
* If the meta file gets overridden, the binaries in `UnityGLTF\Assets\UnityGLTF\Runtime\Plugins` should be configured for everything but UWP. The binaries in `UnityGLTF\Assets\UnityGLTF\Runtime\Plugins\UWP` should be configured for UWP
1. Open `GLTFSerialization\GLTFSerialization.sln` and compile for release. This will put the binaries in `UnityGLTF\Assets\UnityGLTF\Runtime\Plugins`.
2. Open the Unity project located in `UnityGLTF\`.
* If the meta file gets overridden, the binaries in `UnityGLTF\Assets\UnityGLTF\Runtime\Plugins` should be configured for everything but UWP. The binaries in `UnityGLTF\Assets\UnityGLTF\Runtime\Plugins\UWP` should be configured for UWP.

### [The Unity Project](https://github.com/KhronosGroup/UnityGLTF/tree/master/UnityGLTF)
- #### Unity Version
Although the UnityGLTF Project is maintained at Unity version 5.6.5f1, make sure that the Unity release you have installed on your local machine is up to date. This is so the Exporter can export the latest features, but the Importer can support importing on older Unity builds. You can download the free version [here](https://unity3d.com/get-unity/download/archive). You can run this project simply by opening the directory as a project on Unity.
- ##### Project Components
The Unity project offers two main functionalities: importing and exporting GLTF assets. These functionalities are primarily implemented in [GLTFSceneImporter] and [GLTFSceneExporter].

- **Unity Version**
Be sure that the Unity release you have installed on your local machine is *at least* the version configured for the project (using a newer version is supported). You can download the free version [here](https://unity3d.com/get-unity/download/archive). You can run this project simply by opening the directory as a project on Unity.
- **Project Components**
The Unity project offers two main functionalities: importing and exporting GLTF assets. These functionalities are primarily implemented in `GLTFSceneImporter` and `GLTFSceneExporter`.

### The Server-Side Build

For details on the automated server-side builds and how to update them, see [\scripts\ServerBuilds.md](https://github.com/KhronosGroup/UnityGLTF/blob/master/scripts/ServerBuilds.md).

## Examples
1. Clone or download the repository.
2. Open up the Unity project and run any of the example scenes in `Assets/GLTF/Examples`

You should see something like this:
1. Clone or download the repository (including submodules).
2. Open up the Unity project and run any of the example scenes in `Assets/GLTF/Examples` OR run the main scene in `Assets` and use the `Model List` component to dynamically switch between models.

![GLTF Lantern](/Screenshots/Lantern.png)
Binary file removed Screenshots/Lantern.png
Binary file not shown.
Loading

0 comments on commit eaf628b

Please sign in to comment.