Skip to content
This repository was archived by the owner on Dec 22, 2023. It is now read-only.

Commit a73ddec

Browse files
authored
Merge pull request #297 from KhronosGroup/interpolation
Add TextureLinearInterpolationTest
2 parents 2b8c587 + 8c6f18e commit a73ddec

File tree

9 files changed

+290
-0
lines changed

9 files changed

+290
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Texture Linear Interpolation Test
2+
3+
## Screenshot
4+
5+
![screenshot](screenshot/screenshot.png)
6+
7+
## Description
8+
9+
This asset tests that linear texture interpolation is performed on linear values, i.e. after sRGB decoding. The test passes when two spheres are rendered with nearly the same color.
10+
11+
* The first (leftmost) sphere uses only JSON-stored emissive factor of `0.5` green.
12+
13+
* The second sphere samples its color as an interpolated value from a `2x1` texture. When interpolation happens after sRGB decoding, the final emissive value should also be about `0.5` green. An example of incorrect interpolation is shown below.
14+
15+
![incorrect](screenshot/incorrect.png)
16+
17+
## License Information
18+
19+
Public domain ([CC0](https://creativecommons.org/publicdomain/zero/1.0/))
Binary file not shown.
72 Bytes
Loading
92 Bytes
Binary file not shown.
Binary file not shown.
2.65 KB
Loading
Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
{
2+
"asset": {
3+
"version": "2.0"
4+
},
5+
"scene": 0,
6+
"scenes": [
7+
{
8+
"nodes": [
9+
0,
10+
1,
11+
2
12+
]
13+
}
14+
],
15+
"nodes": [
16+
{
17+
"translation": [
18+
-1.5,
19+
-1,
20+
0
21+
],
22+
"mesh": 0
23+
},
24+
{
25+
"translation": [
26+
1.5,
27+
-1,
28+
0
29+
],
30+
"mesh": 1
31+
},
32+
{
33+
"translation": [
34+
-3,
35+
0,
36+
0
37+
],
38+
"scale": [
39+
6,
40+
3,
41+
1
42+
],
43+
"mesh": 2
44+
}
45+
],
46+
"meshes": [
47+
{
48+
"primitives": [
49+
{
50+
"attributes": {
51+
"POSITION": 0,
52+
"NORMAL": 1
53+
},
54+
"indices": 3,
55+
"material": 0
56+
}
57+
]
58+
},
59+
{
60+
"primitives": [
61+
{
62+
"attributes": {
63+
"POSITION": 0,
64+
"NORMAL": 1,
65+
"TEXCOORD_0": 2
66+
},
67+
"indices": 3,
68+
"material": 1
69+
}
70+
]
71+
},
72+
{
73+
"primitives": [
74+
{
75+
"attributes": {
76+
"POSITION": 4,
77+
"TEXCOORD_0": 5
78+
},
79+
"indices": 6,
80+
"material": 2
81+
}
82+
]
83+
}
84+
],
85+
"materials": [
86+
{
87+
"emissiveFactor": [
88+
0,
89+
0.5,
90+
0
91+
],
92+
"pbrMetallicRoughness": {
93+
"baseColorFactor": [
94+
0,
95+
0,
96+
0,
97+
1
98+
]
99+
}
100+
},
101+
{
102+
"emissiveTexture": {
103+
"index": 0
104+
},
105+
"emissiveFactor": [
106+
1,
107+
1,
108+
1
109+
],
110+
"pbrMetallicRoughness": {
111+
"baseColorFactor": [
112+
0,
113+
0,
114+
0,
115+
1
116+
]
117+
}
118+
},
119+
{
120+
"alphaMode": "MASK",
121+
"doubleSided": true,
122+
"emissiveFactor": [
123+
1,
124+
1,
125+
1
126+
],
127+
"emissiveTexture": {
128+
"index": 1
129+
},
130+
"pbrMetallicRoughness": {
131+
"baseColorTexture": {
132+
"index": 1
133+
}
134+
}
135+
}
136+
],
137+
"textures": [
138+
{
139+
"source": 0,
140+
"sampler": 0
141+
},
142+
{
143+
"source": 1
144+
}
145+
],
146+
"accessors": [
147+
{
148+
"bufferView": 0,
149+
"componentType": 5126,
150+
"count": 205,
151+
"max": [
152+
1,
153+
1,
154+
0.9999999403953552
155+
],
156+
"min": [
157+
-0.9999999403953552,
158+
-1,
159+
-0.9999999403953552
160+
],
161+
"type": "VEC3"
162+
},
163+
{
164+
"bufferView": 1,
165+
"componentType": 5126,
166+
"count": 205,
167+
"type": "VEC3"
168+
},
169+
{
170+
"bufferView": 2,
171+
"componentType": 5126,
172+
"count": 205,
173+
"type": "VEC2"
174+
},
175+
{
176+
"bufferView": 3,
177+
"componentType": 5123,
178+
"count": 960,
179+
"type": "SCALAR"
180+
},
181+
{
182+
"bufferView": 4,
183+
"componentType": 5126,
184+
"count": 4,
185+
"max": [
186+
1,
187+
1,
188+
0
189+
],
190+
"min": [
191+
0,
192+
0,
193+
0
194+
],
195+
"type": "VEC3"
196+
},
197+
{
198+
"bufferView": 5,
199+
"componentType": 5126,
200+
"count": 4,
201+
"type": "VEC2"
202+
},
203+
{
204+
"bufferView": 6,
205+
"componentType": 5123,
206+
"count": 6,
207+
"type": "SCALAR"
208+
}
209+
],
210+
"bufferViews": [
211+
{
212+
"buffer": 0,
213+
"byteLength": 2460,
214+
"byteOffset": 0
215+
},
216+
{
217+
"buffer": 0,
218+
"byteLength": 2460,
219+
"byteOffset": 2460
220+
},
221+
{
222+
"buffer": 0,
223+
"byteLength": 1640,
224+
"byteOffset": 4920
225+
},
226+
{
227+
"buffer": 0,
228+
"byteLength": 1920,
229+
"byteOffset": 6560
230+
},
231+
{
232+
"buffer": 1,
233+
"byteLength": 48,
234+
"byteOffset": 0
235+
},
236+
{
237+
"buffer": 1,
238+
"byteLength": 32,
239+
"byteOffset": 48
240+
},
241+
{
242+
"buffer": 1,
243+
"byteLength": 12,
244+
"byteOffset": 80
245+
}
246+
],
247+
"buffers": [
248+
{
249+
"byteLength": 8480,
250+
"uri": "Sphere.bin"
251+
},
252+
{
253+
"byteLength": 92,
254+
"uri": "Plane.bin"
255+
}
256+
],
257+
"images": [
258+
{
259+
"uri": "0_0_0-0_255_0.png"
260+
},
261+
{
262+
"uri": "TestLabels.png"
263+
}
264+
],
265+
"samplers": [
266+
{
267+
"minFilter": 9729,
268+
"magFilter": 9729
269+
}
270+
]
271+
}
18.1 KB
Loading
30.7 KB
Loading

0 commit comments

Comments
 (0)