-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Emissive Strength Test | ||
|
||
## Screenshots | ||
|
||
### Plain Rendering (Test Passes) | ||
|
||
![plain screenshot](screenshot/screenshot_large_plain.jpg) | ||
|
||
### Render with Optional Bloom Effect Enabled | ||
|
||
![screenshot with bloom](screenshot/screenshot_large_bloom.jpg) | ||
|
||
These screenshots were rendered in BabylonJS with the default IBL strength dialed | ||
down to help the glow stand out. The second screenshot has an optional "Bloom" effect | ||
applied using the BabylonJS Default Rendering Pipeline. | ||
|
||
## Description | ||
|
||
This model tests if the `KHR_materials_emissive_strength` extension is available in a | ||
given implementation. If it is not, the cubes will all emit the same shade of | ||
light blue. For implementations that support this extension, the cubes will be | ||
progressively brighter to the right. | ||
|
||
## Cube Colors | ||
|
||
The basic emissive color of all the cubes is `[0.1, 0.5, 0.9]` in the glTF file, which | ||
is expected to undergo the usual linear-to-sRGB transfer before being shown to the viewer. | ||
The cube on the far left has no emissive strength extension (`1x`), and each subsequent | ||
cube doubles the strength (`2x`, `4x`, `8x`, and `16x`). | ||
|
||
With a simple output mapping, the cube on the far right may appear as | ||
plain white, due to all of its color components being clamped to the 1.0 upper limit. | ||
If "bloom" effects are enabled, some cubes may appear to glow. In a path-tracing | ||
engine, all of these cubes may emit light, but the ones on the right should | ||
emit substantially more light. | ||
|
||
## Test Failure | ||
|
||
If a given implementation does not support `KHR_materials_emissive_strength`, the | ||
boxes will all appear to emit the same color. For example: | ||
|
||
![test fail screenshot](screenshot/test_fail.jpg) | ||
|
||
## License Information | ||
|
||
Copyright 2022 Analytical Graphics, Inc. | ||
CC-BY 4.0 https://creativecommons.org/licenses/by/4.0/ | ||
Model and textures by Ed Mackey. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.IO; | ||
using UnityEngine; | ||
# if !UNITY_EDITOR && UNITY_ANDROID | ||
using System; | ||
using UnityEngine.Networking; | ||
# endif | ||
|
||
namespace VGltfExamples.Common | ||
{ | ||
public static class StreamReaderFactory | ||
{ | ||
# if !UNITY_EDITOR && UNITY_ANDROID | ||
public static Stream Create(string path) | ||
{ | ||
var basePath = "jar:file://" + Application.dataPath + "!/assets/"; | ||
var url = basePath + path; | ||
using (var req = UnityWebRequest.Get(url)) | ||
{ | ||
req.SendWebRequest(); | ||
|
||
while (!req.isDone && !req.isNetworkError && !req.isHttpError) { } | ||
if (req.isNetworkError || req.isHttpError) { | ||
throw new Exception($"Failed to load: url = {url}, error = {req.error}"); | ||
} | ||
|
||
return new MemoryStream(req.downloadHandler.data); | ||
} | ||
} | ||
# elif !UNITY_EDITOR && UNITY_IOS | ||
public static Stream Create(string path) | ||
{ | ||
var basePath = Path.Combine(Application.dataPath, "Raw"); | ||
return File.OpenRead(Path.Combine(basePath, path)); | ||
} | ||
# else | ||
public static Stream Create(string path) | ||
{ | ||
var basePath = Path.Combine(Application.dataPath, "StreamingAssets"); | ||
return File.OpenRead(Path.Combine(basePath, path)); | ||
} | ||
# endif | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.