Skip to content

Commit 7dabe2d

Browse files
authored
Merge pull request #88 from AlexSchwank/feature/textureFileFormatTests
Added first set of texture file format tests
2 parents 8941736 + 84b3eea commit 7dabe2d

20 files changed

+495
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Texture File Format Tests
2+
3+
This set of assets is intended to test support for loading and rendering basic texture file formats.
4+
5+
The left material for each texture case is not using opacity. The right material is.
6+
7+
## Screenshot
8+
9+
![screenshot](screenshots/all_files.png)
10+
_usdrecord 24.03_
11+
12+
## File formats
13+
14+
| File format | Configuration | Texture |
15+
| --- | --- | --- |
16+
| JPEG | CMYK, 8-bit | ![jpeg cmyk 8-bit](jpeg_cmyk_8-bit.jpg) |
17+
| JPEG | RGB, 8-bit | ![jpeg rgb 8-bit](jpeg_rgb_8-bit.jpg) |
18+
| JPEG | Grayscale, 8-bit | ![png grayscale 8-bit](png_grayscale_8-bit.png) |
19+
| PNG | Grayscale 8-bit | ![png grayscale 8-bit](png_grayscale_8-bit.png) |
20+
| PNG | Grayscale, 16-bit | ![png grayscale 16-bit](png_grayscale_16-bit.png) |
21+
| PNG | RGB, 8-bit | ![png rgb 8-bit](png_rgb_8-bit.png) |
22+
| PNG | RGB, 16-bit | ![png rgb 16-bit](png_rgb_16-bit.png) |
23+
| PNG | RGB, 32-bit | ![png rgb 32-bit](png_rgb_32-bit.png)|
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#usda 1.0
2+
(
3+
defaultPrim = "Scene"
4+
upAxis = "Y"
5+
metersPerUnit = 1
6+
customLayerData = {
7+
string copyright = "Copyright 2024 Apple Inc. All rights reserved."
8+
}
9+
)
10+
11+
def Xform "Scene" (
12+
kind = "component"
13+
)
14+
{
15+
def Scope "Looks"
16+
{
17+
def Material "MainMaterial"
18+
{
19+
token outputs:surface.connect = </Scene/Looks/MainMaterial/PbrPreview.outputs:surface>
20+
21+
def Shader "PbrPreview"
22+
{
23+
uniform token info:id = "UsdPreviewSurface"
24+
color3f inputs:diffuseColor.connect = </Scene/Looks/MainMaterial/Diffuse.outputs:rgb>
25+
token outputs:surface
26+
}
27+
28+
def Shader "Diffuse"
29+
{
30+
uniform token info:id = "UsdUVTexture"
31+
float2 inputs:st.connect = </Scene/Looks/MainMaterial/Primvar.outputs:result>
32+
float3 outputs:rgb
33+
}
34+
35+
def Shader "Primvar"
36+
{
37+
uniform token info:id = "UsdPrimvarReader_float2"
38+
string inputs:varname = "st"
39+
float2 outputs:result
40+
}
41+
}
42+
43+
def Material "MainMaterialWithOpacity"
44+
{
45+
token outputs:surface.connect = </Scene/Looks/MainMaterialWithOpacity/PbrPreview.outputs:surface>
46+
47+
def Shader "PbrPreview"
48+
{
49+
uniform token info:id = "UsdPreviewSurface"
50+
color3f inputs:diffuseColor.connect = </Scene/Looks/MainMaterialWithOpacity/Diffuse.outputs:rgb>
51+
float inputs:opacity.connect = </Scene/Looks/MainMaterialWithOpacity/Diffuse.outputs:a>
52+
token outputs:surface
53+
}
54+
55+
def Shader "Diffuse"
56+
{
57+
uniform token info:id = "UsdUVTexture"
58+
float2 inputs:st.connect = </Scene/Looks/MainMaterialWithOpacity/Primvar.outputs:result>
59+
float3 outputs:rgb
60+
float outputs:a
61+
}
62+
63+
def Shader "Primvar"
64+
{
65+
uniform token info:id = "UsdPrimvarReader_float2"
66+
string inputs:varname = "st"
67+
float2 outputs:result
68+
}
69+
}
70+
}
71+
72+
def Xform "Geom"
73+
{
74+
def Mesh "Backgroud"
75+
{
76+
color3f[] primvars:displayColor = [(0.7, 0, 0.7)] (
77+
interpolation = "constant"
78+
)
79+
int[] faceVertexCounts = [4]
80+
int[] faceVertexIndices = [0, 1, 2, 3]
81+
point3f[] points = [(-0.1,-0.1,-0.1), (2.2,-0.1,-0.1), (2.2,1.1,-0.1), (-0.1,1.1,-0.1)]
82+
}
83+
84+
def Mesh "Plane" (
85+
prepend apiSchemas = ["MaterialBindingAPI"]
86+
)
87+
{
88+
rel material:binding = </Scene/Looks/MainMaterial>
89+
float2[] primvars:st = [(0, 0), (1, 0), (1, 1), (0, 1)] (interpolation = "vertex")
90+
int[] faceVertexCounts = [4]
91+
int[] faceVertexIndices = [0, 1, 2, 3]
92+
point3f[] points = [(0,0,0), (1,0,0), (1,1,0), (0,1,0)]
93+
}
94+
95+
def Mesh "PlaneWithOpacity" (
96+
prepend apiSchemas = ["MaterialBindingAPI"]
97+
)
98+
{
99+
rel material:binding = </Scene/Looks/MainMaterialWithOpacity>
100+
float2[] primvars:st = [(0, 0), (1, 0), (1, 1), (0, 1)] (interpolation = "vertex")
101+
int[] faceVertexCounts = [4]
102+
int[] faceVertexIndices = [0, 1, 2, 3]
103+
point3f[] points = [(1.1,0,0), (2.1,0,0), (2.1,1,0), (1.1,1,0)]
104+
}
105+
}
106+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#usda 1.0
2+
(
3+
defaultPrim = "Scene"
4+
upAxis = "Y"
5+
metersPerUnit = 1
6+
customLayerData = {
7+
string copyright = "Copyright 2024 Apple Inc. All rights reserved."
8+
}
9+
)
10+
11+
def Scope "Scene" (
12+
kind = "component"
13+
)
14+
{
15+
def Camera "main_cam"
16+
{
17+
double3 xformOp:translate = (1, 3, 25)
18+
uniform token[] xformOpOrder = ["xformOp:translate"]
19+
}
20+
21+
def Xform "jpeg" {
22+
double3 xformOp:translate = (0, 0, 0)
23+
uniform token[] xformOpOrder = ["xformOp:translate"]
24+
25+
over "jpeg_cmyk_8bit" (
26+
references = [@./jpeg_cmyk_8-bit.usda@]
27+
)
28+
{
29+
double3 xformOp:translate = (0, 0, 0)
30+
uniform token[] xformOpOrder = ["xformOp:translate"]
31+
}
32+
33+
over "jpeg_grayscale_8bit" (
34+
references = [@./jpeg_grayscale_8-bit.usda@]
35+
)
36+
{
37+
double3 xformOp:translate = (0, 1.1, 0)
38+
uniform token[] xformOpOrder = ["xformOp:translate"]
39+
}
40+
41+
over "jpeg_rgb_8bit" (
42+
references = [@./jpeg_rgb_8-bit.usda@]
43+
)
44+
{
45+
double3 xformOp:translate = (0, 2.2, 0)
46+
uniform token[] xformOpOrder = ["xformOp:translate"]
47+
}
48+
}
49+
50+
def Xform "png" {
51+
double3 xformOp:translate = (3, 0, 0)
52+
uniform token[] xformOpOrder = ["xformOp:translate"]
53+
54+
over "png_grayscale_8bit" (
55+
references = [@./png_grayscale_8-bit.usda@]
56+
)
57+
{
58+
double3 xformOp:translate = (0, 0, 0)
59+
uniform token[] xformOpOrder = ["xformOp:translate"]
60+
}
61+
62+
over "png_grayscale_16bit" (
63+
references = [@./png_grayscale_16-bit.usda@]
64+
)
65+
{
66+
double3 xformOp:translate = (0, 1.1, 0)
67+
uniform token[] xformOpOrder = ["xformOp:translate"]
68+
}
69+
70+
over "png_rgb_8bit" (
71+
references = [@./png_rgb_8-bit.usda@]
72+
)
73+
{
74+
double3 xformOp:translate = (0, 2.2, 0)
75+
uniform token[] xformOpOrder = ["xformOp:translate"]
76+
}
77+
78+
over "png_rgb_16bit" (
79+
references = [@./png_rgb_16-bit.usda@]
80+
)
81+
{
82+
double3 xformOp:translate = (0, 3.3, 0)
83+
uniform token[] xformOpOrder = ["xformOp:translate"]
84+
}
85+
86+
over "png_rgb_32bit" (
87+
references = [@./png_rgb_32-bit.usda@]
88+
)
89+
{
90+
double3 xformOp:translate = (0, 4.4, 0)
91+
uniform token[] xformOpOrder = ["xformOp:translate"]
92+
}
93+
}
94+
}
632 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#usda 1.0
2+
(
3+
defaultPrim = "Scene"
4+
upAxis = "Y"
5+
metersPerUnit = 1
6+
customLayerData = {
7+
string copyright = "Copyright 2024 Apple Inc. All rights reserved."
8+
}
9+
subLayers = [
10+
@_scene.usda@
11+
]
12+
)
13+
14+
over "Scene"
15+
{
16+
over "Looks"
17+
{
18+
over "MainMaterial"
19+
{
20+
over "Diffuse"
21+
{
22+
asset inputs:file = @jpeg_cmyk_8-bit.jpg@
23+
}
24+
}
25+
26+
over "MainMaterialWithOpacity"
27+
{
28+
over "Diffuse"
29+
{
30+
asset inputs:file = @jpeg_cmyk_8-bit.jpg@
31+
}
32+
}
33+
}
34+
}
31.5 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#usda 1.0
2+
(
3+
defaultPrim = "Scene"
4+
upAxis = "Y"
5+
metersPerUnit = 1
6+
customLayerData = {
7+
string copyright = "Copyright 2024 Apple Inc. All rights reserved."
8+
}
9+
subLayers = [
10+
@_scene.usda@
11+
]
12+
)
13+
14+
over "Scene"
15+
{
16+
over "Looks"
17+
{
18+
over "MainMaterial"
19+
{
20+
over "Diffuse"
21+
{
22+
asset inputs:file = @jpeg_grayscale_8-bit.jpg@
23+
}
24+
}
25+
26+
over "MainMaterialWithOpacity"
27+
{
28+
over "Diffuse"
29+
{
30+
asset inputs:file = @jpeg_grayscale_8-bit.jpg@
31+
}
32+
}
33+
}
34+
}
77.2 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#usda 1.0
2+
(
3+
defaultPrim = "Scene"
4+
upAxis = "Y"
5+
metersPerUnit = 1
6+
customLayerData = {
7+
string copyright = "Copyright 2024 Apple Inc. All rights reserved."
8+
}
9+
subLayers = [
10+
@_scene.usda@
11+
]
12+
)
13+
14+
over "Scene"
15+
{
16+
over "Looks"
17+
{
18+
over "MainMaterial"
19+
{
20+
over "Diffuse"
21+
{
22+
asset inputs:file = @jpeg_rgb_8-bit.jpg@
23+
}
24+
}
25+
26+
over "MainMaterialWithOpacity"
27+
{
28+
over "Diffuse"
29+
{
30+
asset inputs:file = @jpeg_rgb_8-bit.jpg@
31+
}
32+
}
33+
}
34+
}
117 KB
Loading

0 commit comments

Comments
 (0)