-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for KHR_materials_unlit #6977
Merged
lilleyse
merged 9 commits into
CesiumGS:gltf-update-pipeline
from
OmarShehata:gltf-unlit
Sep 5, 2018
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ccad16c
Add KHR_materials_unlit to list of supported extensions
b136052
Turn off lighting when detects unlit extension
7a9faa7
Updated changes.md
c56a339
Ignore unlit and occlusion when unlit
21caa93
Remove log and fix formatting
7c28d2a
Added test for unlit
ba4d840
Moved BoxUnlit to its own folder
f3afd01
Moved changes.md text into October release
974af0d
Merge branch 'gltf-update-pipeline' into gltf-unlit
lilleyse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{ | ||
"asset": { | ||
"generator": "COLLADA2GLTF", | ||
"version": "2.0" | ||
}, | ||
"extensionsUsed": [ | ||
"KHR_materials_unlit" | ||
], | ||
"extensionsRequired": [ | ||
"KHR_materials_unlit" | ||
], | ||
"scene": 0, | ||
"scenes": [ | ||
{ | ||
"nodes": [ | ||
0 | ||
] | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"children": [ | ||
1 | ||
], | ||
"matrix": [ | ||
1.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
-1.0, | ||
0.0, | ||
0.0, | ||
1.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
1.0 | ||
] | ||
}, | ||
{ | ||
"mesh": 0 | ||
} | ||
], | ||
"meshes": [ | ||
{ | ||
"primitives": [ | ||
{ | ||
"attributes": { | ||
"NORMAL": 1, | ||
"POSITION": 2 | ||
}, | ||
"indices": 0, | ||
"mode": 4, | ||
"material": 0 | ||
} | ||
], | ||
"name": "Mesh" | ||
} | ||
], | ||
"accessors": [ | ||
{ | ||
"bufferView": 0, | ||
"byteOffset": 0, | ||
"componentType": 5123, | ||
"count": 36, | ||
"max": [ | ||
23 | ||
], | ||
"min": [ | ||
0 | ||
], | ||
"type": "SCALAR" | ||
}, | ||
{ | ||
"bufferView": 1, | ||
"byteOffset": 0, | ||
"componentType": 5126, | ||
"count": 24, | ||
"max": [ | ||
1.0, | ||
1.0, | ||
1.0 | ||
], | ||
"min": [ | ||
-1.0, | ||
-1.0, | ||
-1.0 | ||
], | ||
"type": "VEC3" | ||
}, | ||
{ | ||
"bufferView": 1, | ||
"byteOffset": 288, | ||
"componentType": 5126, | ||
"count": 24, | ||
"max": [ | ||
0.5, | ||
0.5, | ||
0.5 | ||
], | ||
"min": [ | ||
-0.5, | ||
-0.5, | ||
-0.5 | ||
], | ||
"type": "VEC3" | ||
} | ||
], | ||
"materials": [ | ||
{ | ||
"pbrMetallicRoughness": { | ||
"baseColorFactor": [ | ||
0.0, | ||
1.0, | ||
0.0, | ||
1.0 | ||
], | ||
"metallicFactor": 1.0 | ||
}, | ||
"name": "Unlit Green", | ||
"extensions": { | ||
"KHR_materials_unlit": {} | ||
} | ||
} | ||
], | ||
"bufferViews": [ | ||
{ | ||
"buffer": 0, | ||
"byteOffset": 576, | ||
"byteLength": 72, | ||
"target": 34963 | ||
}, | ||
{ | ||
"buffer": 0, | ||
"byteOffset": 0, | ||
"byteLength": 576, | ||
"byteStride": 12, | ||
"target": 34962 | ||
} | ||
], | ||
"buffers": [ | ||
{ | ||
"byteLength": 648, | ||
"uri": "data:application/octet-stream;base64,AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAvwAAAL8AAAA/AAAAPwAAAL8AAAA/AAAAvwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAL8AAAA/AAAAvwAAAL8AAAA/AAAAPwAAAL8AAAC/AAAAvwAAAL8AAAC/AAAAPwAAAD8AAAA/AAAAPwAAAL8AAAA/AAAAPwAAAD8AAAC/AAAAPwAAAL8AAAC/AAAAvwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAvwAAAD8AAAC/AAAAPwAAAD8AAAC/AAAAvwAAAL8AAAA/AAAAvwAAAD8AAAA/AAAAvwAAAL8AAAC/AAAAvwAAAD8AAAC/AAAAvwAAAL8AAAC/AAAAvwAAAD8AAAC/AAAAPwAAAL8AAAC/AAAAPwAAAD8AAAC/AAABAAIAAwACAAEABAAFAAYABwAGAAUACAAJAAoACwAKAAkADAANAA4ADwAOAA0AEAARABIAEwASABEAFAAVABYAFwAWABUA" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,7 @@ defineSuite([ | |
|
||
var boomBoxUrl = './Data/Models/PBR/BoomBox/BoomBox.gltf'; | ||
var boxPbrUrl = './Data/Models/PBR/Box/Box.gltf'; | ||
var boxPbrUnlitUrl = './Data/Models/PBR/BoxUnlit/BoxUnlit.gltf'; | ||
var boxAnimatedPbrUrl = './Data/Models/PBR/BoxAnimated/BoxAnimated.gltf'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put the model in it's own folder like we do here. Also use camel case like we do for the other models. The path should be |
||
var boxInterleavedPbrUrl = './Data/Models/PBR/BoxInterleaved/BoxInterleaved.gltf'; | ||
var riggedSimplePbrUrl = './Data/Models/PBR/RiggedSimple/RiggedSimple.gltf'; | ||
|
@@ -2692,6 +2693,21 @@ defineSuite([ | |
}); | ||
}); | ||
|
||
it('renders with the unlit extension', function() { | ||
return loadModel(boxPbrUnlitUrl).then(function(model) { | ||
model.show = true; | ||
model.zoomTo(); | ||
// We expect to see the base color when unlit | ||
expect(scene).toRenderAndCall(function(rgba) { | ||
expect(rgba[0]).toEqual(0); | ||
expect(rgba[1]).toEqual(255); | ||
expect(rgba[2]).toEqual(0); | ||
}); | ||
|
||
primitives.remove(model); | ||
}); | ||
}); | ||
|
||
it('silhouetteSupported', function() { | ||
expect(Model.silhouetteSupported(scene)).toBe(true); | ||
scene.context._stencilBits = 0; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this isn't targeting master, as the changelog is 2 versions out of date as of today's release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm merging into #6805 since that PR moves
gltfPipeline
fromThirdParty
into Cesium core.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OmarShehata Create a section for October's release and move your changes there. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see the problem now. I moved it into a new section for October. Thanks for pointing this out!