Skip to content

Commit 391651b

Browse files
authored
Merge pull request #38 from faidra/support_animation
Resolve conflicts of #27 (Support animation)
2 parents 88bbb31 + f3d42ec commit 391651b

File tree

55 files changed

+2523
-278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2523
-278
lines changed

.gitignore

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1+
# This .gitignore file should be placed at the root of your Unity project directory
12
#
2-
# https://raw.githubusercontent.com/github/gitignore/master/Unity.gitignore
3+
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
34
#
4-
[Ll]ibrary/
5-
[Tt]emp/
6-
[Oo]bj/
7-
[Bb]uild/
8-
[Bb]uilds/
9-
[Ll]ogs/
5+
/[Ll]ibrary/
6+
/[Tt]emp/
7+
/[Oo]bj/
8+
/[Bb]uild/
9+
/[Bb]uilds/
10+
/[Ll]ogs/
11+
/[Uu]ser[Ss]ettings/
1012

11-
# Never ignore Asset meta data
12-
![Aa]ssets/**/*.meta
13+
# MemoryCaptures can get excessive in size.
14+
# They also could contain extremely sensitive data
15+
/[Mm]emoryCaptures/
16+
17+
# Recordings can get excessive in size
18+
/[Rr]ecordings/
1319

1420
# Uncomment this line if you wish to ignore the asset store tools plugin
15-
# [Aa]ssets/AssetStoreTools*
21+
# /[Aa]ssets/AssetStoreTools*
22+
23+
# Autogenerated Jetbrains Rider plugin
24+
/[Aa]ssets/Plugins/Editor/JetBrains*
1625

1726
# Visual Studio cache directory
1827
.vs/
@@ -48,11 +57,20 @@ sysinfo.txt
4857

4958
# Builds
5059
*.apk
60+
*.aab
5161
*.unitypackage
62+
*.app
5263

5364
# Crashlytics generated file
5465
crashlytics-build.properties
5566

67+
# Packed Addressables
68+
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
69+
70+
# Temporary auto-generated Android Assets
71+
/[Aa]ssets/[Ss]treamingAssets/aa.meta
72+
/[Aa]ssets/[Ss]treamingAssets/aa/*
73+
5674
#
5775
#
5876
#

Assets/StreamingAssets/SampleModels/EmissiveStrengthTest.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Emissive Strength Test
2+
3+
## Screenshots
4+
5+
### Plain Rendering (Test Passes)
6+
7+
![plain screenshot](screenshot/screenshot_large_plain.jpg)
8+
9+
### Render with Optional Bloom Effect Enabled
10+
11+
![screenshot with bloom](screenshot/screenshot_large_bloom.jpg)
12+
13+
These screenshots were rendered in BabylonJS with the default IBL strength dialed
14+
down to help the glow stand out. The second screenshot has an optional "Bloom" effect
15+
applied using the BabylonJS Default Rendering Pipeline.
16+
17+
## Description
18+
19+
This model tests if the `KHR_materials_emissive_strength` extension is available in a
20+
given implementation. If it is not, the cubes will all emit the same shade of
21+
light blue. For implementations that support this extension, the cubes will be
22+
progressively brighter to the right.
23+
24+
## Cube Colors
25+
26+
The basic emissive color of all the cubes is `[0.1, 0.5, 0.9]` in the glTF file, which
27+
is expected to undergo the usual linear-to-sRGB transfer before being shown to the viewer.
28+
The cube on the far left has no emissive strength extension (`1x`), and each subsequent
29+
cube doubles the strength (`2x`, `4x`, `8x`, and `16x`).
30+
31+
With a simple output mapping, the cube on the far right may appear as
32+
plain white, due to all of its color components being clamped to the 1.0 upper limit.
33+
If "bloom" effects are enabled, some cubes may appear to glow. In a path-tracing
34+
engine, all of these cubes may emit light, but the ones on the right should
35+
emit substantially more light.
36+
37+
## Test Failure
38+
39+
If a given implementation does not support `KHR_materials_emissive_strength`, the
40+
boxes will all appear to emit the same color. For example:
41+
42+
![test fail screenshot](screenshot/test_fail.jpg)
43+
44+
## License Information
45+
46+
Copyright 2022 Analytical Graphics, Inc.
47+
CC-BY 4.0 https://creativecommons.org/licenses/by/4.0/
48+
Model and textures by Ed Mackey.

Assets/StreamingAssets/SampleModels/EmissiveStrengthTest/README.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/StreamingAssets/SampleModels/EmissiveStrengthTest/glTF-Binary.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

Assets/StreamingAssets/SampleModels/EmissiveStrengthTest/glTF-Binary/EmissiveStrengthTest.glb.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
14.4 MB
Binary file not shown.

Assets/StreamingAssets/SampleModels/VroidSampleModelA/Model.vrm.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using System.IO;
2+
using UnityEngine;
3+
# if !UNITY_EDITOR && UNITY_ANDROID
4+
using System;
5+
using UnityEngine.Networking;
6+
# endif
7+
8+
namespace VGltfExamples.Common
9+
{
10+
public static class StreamReaderFactory
11+
{
12+
# if !UNITY_EDITOR && UNITY_ANDROID
13+
public static Stream Create(string path)
14+
{
15+
var basePath = "jar:file://" + Application.dataPath + "!/assets/";
16+
var url = basePath + path;
17+
using (var req = UnityWebRequest.Get(url))
18+
{
19+
req.SendWebRequest();
20+
21+
while (!req.isDone && !req.isNetworkError && !req.isHttpError) { }
22+
if (req.isNetworkError || req.isHttpError) {
23+
throw new Exception($"Failed to load: url = {url}, error = {req.error}");
24+
}
25+
26+
return new MemoryStream(req.downloadHandler.data);
27+
}
28+
}
29+
# elif !UNITY_EDITOR && UNITY_IOS
30+
public static Stream Create(string path)
31+
{
32+
var basePath = Path.Combine(Application.dataPath, "Raw");
33+
return File.OpenRead(Path.Combine(basePath, path));
34+
}
35+
# else
36+
public static Stream Create(string path)
37+
{
38+
var basePath = Path.Combine(Application.dataPath, "StreamingAssets");
39+
return File.OpenRead(Path.Combine(basePath, path));
40+
}
41+
# endif
42+
}
43+
}

0 commit comments

Comments
 (0)