From 0f08674d165198976d7b83d61c8f87d17af51a6c Mon Sep 17 00:00:00 2001 From: Lars Maier Date: Thu, 18 Aug 2022 15:27:15 +0200 Subject: [PATCH 1/2] First draft. --- .../KHR_materials_parallax_mapping/README.md | 56 +++++++++++++++++++ .../schema/parallaxMapping.schema.json | 23 ++++++++ 2 files changed, 79 insertions(+) create mode 100644 extensions/2.0/Khronos/KHR_materials_parallax_mapping/README.md create mode 100644 extensions/2.0/Khronos/KHR_materials_parallax_mapping/schema/parallaxMapping.schema.json diff --git a/extensions/2.0/Khronos/KHR_materials_parallax_mapping/README.md b/extensions/2.0/Khronos/KHR_materials_parallax_mapping/README.md new file mode 100644 index 0000000000..7cd1699a47 --- /dev/null +++ b/extensions/2.0/Khronos/KHR_materials_parallax_mapping/README.md @@ -0,0 +1,56 @@ + + +# KHR\_materials\_parallax\_mapping + +## Contributors + + +## Status + +Draft + +## Dependencies + +Written against the glTF 2.0 spec. + +## Overview + +Many materials provide a height-map that can either be used for real geometry displacement or for parallax-mapping. +This extension defines a way to specify a texture as a height map. + +## glTF Schema Updates + +The height at a given position is calculated by sampling the given texture and using the red channel. The sampled value is then multiplied with the `heightFactor`. +The result is used in an implementation defined way to offset all other texture lookups. (See Resources) + +This extension does _not_ require the geometry of the object this material is applied to to be modified. + +```json +{ + "materials":[ + { + "extension": { + "KHR_material_parallax_mapping": { + "heightTexture": 0, + "heightFactor": 0.5, + } + } + } + ] +} +``` + +### JSON Schema + +- [parallaxMapping.schema.json](schema/parallaxMapping.schema.json) + +## Known Implementations + +None. + +## Resources +* [Introduction](https://en.wikipedia.org/wiki/Parallax_mapping) +* [Discussion about different implementations](https://learnopengl.com/Advanced-Lighting/Parallax-Mapping) diff --git a/extensions/2.0/Khronos/KHR_materials_parallax_mapping/schema/parallaxMapping.schema.json b/extensions/2.0/Khronos/KHR_materials_parallax_mapping/schema/parallaxMapping.schema.json new file mode 100644 index 0000000000..38282902d8 --- /dev/null +++ b/extensions/2.0/Khronos/KHR_materials_parallax_mapping/schema/parallaxMapping.schema.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "parallaxMapping", + "type": "object", + "description": "Reference to a heightmap for parallax mapping.", + "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ], + "properties": { + "heightTexture": { + "allOf": [ { "$ref": "textureInfo.schema.json" } ], + "description": "A texture that describes the surface height.", + }, + "heightFactor": { + "type": "number", + "description": "Used to scale the height map.", + "default": 1.0, + "minimum": 0.0, + "gltf_detailedDescription": "This parameter scales the heightmap. A smaller number makes the effect less noticable, a higher number more prominent." + + }, + "extensions": { }, + "extras": { } + }, +} From 45d05caf163b69ac351c120586dee4d6e82be4a3 Mon Sep 17 00:00:00 2001 From: Lars Maier Date: Sat, 20 Aug 2022 10:20:56 +0200 Subject: [PATCH 2/2] Added more resources. --- .../2.0/Khronos/KHR_materials_parallax_mapping/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/2.0/Khronos/KHR_materials_parallax_mapping/README.md b/extensions/2.0/Khronos/KHR_materials_parallax_mapping/README.md index 7cd1699a47..cfbe74e631 100644 --- a/extensions/2.0/Khronos/KHR_materials_parallax_mapping/README.md +++ b/extensions/2.0/Khronos/KHR_materials_parallax_mapping/README.md @@ -1,5 +1,5 @@ @@ -49,8 +49,11 @@ This extension does _not_ require the geometry of the object this material is ap ## Known Implementations -None. +Although no implementations of this extension are known, these techniques are used widely by the industry. ## Resources * [Introduction](https://en.wikipedia.org/wiki/Parallax_mapping) * [Discussion about different implementations](https://learnopengl.com/Advanced-Lighting/Parallax-Mapping) +* [GPU Gems 2 - Per-Pixel Displacement Mapping with Distance Functions](https://developer.nvidia.com/gpugems/gpugems2/part-i-geometric-complexity/chapter-8-pixel-displacement-mapping-distance-functions) +* [GPU Gems 3 - Relaxed Cone Stepping for Relief Mapping](https://developer.nvidia.com/gpugems/gpugems3/part-iii-rendering/chapter-18-relaxed-cone-stepping-relief-mapping) +* [SIGGRAPH Asia 2021 - Tessellation-Free Displacement Mapping for Ray Tracing](https://perso.telecom-paristech.fr/boubek/papers/TFDM/)