forked from CesiumGS/cesium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request CesiumGS#11766 from CesiumGS/feature-id-texture-tr…
…ansform-fix Apply texture transforms to feature ID textures
- Loading branch information
Showing
8 changed files
with
362 additions
and
2 deletions.
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
171 changes: 171 additions & 0 deletions
171
...F-2.0/FeatureIdTextureWithTextureTransform/glTF/FeatureIdTextureWithTextureTransform.gltf
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,171 @@ | ||
{ | ||
"asset": { | ||
"generator": "glTF-Transform v3.6.0", | ||
"version": "2.0" | ||
}, | ||
"accessors": [ | ||
{ | ||
"type": "SCALAR", | ||
"componentType": 5123, | ||
"count": 6, | ||
"bufferView": 0, | ||
"byteOffset": 0 | ||
}, | ||
{ | ||
"type": "VEC3", | ||
"componentType": 5126, | ||
"count": 4, | ||
"max": [ | ||
1, | ||
1, | ||
0 | ||
], | ||
"min": [ | ||
0, | ||
0, | ||
0 | ||
], | ||
"bufferView": 1, | ||
"byteOffset": 0 | ||
}, | ||
{ | ||
"type": "VEC3", | ||
"componentType": 5126, | ||
"count": 4, | ||
"bufferView": 1, | ||
"byteOffset": 12 | ||
}, | ||
{ | ||
"type": "VEC2", | ||
"componentType": 5126, | ||
"count": 4, | ||
"bufferView": 1, | ||
"byteOffset": 24 | ||
} | ||
], | ||
"bufferViews": [ | ||
{ | ||
"buffer": 0, | ||
"byteOffset": 0, | ||
"byteLength": 12, | ||
"target": 34963 | ||
}, | ||
{ | ||
"buffer": 0, | ||
"byteOffset": 12, | ||
"byteLength": 128, | ||
"byteStride": 32, | ||
"target": 34962 | ||
} | ||
], | ||
"samplers": [ | ||
{ | ||
"magFilter": 9728, | ||
"minFilter": 9728, | ||
"wrapS": 33071, | ||
"wrapT": 33071 | ||
} | ||
], | ||
"textures": [ | ||
{ | ||
"source": 0, | ||
"sampler": 0 | ||
} | ||
], | ||
"images": [ | ||
{ | ||
"uri": "FeatureIdTextureWithTextureTransform_img0.png" | ||
} | ||
], | ||
"buffers": [ | ||
{ | ||
"uri": "FeatureIdTextureWithTextureTransform_data.bin", | ||
"byteLength": 140 | ||
} | ||
], | ||
"materials": [ | ||
{ | ||
"doubleSided": true, | ||
"pbrMetallicRoughness": { | ||
"metallicFactor": 0, | ||
"baseColorTexture": { | ||
"index": 0, | ||
"extensions": { | ||
"KHR_texture_transform": { | ||
"offset": [ | ||
0.25, | ||
0.25 | ||
], | ||
"scale": [ | ||
0.5, | ||
0.5 | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"meshes": [ | ||
{ | ||
"primitives": [ | ||
{ | ||
"attributes": { | ||
"POSITION": 1, | ||
"NORMAL": 2, | ||
"TEXCOORD_0": 3 | ||
}, | ||
"mode": 4, | ||
"material": 0, | ||
"indices": 0, | ||
"extensions": { | ||
"EXT_mesh_features": { | ||
"featureIds": [ | ||
{ | ||
"texture": { | ||
"channels": [ | ||
0 | ||
], | ||
"index": 0, | ||
"extensions": { | ||
"KHR_texture_transform": { | ||
"offset": [ | ||
0.25, | ||
0.25 | ||
], | ||
"scale": [ | ||
0.5, | ||
0.5 | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"mesh": 0 | ||
} | ||
], | ||
"scenes": [ | ||
{ | ||
"nodes": [ | ||
0 | ||
] | ||
} | ||
], | ||
"scene": 0, | ||
"extensionsUsed": [ | ||
"KHR_texture_transform", | ||
"EXT_mesh_features" | ||
], | ||
"extensionsRequired": [ | ||
"KHR_texture_transform" | ||
] | ||
} |
Binary file added
BIN
+140 Bytes
...0/FeatureIdTextureWithTextureTransform/glTF/FeatureIdTextureWithTextureTransform_data.bin
Binary file not shown.
Binary file added
BIN
+235 Bytes
...dTextureWithTextureTransform/glTF/FeatureIdTextureWithTextureTransform_img0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
Specs/Data/Models/glTF-2.0/FeatureIdTextureWithTextureTransform/glTF/README.md
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,16 @@ | ||
# Feature ID Texture With Texture Transform | ||
|
||
The test data for https://github.com/CesiumGS/cesium/issues/11731 : | ||
|
||
It is a glTF asset that only contains a unit square. | ||
|
||
It uses the same texture for the base color and for a Feature ID Texture: | ||
The texture just contains 8x8 pixels with increasing 'red' component | ||
values: The red components will be [0 ... 64)*3. (Meaning that the | ||
lower right pixel will have a red value of 63*3=189). | ||
|
||
So the base color will be (black ... red), and the feature ID values in | ||
the property texture will be in [0...189]. | ||
|
||
It uses the same texture transform for both usages of the texture, | ||
namely with an offset of [0.25, 0.25], and a scale of [0.5, 0.5]. |
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
Oops, something went wrong.