Skip to content
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

glTF 2.0 draft #826

Merged
merged 458 commits into from
Jun 5, 2017
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
458 commits
Select commit Hold shift + click to select a range
148c54d
Move base properties to end
lexaknyazev Nov 30, 2016
a40aed3
Add link to registry
lexaknyazev Nov 30, 2016
1beec2c
Update date
lexaknyazev Nov 30, 2016
ea67a1c
Fix spacing
lexaknyazev Nov 30, 2016
a966789
Tweak heading
pjcozzi Nov 30, 2016
b7572a7
Direct link to 1.1 spec
pjcozzi Nov 30, 2016
d077483
Wording tweak
pjcozzi Nov 30, 2016
2f0ae75
Small fix to inheritance.
xelatihy Nov 30, 2016
af6ae88
Fix inheritance in material.values
lexaknyazev Dec 2, 2016
ed211dd
Fix typo
lexaknyazev Dec 5, 2016
f04b770
Add #789 clarification to spec
lexaknyazev Dec 7, 2016
7975b72
Remove buffer.type
lexaknyazev Dec 18, 2016
f9abbae
Re-edit of accessor alignment reqs
lexaknyazev Jan 21, 2017
e0eee1c
1.1 -> 2.0 refactor squashed
lexaknyazev Feb 2, 2017
c0a4e2c
Remove GLSL references from README
lexaknyazev Feb 3, 2017
5d027f3
Fix link
lexaknyazev Feb 3, 2017
05cbf11
Removed techniques, shaders, programs and added Metal Roughness to Co…
sbtron Feb 4, 2017
b1d3f73
fix table formatting
sbtron Feb 4, 2017
a45cdb0
table formating take 2
sbtron Feb 4, 2017
005f88c
Updated Schema (first pass)
sbtron Feb 8, 2017
077114e
Refactored texture into an object which includes index and texcoord
sbtron Feb 9, 2017
2790944
updated material example
sbtron Feb 9, 2017
57082ca
Moved materials description out of property. Updated materials proper…
sbtron Feb 14, 2017
427f54a
Fix table formatting
sbtron Feb 14, 2017
c4c094d
more table format fixes
sbtron Feb 14, 2017
d04019c
remove material values schema
sbtron Feb 14, 2017
50da08f
minor fixes
sbtron Feb 14, 2017
1f20948
initial commit KHR_materials_pbrSpecularGlossiness extension written …
sbtron Feb 15, 2017
1aab1ee
Update f0
sbtron Feb 15, 2017
aab37d9
fixing table to display correctly within implementation note quote
sbtron Feb 17, 2017
ca62c80
fix table format again
sbtron Feb 17, 2017
655eea1
fix indentation
sbtron Feb 17, 2017
a142ed5
Augmenting accessors with sparse accessors
Feb 6, 2017
72a2da1
Properties references for sparse accessors
Feb 6, 2017
b57d3f8
added sparse accessor schema
Feb 6, 2017
99c8fdb
Specs2.0:rephrased a sentence in the sparse accessor section
Feb 11, 2017
d72678e
Following issue #827 byteStride is now a property of a buffer view, n…
Feb 23, 2017
ee98909
sparse accessors:clarifying that the indices array is a monotonic str…
Feb 23, 2017
ec98f87
#820: fixed typos
Feb 23, 2017
36f19ff
#820 clarification on the meaning of the max and min properties for s…
Feb 23, 2017
e79d229
finishing sparse accessors schema changes
lexaknyazev Feb 24, 2017
f8f60be
Refactor stride
lexaknyazev Feb 24, 2017
2b3a653
Removed glExtensionsUsed
lexaknyazev Feb 24, 2017
de1023f
target.id -> target.node
lexaknyazev Feb 24, 2017
c812fca
Remove glExtensionsUsed from readme
lexaknyazev Feb 24, 2017
7336588
target.id -> target.node (readme)
lexaknyazev Feb 24, 2017
d15373d
uri -> uriref (#838)
lexaknyazev Feb 24, 2017
9d93d63
Add note on duplicate names (#846)
lexaknyazev Feb 24, 2017
1de1427
#210: extending the mesh structure to support morph targets
Feb 24, 2017
28ebbd6
#210 Morph Targets instatiation
Feb 24, 2017
9830cf8
#210 Morph Targets example cosmetics
Feb 24, 2017
8dca518
#210 Morph Targets animation: correction to the Animation structure d…
Feb 24, 2017
51dbca1
Elaborate on URI schemes
lexaknyazev Feb 24, 2017
c1bb92c
#210 Morph Targets fixed escaping in mesh.primitive.schema.json and m…
Feb 25, 2017
d028a08
#210 Morph Targets: changed a sentence, thanks Alexey for pointing it…
Feb 25, 2017
0f02989
#210 Morph Target specifying morphing math
Feb 25, 2017
cc43fa3
Schema fixes
bghgary Feb 25, 2017
88e6006
Merge 'KhronosGroup/2.0'
bghgary Feb 25, 2017
6b02e08
Update `asset`, #829
lexaknyazev Feb 25, 2017
abcd687
Disallow top-level empty arrays, tighten up animation object
lexaknyazev Feb 25, 2017
a91e16e
Elaborate on default scene selection, #815
lexaknyazev Feb 25, 2017
6c41899
Update skinning schemes
lexaknyazev Feb 25, 2017
bfc43f8
Fix `asset` example in README
lexaknyazev Feb 25, 2017
f46aa9e
Update Skinning in README
lexaknyazev Feb 25, 2017
b756f88
Update normal and occlusion map descriptions
bghgary Feb 25, 2017
f6acda6
Merge branch '2.0' of https://github.com/KhronosGroup/glTF into 2.0
bghgary Feb 25, 2017
6cd983c
Update normal texture desciption based on feedback
bghgary Feb 26, 2017
30de0b3
cleanup todos
sbtron Feb 27, 2017
8a6a54f
Merge pull request #830 from sbtron/2.0
lexaknyazev Feb 27, 2017
b85e6e0
Merge branch '2.0' into emiliano/210
lexaknyazev Feb 27, 2017
fef81f5
Merge pull request #852 from KhronosGroup/emiliano/210
lexaknyazev Feb 27, 2017
56eafde
Fix morph examples
lexaknyazev Feb 27, 2017
8f6eafb
Huge README.md re-edit. Add placeholders for some missing sections.
lexaknyazev Feb 27, 2017
aaf5e75
Fix link
lexaknyazev Feb 27, 2017
665470a
First draft of GLB version 2.
lexaknyazev Feb 25, 2017
997f2de
Add a note on unknown chunk types.
lexaknyazev Feb 25, 2017
855957c
Add a note that JSON chunk must be the first.
lexaknyazev Feb 26, 2017
066e9be
Update title
lexaknyazev Feb 27, 2017
c08ac4e
Fix syntax highlighting
lexaknyazev Feb 27, 2017
efbbe68
Fix minor wording
bghgary Feb 27, 2017
8ff549b
Refine accessor's size definitions
lexaknyazev Feb 28, 2017
89e8473
Merge pull request #856 from sbtron/2.0
pjcozzi Feb 28, 2017
b446b85
Add examples of accessor elements
lexaknyazev Feb 28, 2017
d786dec
Generalize textureInfoBase.index and restrict textureInfoBase.texCoord
lexaknyazev Feb 28, 2017
2b8ca6e
Merge pull request #858 from KhronosGroup/accessor-size
pjcozzi Mar 1, 2017
ea5088f
Add alpha coverage details
sbtron Mar 10, 2017
146426f
Add details on alpha coverage
sbtron Mar 10, 2017
d63b796
Removed buffer.uri requirement for GLB files.
robertlong Mar 13, 2017
39910bf
Clarify accessors for external-supplied data
lexaknyazev Mar 19, 2017
18e5bb9
Merge pull request #880 from KhronosGroup/external-accessors
pjcozzi Mar 20, 2017
d9b9abd
Animating Morph Targets
Mar 22, 2017
d79dd9d
Morph Target Animation: Including reference to Sparse Accessors+cleanups
Mar 22, 2017
d45984b
Merge pull request #890 from KhronosGroup/emiliano/morph_targets_anim…
pjcozzi Mar 23, 2017
41284ae
Updated double sided property description to include double sided lig…
sbtron Mar 30, 2017
a64e7a3
fix typo
sbtron Mar 31, 2017
47ac954
Merge pull request #864 from sbtron/2.0Transparency
sbtron Mar 31, 2017
5b04bba
Fix inconsistent JSON space formatting
bghgary Mar 31, 2017
cf89ac4
Merge pull request #895 from sbtron/formatting
pjcozzi Apr 4, 2017
6ea9231
1) Update packing info for metal roughness texture 2) Add formulas fo…
sbtron Apr 5, 2017
6ec5500
Merge pull request #896 from sbtron/2.0TexturePacking
sbtron Apr 6, 2017
dda5881
Updating to right channels for metal roughness
sbtron Apr 6, 2017
4cea6aa
Merge pull request #897 from sbtron/2.0TexturePacking
sbtron Apr 6, 2017
bdd2517
Add forward compatibility support
bghgary Mar 31, 2017
0766858
More schema changes for forward compatibility
sbtron Apr 6, 2017
2d8b41b
Add versioning to readme and glb format
sbtron Apr 6, 2017
0a07fef
Remove default sampler filtering values
lexaknyazev Apr 6, 2017
eae9469
Remove gif and bmp from image
lexaknyazev Apr 6, 2017
07fd026
Remove specific fields, make sampler and source optional
lexaknyazev Apr 6, 2017
a1ad7ea
Restrict image.mimeType values
lexaknyazev Apr 6, 2017
dd6f49f
Remove unused minLength
lexaknyazev Apr 6, 2017
0798ae6
Add descriptions for material alphamode and animation interpolation
sbtron Apr 6, 2017
f539416
cleanup versioning explanation
sbtron Apr 7, 2017
6a607ca
Disallow ambiguous image definition
lexaknyazev Apr 7, 2017
2bb2845
fix tense consistency
sbtron Apr 7, 2017
93153fc
Update README for textures
lexaknyazev Apr 8, 2017
cb4afc6
Use asset instead of file.
sbtron Apr 10, 2017
f209ee3
cleanup readme
sbtron Apr 10, 2017
380cccd
fix link to additional maps
sbtron Apr 10, 2017
c34037d
Add pattern to asset version and minVersion
bghgary Apr 10, 2017
9c019a0
Add spline interpolation to animation
bghgary Apr 10, 2017
e32dd8c
Refine bufferView.target
lexaknyazev Apr 8, 2017
9f3b629
Reorganize images example description
lexaknyazev Apr 10, 2017
447193b
Merge pull request #898 from KhronosGroup/textures-2.0
lexaknyazev Apr 10, 2017
9d53e9e
Update normal maps description
sbtron Apr 10, 2017
6c37527
updating newer changeset
sbtron Apr 10, 2017
4f75d02
Merge pull request #902 from sbtron/normalTextureDescription
sbtron Apr 10, 2017
a3ef0af
Merge branch '2.0' into Versioning
lexaknyazev Apr 10, 2017
c7e4309
Remove long enum descriptions as wetzel doesn't handle it
bghgary Apr 11, 2017
b1574e9
Merge pull request #899 from sbtron/Versioning
sbtron Apr 11, 2017
7261010
Add autogenerated property reference
sbtron Apr 11, 2017
14c8584
Add materials figure
sbtron Apr 11, 2017
60b97c3
Add materials figure
sbtron Apr 11, 2017
dd68377
Remove old description (merging artifact)
lexaknyazev Apr 11, 2017
80e29cd
Update for dd68377
lexaknyazev Apr 11, 2017
d3305c7
Merge pull request #904 from sbtron/2.0Properties
lexaknyazev Apr 11, 2017
594c3c9
Merge pull request #842 from sbtron/KHRpbrSpecGloss
sbtron Apr 11, 2017
fb8b472
Add support for stored tangents and add mesh attributes table (#901)
bghgary Apr 11, 2017
3797457
Update timestamp
lexaknyazev Apr 11, 2017
56a2b15
Update cdiff calculation for metal-roughness and spec-gloss
sbtron Apr 11, 2017
a4b08e8
Update mesh.primitive.target description
lexaknyazev Apr 11, 2017
3207a97
Add linear
sbtron Apr 11, 2017
9b13195
Fix wording
lexaknyazev Apr 12, 2017
4409e57
Rename JOINT -> JOINTS_0
lexaknyazev Apr 12, 2017
990009e
Fix typo
lexaknyazev Apr 12, 2017
6588f41
Merge pull request #909 from KhronosGroup/joints-refactor
lexaknyazev Apr 12, 2017
6a639c8
Update editors et al
pjcozzi Apr 12, 2017
2526f9a
add missing parenthesis
sbtron Apr 12, 2017
0cfce9a
Addresses some feedback on default materials, default normals calcula…
bghgary Apr 12, 2017
0deabcf
Update acknowledgments
sbtron Apr 12, 2017
a8542f1
Merge pull request #911 from sbtron/specglosscontributers
sbtron Apr 12, 2017
1321cc9
remove epsilon similar to core spec
sbtron Apr 12, 2017
b39b30f
allow additional properties
sbtron Apr 12, 2017
c4ff667
Merge pull request #912 from sbtron/specglosscontributers
sbtron Apr 12, 2017
152933f
fix best practice link
sbtron Apr 12, 2017
7096168
Small edits of Animations section
lexaknyazev Apr 12, 2017
280fd9d
Merge remote-tracking branch 'refs/remotes/mainglTF/2.0'
sbtron Apr 13, 2017
b94d97a
Fix link to best practices
sbtron Apr 13, 2017
dc71680
Added company name from Norbert.
McNopper Apr 13, 2017
2dc39f4
Fix formatting
lexaknyazev Apr 13, 2017
0cdd4c2
Merge pull request #914 from McNopper/2.0_norbert_company
pjcozzi Apr 13, 2017
3a18fdb
Enable forward-compatibility for image.mimeType
lexaknyazev Apr 20, 2017
1673ba3
Disallow image without uri and bufferView
lexaknyazev Apr 20, 2017
619d06c
Adjust min and remove default value for buffer.byteLength
lexaknyazev Apr 20, 2017
b9f203d
Default value for bufferView.byteOffset, min for bufferView.byteLength.
lexaknyazev Apr 20, 2017
e24e7e7
Merge pull request #921 from KhronosGroup/byteLength-offset-fix
pjcozzi Apr 20, 2017
769c652
Inherit inner objects from glTFProperty
lexaknyazev Apr 21, 2017
e878126
Update description to indicate alphaCutoff value can be greater than 1.0
bghgary Apr 21, 2017
a0223e1
Merge pull request #925 from KhronosGroup/glTFProperty-inheritance
lexaknyazev Apr 21, 2017
c39936c
Require bufferView for byteOffset
lexaknyazev Apr 22, 2017
90f262a
Fix primitive.targets, remove unneeded schema indirection
lexaknyazev Apr 22, 2017
b7afb26
Clarify byteStride restrictions
lexaknyazev Apr 23, 2017
5e38721
Remove reference to byteStride for indices buffer, weaken target
lexaknyazev Apr 23, 2017
c0063fd
Align mesh.weights with node.weights, small edits
lexaknyazev Apr 23, 2017
5b94070
Disallow empty attributes maps
lexaknyazev Apr 24, 2017
a6b282d
Refine README on morphing
lexaknyazev Apr 24, 2017
728b357
Merge pull request #928 from KhronosGroup/mesh.primitive-fix
lexaknyazev Apr 24, 2017
e81a965
Fix description of JOINTS_0 and WEIGHTS_0 in mesh attribute table (#932)
bghgary Apr 27, 2017
026b61f
Add note to the pbrMetallicRoughness schema (#934)
lilleyse Apr 28, 2017
fd21274
Allow negative values for node.weights
lexaknyazev Apr 28, 2017
28d0753
Refine README on weights animation, allow normalized values
lexaknyazev Apr 28, 2017
e423109
Update description in schema, add normalization equations
lexaknyazev Apr 29, 2017
92b1f14
Merge pull request #935 from KhronosGroup/morph-weights-fix
lexaknyazev Apr 29, 2017
f44c3bd
node.children, scene.nodes, and skin.joints can't be empty when defined
lexaknyazev Apr 29, 2017
e240c16
Merge pull request #936 from KhronosGroup/empty-arrays-fix
lexaknyazev Apr 30, 2017
6e6ae37
Tighten up byteStride usage
lexaknyazev Apr 30, 2017
d122766
Merge pull request #930 from KhronosGroup/byteStride
lexaknyazev Apr 30, 2017
a904648
More byteStride tightening
lexaknyazev Apr 30, 2017
0b3dbdd
tighten up orthographic.zfar
lexaknyazev May 1, 2017
4209c52
update vertex colors for MR
sbtron May 3, 2017
d1605ab
update vertex colors for SG
sbtron May 3, 2017
9c989ae
Merge remote-tracking branch 'refs/remotes/mainglTF/2.0'
sbtron May 3, 2017
d39945e
Merge pull request #907 from sbtron/Cdiffcalcuation
pjcozzi May 6, 2017
6cdc607
Disallow presence of TRS and matrix at the same time
lexaknyazev May 8, 2017
8f7effb
Merge pull request #950 from KhronosGroup/node-schema-fix
lexaknyazev May 8, 2017
66aca7e
Fix rule
lexaknyazev May 8, 2017
1549902
Merge pull request #951 from KhronosGroup/node-schema-fix1
lexaknyazev May 8, 2017
dd842a4
Add description of float data format, small md edits
lexaknyazev May 12, 2017
5a6eaf2
Move some enum long descripions to per-value fields.
emackey May 12, 2017
2db4c89
Merge pull request #954 from KhronosGroup/float-data-fix
pjcozzi May 17, 2017
6240f46
Merge pull request #955 from emackey/enum-long-descriptions
pjcozzi May 17, 2017
3c0ca2f
Added default setting for camera.
McNopper May 18, 2017
1d8b3ba
Improved default camera orientation definition.
McNopper May 18, 2017
56ee294
Specify CCW winding order for front faces
bghgary May 19, 2017
23de05c
Remove schema examples
bghgary May 19, 2017
8d67483
Merge pull request #959 from McNopper/2.0_camera_direction_fix
pjcozzi May 20, 2017
038a103
Merge pull request #966 from bghgary/remove-schema-examples
pjcozzi May 20, 2017
11f4f9a
Merge pull request #963 from bghgary/specify-winding-order
pjcozzi May 20, 2017
89e9b70
Add accessor.bufferView description
lexaknyazev May 21, 2017
dcfe39a
Update behavior when no default scene is defined
lexaknyazev May 17, 2017
8d92af6
Merge pull request #970 from KhronosGroup/accessor-bufferView-desc
pjcozzi May 22, 2017
96961a3
Merge pull request #958 from KhronosGroup/default-scene-fix
pjcozzi May 22, 2017
080c3d5
Clarify morph target attribute types, wording, and example
bghgary May 19, 2017
3d3db04
Future-proof animation.channel.target
lexaknyazev May 17, 2017
3a0325c
Disallow ambiguous camera definition
lexaknyazev May 23, 2017
6dbd573
Generalize accessor.min/max data type restrictions.
lexaknyazev May 24, 2017
a3a7416
KHR_materials_pbrSpecularGlossiness extends glTFProperty.
lexaknyazev May 24, 2017
9de934a
Make accessor.min and max optional
lexaknyazev May 25, 2017
8423cf8
Add section on accessor bounds, update animation descriptions.
lexaknyazev May 25, 2017
3876dc5
Merge pull request #975 from KhronosGroup/accessor-float-fix
pjcozzi May 25, 2017
6820d04
Added implementation note about morph target counts (#977)
javagl May 26, 2017
e4b00f8
Update README with spline interpolation appendix (#962)
bghgary May 26, 2017
afd5add
Add implementation note for negative transform determinant
bghgary May 30, 2017
75be81f
Soft enforcement of unit quaternions.
lexaknyazev May 21, 2017
05376d2
Clarify state of non-animated properties
lexaknyazev May 30, 2017
dba1558
Update Khronos copyright statement
pjcozzi May 31, 2017
122c994
Fix link
lexaknyazev May 31, 2017
3ac6c4a
Add Ed, Don, and Norbert to working group section
pjcozzi May 31, 2017
c2d1724
Add couple notes on image.mimeType
lexaknyazev May 29, 2017
dd6735b
Add a note on non-invertible transformations
lexaknyazev May 31, 2017
8b03e14
Merge pull request #985 from bghgary/negative-determinant
bghgary May 31, 2017
86262a2
Small edits of URIs section
lexaknyazev Jun 1, 2017
8c607d7
Merge pull request #987 from KhronosGroup/pjcozzi-patch-1
pjcozzi Jun 2, 2017
5b2ba66
Merge pull request #988 from KhronosGroup/pjcozzi-patch-2
pjcozzi Jun 2, 2017
30e7c43
Re-edit of animations section, update accessor description
lexaknyazev Jun 2, 2017
988b8c2
Add implementation note for lighting on LINES and POINTS
snagy Jun 2, 2017
b5a6c11
Merge pull request #992 from snagy/2.0
pjcozzi Jun 3, 2017
0454571
Regenerated property reference
sbtron Jun 4, 2017
06e56be
Merge pull request #997 from sbtron/RegenerateProperties
sbtron Jun 4, 2017
93d1ded
Update copyright statement and format issues
sbtron Jun 4, 2017
ccc6623
Merge pull request #998 from sbtron/updatecopyright
sbtron Jun 4, 2017
09b7a78
Clarify matrix accessor alignment.
lexaknyazev Jun 4, 2017
cad4e6f
Fix animation.sampler title
lexaknyazev Jun 4, 2017
6c93325
Merge glb into main readme
sbtron Jun 5, 2017
cf64fbc
Cleanup links to glTF 2.0
sbtron Jun 5, 2017
03578e4
fix vendor extension title
sbtron Jun 5, 2017
7fe1cfa
Merge pull request #1000 from sbtron/mergeglb
sbtron Jun 5, 2017
d263e63
Merge pull request #1001 from sbtron/overviewcleanup
sbtron Jun 5, 2017
15c8aaf
Merge pull request #999 from KhronosGroup/matrix-alignment-fix
pjcozzi Jun 5, 2017
aafc6ac
Updated Last Updated date
pjcozzi Jun 5, 2017
8d36890
Merge branch 'master' into 2.0
pjcozzi Jun 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ glTF™ (GL Transmission Format) is a royalty-free specification for the efficie

## Specification

* [glTF Specification, 1.0](specification/1.0/README.md)
* [glTF Specification, 1.1](specification/1.1/README.md) (or [all specification versions](specification/README.md))
* [glTF Extension Registry](extensions/README.md)

Please provide feedback by submitting [issues](https://github.com/KhronosGroup/glTF/issues).
Expand Down
216 changes: 216 additions & 0 deletions extensions/Khronos/KHR_materials_pbrSpecularGlossiness/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
# KHR\_materials\_pbrSpecularGlossiness

## Khronos 3D Formats Working Group
* Saurabh Bhatia, Microsoft [@iamsbtron](https://twitter.com/iamsbtron)
* Gary Hsu, Microsoft [@bghgary](https://twitter.com/bghgary)
* Patrick Cozzi, Cesium, [@pjcozzi](https://twitter.com/pjcozzi)

## Acknowledgments

* Max Limper, Fraunhofer IGD, [@mlimper_cg](https://twitter.com/mlimper_cg)
* Timo Sturm, Fraunhofer IGD, [@\_tsturm\_](https://twitter.com/\_tsturm\_)
* Miguel Sousa, Fraunhofer IGD, [@mfportela](https://twitter.com/mfportela)
* Maik Thöner, Fraunhofer IGD, [@mthoener](https://twitter.com/mthoener)
* Eric Haines, Autodesk, [@pointinpolygon](https://twitter.com/pointinpolygon)
* Cedric Pinson, Sketchfab, [@trigrou](https://twitter.com/trigrou)

## Status

Draft

## Dependencies

Written against the glTF 2.0 spec.

## Overview

This extension defines the specular-glossiness material model from Physically-Based Rendering (PBR). This extensions allows glTF to support this additional workflow.

The [best practices](#bestpractices) section specifies what an implementation must to do when encountering this extension, and how the extension interacts with the materials defined in the base specification.

## Extending Materials

The PBR specular-glossiness materials are defined by adding the `KHR_materials_pbrSpecularGlossiness` extension to any glTF material.
For example, the following defines a material like gold using specular-glossiness parameters.:

```
{
"materials": [
{
"name": "gold",
"extensions": {
"KHR_materials_pbrSpecularGlossiness": {
"diffuseFactor": [ 0.5, 0.5, 0.5, 1 ],
"specularFactor": [ 0.0, 0.0, 0.0 ],
"glossinessFactor": 0.8
}
}

}
]
}
```

### Specular - Glossiness

<p>
<img src="./figures/specular-glossiness material.png"/>
</p>

The specular-glossiness material model is defined by the following properties:
* `diffuse` - Reflected diffuse color of the material
* `specular` - Specular color of the material
* `glossiness` - Glossiness of the material

The diffuse value represents the reflected diffuse color of the material. The specular value defines the specific measured reflectance value at normal incidence (F0). The glossiness property is a factor between `0.0` (rough surface) and `1.0` (smooth surface) and represents the surface irregularities that cause light diffusion.

The specular property from specular-glossiness material model is the same as the base color value from the metallic-roughness material model for metals. The glossiness property from specular-glossiness material model is related with the roughness property from the metallic-roughness material model and is defined as `glossiness = 1 - roughness`. See [appendix](#appendix) for more details on how you can convert between these two material models.

The value for each property (`diffuse`, `specular`, `glossiness`) can be defined using factors or textures. The `specular` and `glossiness` properties are packed together in a single texture called `specularGlossinessTexture`. If a texture is not given, all respective texture components within this material model are assumed to have a value of `1.0`. The factors (`diffuseFactor`, `specularFactor`, `glossinessFactor`) scale, in linear space, the components given in the respective textures (`diffuseTexture`, `specularGlossinessTexture`). Texture content must be converted to linear space before it is used for any lighting computations.

The following equations show how to calculate bidirectional reflectance distribution function (BRDF) inputs (*c<sub>diff</sub>*, *F<sub>0</sub>*, *&alpha;*) from the metallic-roughness material properties.

*c<sub>diff</sub>* = `diffuse.rgb * (1 - max(specular.r, specular.g, specular.b)`
<br>
*F<sub>0</sub>* = `specular`
<br>
*&alpha;* = `(1 - glossiness) ^ 2`

All implementations should use the same calculations for the BRDF inputs. Implementations of the BRDF itself can vary based on device performance and resource constraints. See [appendix](/specification/2.0/README.md#appendix-a) for more details on the BRDF calculations.

The following table lists the allowed types and ranges for the specular-glossiness model:

| |Type|Description|Required|
|---|----|-----------|--------|
|**diffuseFactor** | `number[4]` | The reflected diffuse factor of the material.|No, default:`[1.0,1.0,1.0,1.0]`|
|**diffuseTexture** | [`textureInfo`](/specification/2.0/README.md#reference-textureInfo) | The diffuse texture.|No|
|**specularFactor** | `number[3]` | The specular RGB color of the material. |No, default:`[1.0,1.0,1.0]`|
|**glossinessFactor** | `number` | The glossiness or smoothness of the material. |No, default:`1.0`|
|**specularGlossinessTexture** | [`textureInfo`](/specification/2.0/README.md#reference-textureInfo) | The specular-glossiness texture.|No|

Additional properties are allowed.

* **JSON schema**: [glTF.KHR_materials_pbrSpecularGlossiness.schema.json](schema/glTF.KHR_materials_pbrSpecularGlossiness.schema.json)

### diffuseFactor

The RGBA components of the reflected diffuse color of the material. Metals have a diffuse value of `[0.0, 0.0, 0.0]`. The fourth component (A) is the opacity of the material. The values are linear.

* **Type**: `number[4]`
* **Required**: No, default:`[1.0,1.0,1.0,1.0]`
* **Range**: [0,1] for all components

### diffuseTexture

The diffuse texture. This texture contains RGB(A) components of the reflected diffuse color of the material in sRGB color space. If the fourth component (A) is present, it represents the alpha coverage of the material. Otherwise, an alpha of 1.0 is assumed. The `alphaMode` property specifies how alpha is interpreted. The stored texels must not be premultiplied.

* **Type**: [`textureInfo`](/specification/2.0/README.md#reference-textureInfo)
* **Required**: No

### specularFactor

The specular RGB color of the material. This value is linear.

* **Type**: `number[3]`
* **Required**: No, default:`[1.0,1.0,1.0]`
* **Range**: [0,1] for all components


### glossinessFactor

The glossiness or smoothness of the material. A value of 1.0 means the material has full glossiness or is perfectly smooth. A value of 0.0 means the material has no glossiness or is perfectly rough. This value is linear.

* **Type**: `number`
* **Required**: No, default:`1.0`
* **Range**: [0,1]

### specularGlossinessTexture

The specular-glossiness texture is a RGBA texture, containing the specular color (RGB) in sRGB space and the glossiness value (A) in linear space.

* **Type**: [`textureInfo`](/specification/2.0/README.md#reference-textureInfo)
* **Required**: No


#### Additional Maps

The [additional maps](/specification/2.0/README.md#additional-maps) defined in glTF materials node can also be used with the PBR specular-glossiness material model parameters defined in this extension.

```
{
"materials": [
{
"extensions": {
"KHR_materials_pbrSpecularGlossiness": {
"diffuseTexture": {
"index": 0
},
"glossinessFactor": 0.5,
"specularGlossinessTexture": {
"index": 0,
"texCoord": 0
}
}
},
"normalTexture": {
"scale": 2,
"index": 3,
"texCoord": 1
},
"emissiveFactor": [ 0.2, 0.1, 0.0 ]
}
]
}
```

<a name="bestpractices"></a>
## Best practices

The PBR specular-glossiness extension can be used along with PBR metallic-roughness material model in glTF to enable support for both PBR workflows. Specular-glossiness can represent a broader range of materials compared to metallic-roughness. However, supporting specular-glossiness on low-resource devices may not be possible as it is more resource heavy than the metallic-roughness model. To get the best of both worlds a glTF asset can include both metallic-roughness and specular-glossiness in a single glTF asset. This allows the asset to take advantage of richer specular-glossiness materials where possible and still have a fall back with metallic-roughness to ensure that the asset can be rendered everywhere. Since such an approach requires including both material models it is best suited for a web scenario where a client can choose to download the appropriate material model from a server hosting the glTF asset.

The following example shows how the same material can be defined using both metallic-roughness as well as specular-glossiness material models:

```
{
"materials": [
{
"name": "gold",
"pbrMetallicRoughness": {
"baseColorfactor": [ 1.000, 0.766, 0.336, 1.0 ],
"metallicFactor": 1.0,
"roughnessFactor": 0.0
},
"extensions": {
"KHR_materials_pbrSpecularGlossiness": {
"diffuseFactor": [ 0.5, 0.5, 0.5, 1 ],
"specularFactor": [ 0.0, 0.0, 0.0 ],
"glossinessFactor": 0.8
}
}
}
]
}
```
If the specular-glossiness extension is included in an asset, then any client implementation that supports the extension should always render the asset using the specular-glossiness material properties.

A `material` may specify the specular-glossiness extension without including any metallic-roughness properties. For such an asset, the best practice is to include the specular-glossiness extension using the `extensionRequired` property so that the asset is only loaded by clients that can render the specular-glossiness material. This approach trades asset portability for a smaller file size. If `extensionsUsed` property is specified instead of `extensionsRequired`, then a client that does not support the specular-glossiness extension will render the asset as if no material was specified.

The following table describes the expected rendering behavior based on the material definitions included in the asset:

| | Client supports metallic-roughness | Client supports metallic-roughness and specular-glossiness |
|----|:----:|:----:|
|Asset has metallic-roughness | Render metallic-roughness | Render metallic-roughness |
|Asset has metallic-roughness and specular-glossiness | Render metallic-roughness | Render specular-glossiness |
|Asset has specular-glossiness with `extensionsRequired`| Fail to load | Render specular-glossiness |
|Asset has specular-glossiness with `extensionsUsed` | Render as if no material | Render specular-glossiness |

## Appendix

Conversion between the two PBR material models:
- [Convert between metallic-roughness and specular-glossiness using BabylonJS](examples/convert-between-workflows-bjs/)
- [Convert between metallic-roughness and specular-glossiness using WebGL and threeJS](examples/convert-between-workflows/)





Binary file not shown.
Binary file not shown.
Loading