diff --git a/.gitignore b/.gitignore index 538c8c5..f2b0a07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -.DS_Store +*.import +*.uid *~ +.DS_Store diff --git a/extensions/2.0/OMI_environment_sky/README.md b/extensions/2.0/OMI_environment_sky/README.md new file mode 100644 index 0000000..2f68d81 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/README.md @@ -0,0 +1,337 @@ +# OMI_environment_sky + +## Contributors + +- Aaron Franke, Godot Engine. + +## Status + +Open Metaverse Interoperability Group Draft Proposal + +## Dependencies + +Written against the glTF 2.0 spec. + +## Overview + +This extension allows defining the skybox of a glTF asset, and how the sky provides environment lighting. The sky can be a gradient, panorama, physical sky, or plain sky. The sky can be used to light the scene, provide a background, or both. To add suns to the sky, use the `KHR_lights_punctual` extension to define directional lights. + +### Example: + +This example defines a panorama sky with an equirectangular texture, and defines a sun by having a directional light aligned with the texture. It is a subset of [examples/epic_blue_sunset_equirectangular.gltf](examples/epic_blue_sunset_equirectangular.gltf): + +```json +{ + "extensions": { + "KHR_lights_punctual": { + "lights": [{ "type": "directional" }] + }, + "OMI_environment_sky": { + "skies": [ + { + "panorama": { + "equirectangular": 0 + }, + "type": "panorama" + } + ] + } + }, + "extensionsUsed": ["KHR_lights_punctual", "OMI_environment_sky"], + "images": [ + { + "mimeType": "image/jpeg", + "name": "allskyfree_epic_blue_sunset", + "uri": "epic_blue_sunset/allskyfree_epic_blue_sunset.jpg" + } + ], + "nodes": [ + { "children": [1], "name": "EpicBlueSunsetEquirectangular" }, + { + "extensions": { "KHR_lights_punctual": { "light": 0 } }, + "name": "Sun", + "rotation": [-0.0348995115423885, 0.0, 0.0, 0.999390826500875] + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }], + "textures": [{ "source": 0 }] +} +``` + +This example defines a gradient sky, black all around, with a red dwarf star huge in the sky thanks to the sun curve and a red directional light. It is a subset of [examples/space_black_gradient.gltf](examples/space_black_gradient.gltf): + +```json +{ + "extensions": { + "KHR_lights_punctual": { + "lights": [ + { + "color": [1, 0.05, 0.05], + "intensity": 0.5, + "type": "directional" + } + ] + }, + "OMI_environment_sky": { + "skies": [ + { + "gradient": { + "bottomColor": [0.01, 0.01, 0.01], + "horizonColor": [0.01, 0.01, 0.01], + "sunAngleMax": 0.25, + "sunCurve": 4, + "topColor": [0.01, 0.01, 0.01] + }, + "type": "gradient" + } + ] + } + }, + "extensionsUsed": ["KHR_lights_punctual", "OMI_environment_sky"], + "nodes": [ + { "children": [1], "name": "SpaceBlackGradient" }, + { + "extensions": { "KHR_lights_punctual": { "light": 0 } }, + "name": "SunDimRed", + "rotation": [-0.12941067816757, 0.836515365063497, 0.482963555466784, 0.224145320004181] + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }] +} +``` + +More example assets can be found in the [examples/](examples/) folder. + +## glTF Schema Updates + +This extension consists of one new data structure for defining the environment sky, `"OMI_environment_sky"`. The key `"OMI_environment_sky"` can be added to the document-level `"extensions"` to define the environment sky of the glTF asset. + +The extension must also be added to the glTF's `extensionsUsed` array and because it is optional, it does not need to be added to the `extensionsRequired` array. + +### Sky Property Summary + +These properties are defined on each sky. Multiple skies may be specified in the `"skies"` array. + +| | Type | Description | Default value | +| -------------------------- | ----------- | ---------------------------------------------------------------------------------- | -------------------- | +| **ambientLightColor** | `number[3]` | The color of the ambient light, if sky contribution is less than 1.0. | `[0.0, 0.0, 0.0]` | +| **ambientSkyContribution** | `number` | The ratio of contribution the sky makes to the ambient light. | 1.0 | +| **type** | `string` | The type of sky as a string (`"gradient"`, `"panorama"`, `"physical"`, `"plain"`). | Required, no default | +| **gradient** | `object` | If the type is `"gradient"`, the gradient sky properties. | `null` | +| **panorama** | `object` | If the type is `"panorama"`, the panorama sky properties. | `null` | +| **physical** | `object` | If the type is `"physical"`, the physical sky properties. | `null` | +| **plain** | `object` | If the type is `"plain"`, the plain color sky properties. | `null` | + +#### Ambient Light Color + +The `"ambientLightColor"` property is an array of three numbers that defines the color of the ambient light. The default value is `[0.0, 0.0, 0.0]`, which is black. + +This only has an effect if the `"ambientSkyContribution"` is less than 1.0. As such, to set a custom ambient light color separate from the sky's color, both properties must be specified. The ambient color may have values greater than 1.0, which indicate high energy, HDR, or overbright ambient light, but usually, the values are between 0.0 and 1.0. + +#### Ambient Sky Contribution + +The `"ambientSkyContribution"` property is a number that defines the ratio of ambient light contribution between the ambient color and the sky color. The default value is 1.0, which means that the ambient color is the same as the sky color. + +Valid values are on a range of 0.0 to 1.0, inclusive. A value of 0.0 means that all ambient light is the ambient color, and no sky color is added. A value of 1.0 means that all ambient light is the sky color, and the `"ambientLightColor"` property is ignored. A value between 0.0 and 1.0 is a mix of the two colors. Unity only supports 0.0 and 1.0, while Godot supports the full range of values in-between. + +#### Type + +The `"type"` property is a string enum that defines the type of sky. It is required and has no default value. The possible values are `"panorama"`, `"physical"`, and `"gradient"`. + +Here is a comparison of the types of sky in `OMI_environment_sky` and the corresponding sky types in various engines: + +| Sky Type | Unity | Unreal | Godot | Blender | +| ----------- | ------------------------- | ------------- | ----------------------- | ------- | +| Gradient | Skybox/Procedural | Skydome Mesh | ProceduralSkyMaterial | | +| Panorama | Skybox/Panoramic | Skydome Mesh | PanoramaSkyMaterial | | +| Physical | HDRP Physically Based Sky | SkyAtmosphere | PhysicalSkyMaterial | | +| Plain Color | | | Background Custom Color | | + +In Unity, only Panorama and Gradient skies are supported in all pipelines. Physical sky requires the High Definition Render Pipeline (HDRP). + +In Unreal, only Physical skies are directly supported. Panorama and Gradient skies can be implemented with a skydome mesh; the material must have the "Shading Model" set to "Unlit" and "Is Sky" set to true. + +### Gradient Sky Properties + +Gradient skies use color gradients to define the sky colors. The `"gradient"` property is an object that contains the gradient sky properties: + +| | Type | Description | Default value | +| ---------------- | ----------- | --------------------------------------------------------------- | -------------------- | +| **bottomColor** | `number[3]` | The color of the sky at the bottom, also known as the nadir. | Required, no default | +| **bottomCurve** | `number` | The transition curve between the bottom and the horizon colors. | 0.02 | +| **horizonColor** | `number[3]` | The color of the sky at the horizon. | Required, no default | +| **topColor** | `number[3]` | The color of the sky at the top, also known as the zenith. | Required, no default | +| **topCurve** | `number` | The transition curve between the top and the horizon colors. | 0.15 | +| **sunAngleMax** | `number` | The maximum radius angle of the sun(s) in radians. | 0.5 | +| **sunCurve** | `number` | The transition curve between the sun(s) and the sky colors. | 0.15 | + +#### Bottom Color + +The `"bottomColor"` property is an array of three numbers that defines the color of the sky at the bottom, also known as the nadir. This property is required for gradient skies and has no default value. + +The bottom color may have values greater than 1.0, which indicate high energy, HDR, or overbright bottom color, but usually, the values are between 0.0 and 1.0. + +#### Bottom Curve + +The `"bottomCurve"` property is a number that defines the transition curve between the bottom and the horizon colors. It is a unitless number. If not specified, the default value is 0.02. + +A curve value of 1.0 is a linear transition. Values between 0.0 and 1.0 make the bottom color more dominant, while values between 1.0 and infinity make the horizon color more dominant. The value must be a positive number. + +#### Horizon Color + +The `"horizonColor"` property is an array of three numbers that defines the color of the sky at the horizon. This property is required for gradient skies and has no default value. + +The horizon color may have values greater than 1.0, which indicate high energy, HDR, or overbright horizon color, but usually, the values are between 0.0 and 1.0. + +#### Top Color + +The `"topColor"` property is an array of three numbers that defines the color of the sky at the top, also known as the zenith. This property is required for gradient skies and has no default value. + +The top color may have values greater than 1.0, which indicate high energy, HDR, or overbright top color, but usually, the values are between 0.0 and 1.0. + +#### Top Curve + +The `"topCurve"` property is a number that defines the transition curve between the top and the horizon colors. It is a unitless number. If not specified, the default value is 0.15. + +A curve value of 1.0 is a linear transition. Values between 0.0 and 1.0 make the top color more dominant, while values between 1.0 and infinity make the horizon color more dominant. The value must be a positive number. + +#### Sun Angle Max + +The `"sunAngleMax"` property is a number that defines the maximum radius angle of the sun in radians. If not specified, the default value is 0.5, or about 28.6479 degrees. + +Note that this defines the outermost maximum angle that the sun would have if the sun curve was infinity. + +#### Sun Curve + +The `"sunCurve"` property is a number that defines the transition curve between the sun and the sky colors. It is a unitless number. If not specified, the default value is 0.15. + +A curve value of 1.0 is a linear transition. Values between 0.0 and 1.0 make the sky color more dominant, while values between 1.0 and infinity make the sun color more dominant. The value must be a positive number. + +### Panorama Sky Properties + +Panorama skies use a texture or set of textures to represent the sky. The `"panorama"` property is an object that contains the panorama sky properties: + +| | Type | Description | +| ------------------- | ------------ | ------------------------------------------------------------------------- | +| **cubemap** | `integer[6]` | The indices of 6 textures making up a cubemap in the `textures` array. | +| **equirectangular** | `integer` | The index of an equirectangular panorama texture in the `textures` array. | + +#### Cubemap + +The `"cubemap"` property is an array of 6 integer indices that reference textures in the glTF document-level textures array. If not specified, this sky does not have a cubemap texture. + +If present, the value must be a 6-element array of integers which refer to 6 textures by index. The indices of the textures in the array are in the order +X, -X, +Y, -Y, +Z, -Z. + +Cubemap skybox textures are not recommended because not all game engines support them. Unity does, while Unreal and Godot do not. If an engine does not support cubemap skyboxes, an importer may either convert the cubemap to an equirectangular texture, or use a mesh to represent the skybox. Additionally, if the glTF file includes both a cubemap and equirectangular texture, the equirectangular texture may be loaded as a fallback. + +#### Equirectangular + +The `"equirectangular"` property is an integer index that references a texture in the glTF document-level textures array. If not specified, this sky does not have an equirectangular texture. + +The equirectangular skybox texture is projected with the top of the texture in the +Y direction, the middle of the texture in the +Z direction, and the left of the texture in the +X direction. It may seem odd to have the left be +X, but since this is a skybox, it is viewed from the inside; this ensures that the texture is not flipped when viewed from the inside. For example, if the skybox image has text on it, the text should be readable on the skybox. This is consistent with what all major 3D engines do. + +### Physical Sky Properties + +Physical skies use a physically-based model to simulate the scattering of light in the atmosphere. The `"physical"` property is an object that contains the physical sky properties: + +| | Type | Description | Default value | +| ----------------- | ----------- | --------------------------------------------------------------------- | ----------------- | +| **groundColor** | `number[3]` | The color of the ground (not part of the atmospheric simulation). | `[0.3, 0.2, 0.1]` | +| **mieAnisotropy** | `number` | The anisotropy of Mie scattering (the thing that makes clouds white). | 0.8 | +| **mieColor** | `number[3]` | The color of Mie scattering (the thing that makes clouds white). | `[1.0, 1.0, 1.0]` | +| **mieScale** | `number` | The scale of Mie scattering (the thing that makes clouds white). | 0.000005 | +| **rayleighColor** | `number[3]` | The color of Rayleigh scattering (the thing that makes the sky blue). | `[0.3, 0.5, 1.0]` | +| **rayleighScale** | `number` | The scale of Rayleigh scattering (the thing that makes the sky blue). | 0.00003 | + +#### Ground Color + +The `"groundColor"` property is an array of three numbers that defines the color of the ground. The default value is `[0.3, 0.2, 0.1]`, which is a sane default for Earth-like skies. + +This color is not part of the atmospheric simulation, but it is used to provide a color for the bottom part of the skybox. Realistically, the bottom of the skybox should be obscured by a planet's terrain, but there are cases where the bottom of the skybox is visible, or there is a need for the scene to have ambient light from below. + +#### Mie Anisotropy + +The `"mieAnisotropy"` property is a number that defines the anisotropy of Mie scattering, also known as eccentricity. It is a unitless number between -1.0 and 1.0, inclusive. If not specified, the default value is 0.8, which is a sane default for Earth-like skies. + +A value of 0.0 is isotropic scattering, all light scatters equally in all directions. A value of 1.0 is forward scattering, where light scatters more in the forward direction. A value of -1.0 is backward scattering, where light scatters more in the backward direction. Realistic skies usually have a value between 0.6 and 0.9. Large particle sizes will have a higher value, such as rain droplets reflecting light to make a rainbow. Unreal does not support negative anisotropy values, while Godot does. + +#### Mie Color + +The `"mieColor"` property is an array of three numbers that defines the color of Mie scattering, which is the thing that makes clouds white. The default value is `[1.0, 1.0, 1.0]`, which is a sane default for Earth-like skies. + +#### Mie Scale + +The `"mieScale"` property is a number that defines the scale of Mie scattering, also known as the coefficient of Mie scattering. It has a unit of inverse meters (m⁻¹). If not specified, the default value is 0.000005, which is a sane default for Earth-like skies. + +The Mie scattering settings affect the color of the sky itself. In clear skies, Mie scattering is usually quite weak. In cases where there is a lot of dust, smoke, haze, fog, pollution, or other particles in the air, the Mie scattering can be stronger. + +Note: Game engines may use different scales for the units. glTF uses only base metric units, so it is in inverse meters. However, Unreal and Godot use inverse kilometers, so a glTF value of 0.000005 needs to be multiplied by 1000 on import to 0.005. Unreal defaults to 0.003996, and Godot defaults to 0.005. + +#### Rayleigh Color + +The `"rayleighColor"` property is an array of three numbers that defines the color of Rayleigh scattering, which is the thing that makes the sky blue. The default value is `[0.3, 0.5, 1.0]`, which is a sane default for Earth-like skies. + +#### Rayleigh Scale + +The `"rayleighScale"` property is a number that defines the scale of Rayleigh scattering, also known as the coefficient of Rayleigh scattering. It has a unit of inverse meters (m⁻¹). If not specified, the default value is 0.00003, which is a sane default for Earth-like skies. + +Note: Game engines may use different scales for the units. glTF uses only base metric units, so it is in inverse meters. However, Unreal uses inverse kilometers, so a glTF value of 0.00003 needs to be multiplied by 1000 on import to 0.03. Godot uses inverse hundred kilometers, so a glTF value of 0.00003 needs to be multiplied by 100000 on import to 3.0. Unreal defaults to 0.0331, and Godot defaults to 2.0. + +#### Plain Sky Properties + +Plain color skies use a single color to represent the sky. Plain color skies are the simplest type, and are useful for making a single neutral color sky for previewing a scene, among other uses. The `"plain"` property is an object that contains the plain color sky properties: + +| | Type | Description | Default value | +| --------- | ----------- | --------------------- | ----------------- | +| **color** | `number[3]` | The color of the sky. | `[0.0, 0.0, 0.0]` | + +#### Color + +The `"color"` property is an array of three numbers that defines the color of the sky. If not specified, the default value is `[0.0, 0.0, 0.0]`, which is black. + +### Document-level Properties + +The `"OMI_environment_sky"` extension is defined at the root of the glTF document, in the `"extensions"` object. It holds an array of sky resources, and an integer that references a sky to use as the default sky. + +| | Type | Description | Default value | +| --------- | ---------- | ----------------------------------------------------------------------- | ------------- | +| **skies** | `object[]` | The skies available to use in the scene. | `[]` | +| **sky** | `integer` | The index of the sky to use by default, if not overridden by the scene. | 0 | + +Only one sky may be active at a time. In most situations, glTF files will only contain one sky. However, a glTF file may contain multiple skies if it contains multiple scenes, or includes a mechanism for changing the sky at runtime, such as by animation or script. + +Generally, it is expected that only one glTF file with a sky should be instantiated at a time. This may be the main "map" glTF scene, or a glTF dedicated to holding a sky. glTF files intended to be used as individual objects that get composed into a scene should not use the `"OMI_environment_sky"` extension. Do not use `"OMI_environment_sky"` as a "preview environment" within a glTF representing an object to avoid conflicts over the sky when that object is instantiated in a larger scene. The behavior of multiple glTF files trying to control the sky is undefined. + +### Scene Properties + +The `"OMI_environment_sky"` extension may also be defined on a glTF scene, in the `"extensions"` object. It holds an integer that references a sky to use. + +| | Type | Description | Default value | +| ------- | --------- | ------------------------------------------------------- | ------------- | +| **sky** | `integer` | The index of the sky to use for this scene, if defined. | -1 | + +The scene-level sky index is an override for the document-level sky index. If the scene does not have a `"sky"` set, use the value from the document-level extension. + +### JSON Schema + +See [schema/glTF.OMI_environment_sky.sky.schema.json](schema/glTF.OMI_environment_sky.sky.schema.json) for the main schema, and the following for the sub-schemas: + +- Gradient: [schema/glTF.OMI_environment_sky.sky.gradient.schema.json](schema/glTF.OMI_environment_sky.sky.gradient.schema.json) +- Panorama: [schema/glTF.OMI_environment_sky.sky.panorama.schema.json](schema/glTF.OMI_environment_sky.sky.panorama.schema.json) +- Physical: [schema/glTF.OMI_environment_sky.sky.physical.schema.json](schema/glTF.OMI_environment_sky.sky.physical.schema.json) +- Plain: [schema/glTF.OMI_environment_sky.sky.plain.schema.json](schema/glTF.OMI_environment_sky.sky.plain.schema.json) + +See also [schema/glTF.OMI_environment_sky.schema.json](schema/glTF.OMI_environment_sky.schema.json) for the document-level schema and [schema/scene.OMI_environment_sky.schema.json](schema/scene.OMI_environment_sky.schema.json) for the scene-level schema. + +## Known Implementations + +- Godot Engine add-on https://github.com/omigroup/omi-godot/pull/15 + +## Resources: + +- Unity Procedural Skybox: https://docs.unity3d.com/2022.3/Documentation/Manual/shader-skybox-procedural.html +- Unity Physically Based Sky HDRP: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@12.1/manual/Override-Physically-Based-Sky.html +- Unreal Sky Atmosphere: https://dev.epicgames.com/documentation/en-us/unreal-engine/sky-atmosphere-component-in-unreal-engine#renderingtheskyusingaskydomemesh +- Godot Sky and Sky Material: https://docs.godotengine.org/en/stable/classes/class_sky.html#class-sky-property-sky-material diff --git a/extensions/2.0/OMI_environment_sky/examples/cube_mesh_data.bin b/extensions/2.0/OMI_environment_sky/examples/cube_mesh_data.bin new file mode 100644 index 0000000..76a4641 Binary files /dev/null and b/extensions/2.0/OMI_environment_sky/examples/cube_mesh_data.bin differ diff --git a/extensions/2.0/OMI_environment_sky/examples/default_physical_sky.gltf b/extensions/2.0/OMI_environment_sky/examples/default_physical_sky.gltf new file mode 100644 index 0000000..7fba64e --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/examples/default_physical_sky.gltf @@ -0,0 +1,91 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.5, 0.5, 0.5], + "min": [-0.5, -0.5, -0.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 0, 1, 1], + "min": [-1, -0.00001525925472, -1, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1], + "min": [0, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23], + "min": [0], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "version": "2.0" + }, + "bufferViews": [ + { "buffer": 0, "byteLength": 288, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 288, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 672, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 960, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 1152, "target": 34963 } + ], + "buffers": [{ "byteLength": 1224, "uri": "cube_mesh_data.bin" }], + "extensions": { + "OMI_environment_sky": { + "skies": [ + { + "type": "physical" + } + ] + } + }, + "extensionsUsed": ["GODOT_single_root", "OMI_environment_sky"], + "materials": [{}], + "meshes": [ + { + "primitives": [ + { + "attributes": { "NORMAL": 2, "POSITION": 0, "TANGENT": 1, "TEXCOORD_0": 3 }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + } + ], + "nodes": [{ "children": [1], "name": "DefaultPhysicalSky" }, { "mesh": 0, "name": "Box" }], + "scene": 0, + "scenes": [{ "nodes": [0] }] +} diff --git a/extensions/2.0/OMI_environment_sky/examples/epic_blue_sunset/allskyfree_epic_blue_sunset.jpg b/extensions/2.0/OMI_environment_sky/examples/epic_blue_sunset/allskyfree_epic_blue_sunset.jpg new file mode 100644 index 0000000..6a42819 Binary files /dev/null and b/extensions/2.0/OMI_environment_sky/examples/epic_blue_sunset/allskyfree_epic_blue_sunset.jpg differ diff --git a/extensions/2.0/OMI_environment_sky/examples/epic_blue_sunset_equirectangular.gltf b/extensions/2.0/OMI_environment_sky/examples/epic_blue_sunset_equirectangular.gltf new file mode 100644 index 0000000..560eb42 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/examples/epic_blue_sunset_equirectangular.gltf @@ -0,0 +1,134 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.5, 0.5, 0.5], + "min": [-0.5, -0.5, -0.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 0.0, 1.0, 1.0], + "min": [-1.0, -0.000015259254723787308, -1.0, 1.0], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0, 1.0], + "min": [-1.0, -1.0, -1.0], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0], + "min": [0.0, 0.0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23.0], + "min": [0.0], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "copyright": "2020 rpgwhitelock", + "extensions": { "KHR_xmp_json_ld": { "packet": 0 } }, + "version": "2.0" + }, + "bufferViews": [ + { "buffer": 0, "byteLength": 288, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 288, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 672, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 960, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 1152, "target": 34963 } + ], + "buffers": [{ "byteLength": 1224, "uri": "cube_mesh_data.bin" }], + "extensions": { + "KHR_lights_punctual": { + "lights": [{ "type": "directional" }] + }, + "KHR_xmp_json_ld": { + "packets": [ + { + "@context": { "dc": "http://purl.org/dc/elements/1.1/" }, + "@id": "", + "dc:coverage": "Earth", + "dc:creator": { "@list": ["rpgwhitelock"] }, + "dc:date": "2020", + "dc:description": "Epic blue sunset image from AllSkyFree", + "dc:format": "model/gltf+json", + "dc:relation": { "@set": ["https://github.com/rpgwhitelock/AllSkyFree_Godot"] }, + "dc:rights": "MIT", + "dc:source": "https://github.com/rpgwhitelock/AllSkyFree_Godot/blob/master/addons/AllSkyFree/Skyboxes/AllSkyFree_Sky_EpicBlueSunset_Equirect.png", + "dc:subject": { "@set": ["Environment"] }, + "dc:title": "AllSkyFree_Sky_EpicBlueSunset_Equirect", + "dc:type": { "@set": ["Skybox"] } + } + ] + }, + "OMI_environment_sky": { + "skies": [ + { + "panorama": { + "equirectangular": 0 + }, + "type": "panorama" + } + ] + } + }, + "extensionsUsed": ["KHR_lights_punctual", "KHR_xmp_json_ld", "OMI_environment_sky"], + "images": [ + { + "mimeType": "image/jpeg", + "name": "allskyfree_epic_blue_sunset", + "uri": "epic_blue_sunset/allskyfree_epic_blue_sunset.jpg" + } + ], + "materials": [{}], + "meshes": [ + { + "primitives": [ + { + "attributes": { "NORMAL": 2, "POSITION": 0, "TANGENT": 1, "TEXCOORD_0": 3 }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + } + ], + "nodes": [ + { "children": [1, 2], "name": "EpicBlueSunsetEquirectangular" }, + { "mesh": 0, "name": "Box" }, + { + "extensions": { "KHR_lights_punctual": { "light": 0 } }, + "name": "Sun", + "rotation": [-0.0348995115423885, 0.0, 0.0, 0.999390826500875] + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }], + "textures": [{ "source": 0 }] +} diff --git a/extensions/2.0/OMI_environment_sky/examples/mars_physical_sky.gltf b/extensions/2.0/OMI_environment_sky/examples/mars_physical_sky.gltf new file mode 100644 index 0000000..90cc476 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/examples/mars_physical_sky.gltf @@ -0,0 +1,102 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.5, 0.5, 0.5], + "min": [-0.5, -0.5, -0.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 0.0, 1.0, 1.0], + "min": [-1.0, -0.000015259254723787308, -1.0, 1.0], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0, 1.0], + "min": [-1.0, -1.0, -1.0], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0], + "min": [0.0, 0.0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23.0], + "min": [0.0], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "version": "2.0" + }, + "bufferViews": [ + { "buffer": 0, "byteLength": 288, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 288, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 672, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 960, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 1152, "target": 34963 } + ], + "buffers": [{ "byteLength": 1224, "uri": "cube_mesh_data.bin" }], + "extensions": { + "OMI_environment_sky": { + "skies": [ + { + "physical": { + "groundColor": [0.67843097448349, 0.384314000606537, 0.258823990821838], + "mieAnisotropy": 0.8, + "mieColor": [0.8, 0.5, 0.3], + "mieScale": 0.000005, + "rayleighColor": [1.0, 0.666666666666666, 0.5], + "rayleighScale": 0.000002 + }, + "type": "physical" + } + ] + } + }, + "extensionsUsed": ["OMI_environment_sky"], + "materials": [{}], + "meshes": [ + { + "primitives": [ + { + "attributes": { "NORMAL": 2, "POSITION": 0, "TANGENT": 1, "TEXCOORD_0": 3 }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + } + ], + "nodes": [ + { "children": [1], "name": "MarsPhysicalSky" }, + { "mesh": 0, "name": "Box" } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }] +} diff --git a/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap.gltf b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap.gltf new file mode 100644 index 0000000..eaa1a24 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap.gltf @@ -0,0 +1,168 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.5, 0.5, 0.5], + "min": [-0.5, -0.5, -0.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 0.0, 1.0, 1.0], + "min": [-1.0, -0.000015259254723787308, -1.0, 1.0], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0, 1.0], + "min": [-1.0, -1.0, -1.0], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0], + "min": [0.0, 0.0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23.0], + "min": [0.0], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "extensions": { "KHR_xmp_json_ld": { "packet": 0 } }, + "version": "2.0" + }, + "bufferViews": [ + { "buffer": 0, "byteLength": 288, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 288, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 672, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 960, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 1152, "target": 34963 } + ], + "buffers": [{ "byteLength": 1224, "uri": "cube_mesh_data.bin" }], + "extensions": { + "KHR_lights_punctual": { "lights": [{ "type": "directional" }] }, + "KHR_xmp_json_ld": { + "packets": [ + { + "@context": { "dc": "http://purl.org/dc/elements/1.1/" }, + "@id": "", + "dc:coverage": "wwwtyro.net", + "dc:format": "model/gltf+json", + "dc:source": "https://tools.wwwtyro.net/space-3d/index.html", + "dc:title": "Space 3D" + } + ] + }, + "OMI_environment_sky": { + "skies": [ + { + "panorama": { + "cubemap": [0, 1, 2, 3, 4, 5] + }, + "type": "panorama" + } + ] + } + }, + "extensionsUsed": ["KHR_lights_punctual", "KHR_xmp_json_ld", "OMI_environment_sky"], + "images": [ + { + "mimeType": "image/png", + "name": "nebula_cubemap_posx", + "uri": "nebula_cubemap/posx.png" + }, + { + "mimeType": "image/png", + "name": "nebula_cubemap_negx", + "uri": "nebula_cubemap/negx.png" + }, + { + "mimeType": "image/png", + "name": "nebula_cubemap_posy", + "uri": "nebula_cubemap/posy.png" + }, + { + "mimeType": "image/png", + "name": "nebula_cubemap_negy", + "uri": "nebula_cubemap/negy.png" + }, + { + "mimeType": "image/png", + "name": "nebula_cubemap_posz", + "uri": "nebula_cubemap/posz.png" + }, + { + "mimeType": "image/png", + "name": "nebula_cubemap_negz", + "uri": "nebula_cubemap/negz.png" + } + ], + "materials": [{}], + "meshes": [ + { + "primitives": [ + { + "attributes": { "NORMAL": 2, "POSITION": 0, "TANGENT": 1, "TEXCOORD_0": 3 }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + } + ], + "nodes": [ + { "children": [1, 2], "name": "NebulaCubemap" }, + { "mesh": 0, "name": "Box" }, + { + "extensions": { "KHR_lights_punctual": { "light": 0 } }, + "name": "Sun", + "rotation": [0.0636336356770543, 0.892671153222115, 0.425782291009933, -0.133410694016456] + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }], + "textures": [ + { + "source": 0 + }, + { + "source": 1 + }, + { + "source": 2 + }, + { + "source": 3 + }, + { + "source": 4 + }, + { + "source": 5 + } + ] +} diff --git a/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/negx.png b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/negx.png new file mode 100644 index 0000000..833557f Binary files /dev/null and b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/negx.png differ diff --git a/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/negy.png b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/negy.png new file mode 100644 index 0000000..a623b0c Binary files /dev/null and b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/negy.png differ diff --git a/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/negz.png b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/negz.png new file mode 100644 index 0000000..84bbfce Binary files /dev/null and b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/negz.png differ diff --git a/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/posx.png b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/posx.png new file mode 100644 index 0000000..520bd77 Binary files /dev/null and b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/posx.png differ diff --git a/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/posy.png b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/posy.png new file mode 100644 index 0000000..4de7630 Binary files /dev/null and b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/posy.png differ diff --git a/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/posz.png b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/posz.png new file mode 100644 index 0000000..3052d43 Binary files /dev/null and b/extensions/2.0/OMI_environment_sky/examples/nebula_cubemap/posz.png differ diff --git a/extensions/2.0/OMI_environment_sky/examples/plain_cyan_sky.gltf b/extensions/2.0/OMI_environment_sky/examples/plain_cyan_sky.gltf new file mode 100644 index 0000000..d648102 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/examples/plain_cyan_sky.gltf @@ -0,0 +1,95 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.5, 0.5, 0.5], + "min": [-0.5, -0.5, -0.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 0.0, 1.0, 1.0], + "min": [-1.0, -0.000015259254723787308, -1.0, 1.0], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0, 1.0], + "min": [-1.0, -1.0, -1.0], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0], + "min": [0.0, 0.0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23.0], + "min": [0.0], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "version": "2.0" + }, + "bufferViews": [ + { "buffer": 0, "byteLength": 288, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 288, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 672, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 960, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 1152, "target": 34963 } + ], + "buffers": [{ "byteLength": 1224, "uri": "cube_mesh_data.bin" }], + "extensions": { + "OMI_environment_sky": { + "skies": [ + { + "plain": { "color": [0.5, 1.0, 1.0] }, + "type": "plain" + } + ] + } + }, + "extensionsUsed": ["OMI_environment_sky"], + "materials": [{}], + "meshes": [ + { + "primitives": [ + { + "attributes": { "NORMAL": 2, "POSITION": 0, "TANGENT": 1, "TEXCOORD_0": 3 }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + } + ], + "nodes": [ + { "children": [1], "name": "PlainCyanSky" }, + { "mesh": 0, "name": "Box" } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }] +} diff --git a/extensions/2.0/OMI_environment_sky/examples/space_black_gradient.gltf b/extensions/2.0/OMI_environment_sky/examples/space_black_gradient.gltf new file mode 100644 index 0000000..8589933 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/examples/space_black_gradient.gltf @@ -0,0 +1,115 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.5, 0.5, 0.5], + "min": [-0.5, -0.5, -0.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 0.0, 1.0, 1.0], + "min": [-1.0, -0.000015259254723787308, -1.0, 1.0], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0, 1.0], + "min": [-1.0, -1.0, -1.0], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1.0, 1.0], + "min": [0.0, 0.0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23.0], + "min": [0.0], + "normalized": false, + "type": "SCALAR" + } + ], + "asset": { + "version": "2.0" + }, + "bufferViews": [ + { "buffer": 0, "byteLength": 288, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 288, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 672, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 960, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 1152, "target": 34963 } + ], + "buffers": [{ "byteLength": 1224, "uri": "cube_mesh_data.bin" }], + "extensions": { + "KHR_lights_punctual": { + "lights": [ + { + "color": [1, 0.05, 0.05], + "intensity": 0.5, + "type": "directional" + } + ] + }, + "OMI_environment_sky": { + "skies": [ + { + "gradient": { + "bottomColor": [0.01, 0.01, 0.01], + "horizonColor": [0.01, 0.01, 0.01], + "sunAngleMax": 0.25, + "sunCurve": 4, + "topColor": [0.01, 0.01, 0.01] + }, + "type": "gradient" + } + ] + } + }, + "extensionsUsed": ["KHR_lights_punctual", "OMI_environment_sky"], + "materials": [{}], + "meshes": [ + { + "primitives": [ + { + "attributes": { "NORMAL": 2, "POSITION": 0, "TANGENT": 1, "TEXCOORD_0": 3 }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + } + ], + "nodes": [ + { "children": [1, 2], "name": "SpaceBlackGradient" }, + { "mesh": 0, "name": "Box" }, + { + "extensions": { "KHR_lights_punctual": { "light": 0 } }, + "name": "SunDimRed", + "rotation": [-0.12941067816757, 0.836515365063497, 0.482963555466784, 0.224145320004181] + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }] +} diff --git a/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.schema.json b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.schema.json new file mode 100644 index 0000000..303bb0b --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.schema.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "glTF.OMI_environment_sky.schema.json", + "title": "OMI_environment_sky glTF Document Extension", + "type": "object", + "description": "Top level global environment skies and skyboxes.", + "allOf": [{ "$ref": "glTFProperty.schema.json" }], + "properties": { + "skies": { + "type": "array", + "description": "An array of skies defining sky and skybox parameters.", + "items": { + "type": "object", + "$ref": "glTF.OMI_environment_sky.sky.schema.json" + } + }, + "sky": { + "allOf": [ { "$ref": "glTFid.schema.json" } ], + "description": "The index of the sky in the top level skies array, used when not overridden by the scene.", + "default": 0 + } + }, + "required": ["skies"] +} diff --git a/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.gradient.schema.json b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.gradient.schema.json new file mode 100644 index 0000000..5bac3a5 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.gradient.schema.json @@ -0,0 +1,62 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "glTF.OMI_environment_sky.sky.gradient.schema.json", + "title": "OMI_environment_sky Gradient Sky Parameters", + "type": "object", + "description": "Gradient skies use color gradients to define the sky colors.", + "allOf": [{ "$ref": "glTFProperty.schema.json" }], + "properties": { + "bottomColor": { + "type": "array", + "description": "The color of the sky at the bottom, also known as the nadir.", + "items": { + "type": "number" + }, + "minItems": 3, + "maxItems": 3 + }, + "bottomCurve": { + "type": "number", + "description": "The transition curve between the bottom and the horizon colors. 1 is linear, below 1 makes the bottom color more dominant, above 1 makes the horizon color more dominant.", + "minimum": 0.0, + "default": 0.02 + }, + "horizonColor": { + "type": "array", + "description": "The color of the sky at the horizon.", + "items": { + "type": "number" + }, + "minItems": 3, + "maxItems": 3 + }, + "topColor": { + "type": "array", + "description": "The color of the sky at the top, also known as the zenith.", + "items": { + "type": "number" + }, + "minItems": 3, + "maxItems": 3 + }, + "topCurve": { + "type": "number", + "description": "The transition curve between the top and the horizon colors. 1 is linear, below 1 makes the top color more dominant, above 1 makes the horizon color more dominant.", + "minimum": 0.0, + "default": 0.15 + }, + "sunAngleMax": { + "type": "number", + "description": "The maximum radius angle of the sun(s) in radians.", + "minimum": 0.0, + "default": 0.5 + }, + "sunCurve": { + "type": "number", + "description": "The transition curve between the sun(s) and the sky colors. 1 is linear, below 1 makes the sky color more dominant, above 1 makes the sun color more dominant.", + "minimum": 0.0, + "default": 0.15 + } + }, + "required": [] +} diff --git a/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.panorama.schema.json b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.panorama.schema.json new file mode 100644 index 0000000..eeb3f82 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.panorama.schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "glTF.OMI_environment_sky.sky.panorama.schema.json", + "title": "OMI_environment_sky Panorama Sky Parameters", + "type": "object", + "description": "Panorama skies use a texture or set of textures to represent the sky.", + "allOf": [{ "$ref": "glTFProperty.schema.json" }], + "properties": { + "cubemap": { + "type": "array", + "description": "The indices of 6 textures making up a cubemap in the glTF `textures` array.", + "items": { + "type": "integer" + }, + "minItems": 6, + "maxItems": 6 + }, + "equirectangular": { + "allOf": [{ "$ref": "glTFid.schema.json" }], + "description": "The index of an equirectangular panorama texture in the glTF `textures` array.", + "default": -1 + } + }, + "required": [] +} diff --git a/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.physical.schema.json b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.physical.schema.json new file mode 100644 index 0000000..4766b8a --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.physical.schema.json @@ -0,0 +1,60 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "glTF.OMI_environment_sky.sky.physical.schema.json", + "title": "OMI_environment_sky Physical Sky Parameters", + "type": "object", + "description": "Physical skies use a physically-based model to simulate the scattering of light in the atmosphere.", + "allOf": [{ "$ref": "glTFProperty.schema.json" }], + "properties": { + "groundColor": { + "type": "array", + "description": "The color of the ground of the skybox (not part of the atmospheric simulation).", + "items": { + "type": "number" + }, + "minItems": 3, + "maxItems": 3, + "default": [0.3, 0.5, 1.0] + }, + "mieAnisotropy": { + "type": "number", + "description": "The anisotropy of Mie scattering (the thing that makes clouds white).", + "minimum": -1.0, + "maximum": 1.0, + "default": 0.8 + }, + "mieColor": { + "type": "array", + "description": "The color of Mie scattering (the thing that makes clouds white).", + "items": { + "type": "number" + }, + "minItems": 3, + "maxItems": 3, + "default": [1.0, 1.0, 1.0] + }, + "mieScale": { + "type": "number", + "description": "The scale of Mie scattering (the thing that makes clouds white) in inverse meters.", + "minimum": 0.0, + "default": 0.000005 + }, + "rayleighColor": { + "type": "array", + "description": "The color of Rayleigh scattering (the thing that makes the sky blue).", + "items": { + "type": "number" + }, + "minItems": 3, + "maxItems": 3, + "default": [0.3, 0.5, 1.0] + }, + "rayleighScale": { + "type": "number", + "description": "The scale of Rayleigh scattering (the thing that makes the sky blue) in inverse meters.", + "minimum": 0.0, + "default": 0.00003 + } + }, + "required": [] +} diff --git a/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.plain.schema.json b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.plain.schema.json new file mode 100644 index 0000000..e7c5cd5 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.plain.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "glTF.OMI_environment_sky.sky.plain.schema.json", + "title": "OMI_environment_sky Plain Sky Parameters", + "type": "object", + "description": "Plain color skies use a single color to represent the sky.", + "allOf": [{ "$ref": "glTFProperty.schema.json" }], + "properties": { + "color": { + "type": "array", + "description": "The color of the sky.", + "items": { + "type": "number" + }, + "minItems": 3, + "maxItems": 3 + } + }, + "required": [] +} diff --git a/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.schema.json b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.schema.json new file mode 100644 index 0000000..41f1840 --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/schema/glTF.OMI_environment_sky.sky.schema.json @@ -0,0 +1,68 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "glTF.OMI_environment_sky.sky.schema.json", + "title": "OMI_environment_sky Sky Parameters", + "type": "object", + "description": "Environment sky and skybox parameters.", + "allOf": [{ "$ref": "glTFProperty.schema.json" }], + "properties": { + "ambientLightColor": { + "type": "array", + "description": "The color of the ambient light, if sky contribution is less than 1.0.", + "items": { + "type": "number" + }, + "minItems": 3, + "maxItems": 3, + "default": [1.0, 1.0, 1.0] + }, + "ambientSkyContribution": { + "type": "number", + "description": "The ratio of contribution the sky makes to the ambient light.", + "minimum": 0.0, + "default": 0.02 + }, + "type": { + "type": "string", + "description": "The type of sky as a string (`gradient`, `panorama`, `physical`, `plain`, or custom).", + "anyOf": [ + { + "const": "gradient", + "description": "Gradient skies use color gradients to define the sky colors." + }, + { + "const": "panorama", + "description": "Panorama skies use a texture or set of textures to represent the sky." + }, + { + "const": "physical", + "description": "Physical skies use a physically-based model to simulate the scattering of light in the atmosphere." + }, + { + "const": "plain", + "description": "Plain color skies use a single color to represent the sky." + }, + { + "type": "string" + } + ] + }, + "gradient": { + "allOf": [{ "$ref": "glTF.OMI_environment_sky.sky.gradient.schema.json" }], + "description": "If present, the properties of a gradient sky." + }, + "panorama": { + "allOf": [{ "$ref": "glTF.OMI_environment_sky.sky.panorama.schema.json" }], + "description": "If present, the properties of a panorama sky." + }, + "physical": { + "allOf": [{ "$ref": "glTF.OMI_environment_sky.sky.physical.schema.json" }], + "description": "If present, the properties of a physical sky." + }, + "plain": { + "allOf": [{ "$ref": "glTF.OMI_environment_sky.sky.plain.schema.json" }], + "description": "If present, the properties of a plain color sky." + } + }, + "required": ["type"] +} diff --git a/extensions/2.0/OMI_environment_sky/schema/scene.OMI_environment_sky.schema.json b/extensions/2.0/OMI_environment_sky/schema/scene.OMI_environment_sky.schema.json new file mode 100644 index 0000000..551916b --- /dev/null +++ b/extensions/2.0/OMI_environment_sky/schema/scene.OMI_environment_sky.schema.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "scene.OMI_environment_sky.schema.json", + "title": "OMI_environment_sky glTF Scene Extension", + "type": "object", + "description": "Per-scene override of which environment sky to use.", + "allOf": [{ "$ref": "glTFProperty.schema.json" }], + "properties": { + "sky": { + "allOf": [ { "$ref": "glTFid.schema.json" } ], + "description": "The index of the sky in the top level skies array. If not specified, the sky index in the top-level 'extensions' is used.", + "default": -1 + } + } +} diff --git a/extensions/2.0/OMI_vehicle_thruster/examples/rocket_ship.gltf b/extensions/2.0/OMI_vehicle_thruster/examples/rocket_ship.gltf index b97a46e..0ebcb80 100644 --- a/extensions/2.0/OMI_vehicle_thruster/examples/rocket_ship.gltf +++ b/extensions/2.0/OMI_vehicle_thruster/examples/rocket_ship.gltf @@ -137,7 +137,7 @@ }, "extensionsUsed": [ "GODOT_single_root", - "KHR_xmp_json_ld", + "KHR_xmp_json_ld", "OMI_physics_body", "OMI_physics_shape", "OMI_seat", @@ -183,23 +183,23 @@ "children": [1, 2, 3, 4, 5, 6, 7, 8], "extensions": { "OMI_physics_body": { - "motion": { - "mass": 20000, - "type": "dynamic" - } - }, + "motion": { + "mass": 20000, + "type": "dynamic" + } + }, "OMI_vehicle_body": { - "gyroTorque": [10000, 10000, 10000], - "pilotSeat": 8, - "useThrottle": true - } + "gyroTorque": [10000, 10000, 10000], + "pilotSeat": 8, + "useThrottle": true + } }, "name": "RocketShipBody" }, { - "mesh": 0, - "name": "RocketShipMesh" - }, + "mesh": 0, + "name": "RocketShipMesh" + }, { "extensions": { "OMI_physics_body": { "collider": { "shape": 0 } } }, "name": "RocketShipShapeAntenna", @@ -217,19 +217,19 @@ "rotation": [0, 0, 0.866025447845459, 0.5] }, { - "extensions": { "OMI_physics_body": { "collider": { "shape": 1 } } }, - "name": "RocketShipShapeFinTop" - }, + "extensions": { "OMI_physics_body": { "collider": { "shape": 1 } } }, + "name": "RocketShipShapeFinTop" + }, { - "extensions": { "OMI_physics_body": { "collider": { "shape": 2 } } }, - "name": "RocketShipShapeMainHull" - }, + "extensions": { "OMI_physics_body": { "collider": { "shape": 2 } } }, + "name": "RocketShipShapeMainHull" + }, { "extensions": { - "OMI_vehicle_thruster": { - "thruster": 0 - } - }, + "OMI_vehicle_thruster": { + "thruster": 0 + } + }, "name": "RocketShipThruster", "translation": [0, 0, -2.8] }, @@ -237,13 +237,13 @@ "children": [9], "extensions": { "OMI_physics_body": { - "trigger": { "nodes": [9] } - }, + "trigger": { "nodes": [9] } + }, "OMI_seat": { - "back": [0, 0, -0.25], - "foot": [0, -0.5, 0.25], - "knee": [0, 0, 0.25] - } + "back": [0, 0, -0.25], + "foot": [0, -0.5, 0.25], + "knee": [0, 0, 0.25] + } }, "name": "RocketShipPilotSeat3D", "translation": [0, 0, 2]