Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python tests #1304

Merged
merged 10 commits into from
Oct 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
406 changes: 406 additions & 0 deletions scripts/make-tests.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions scripts/scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def view(directory='mcguire', scene='*', format='json', mode='path', envname='')
if format == 'pbrt':
with open(filename) as f:
if 'WorldBegin' not in f.read(): continue
cmd = f'../yocto-gl/bin/yscene view {options} {extraoptions} {envoptions} {filename}'
cmd = f'../yocto-gl/bin/yscene view {options} {extraoptions} {envoptions} --scene {filename}'
print(cmd, file=sys.stderr)
os.system(cmd)

Expand Down Expand Up @@ -79,7 +79,7 @@ def render(directory='mcguire', scene='*', format='json', mode='path'):
os.system(cmd)
for idx, cam in enumerate(extracams, 1):
imagename = f'{directory}/{outprefix}-{format}/{basename}-c{idx}.{outformat}'
cmd = f'../yocto-gl/bin/yscene render --output {imagename} --camera {cam} {options} {extraoptions} {filename}'
cmd = f'../yocto-gl/bin/yscene render --output {imagename} --camera {cam} {options} {extraoptions} --scene {filename}'
print(cmd, file=sys.stderr)
os.system(cmd)

Expand All @@ -106,7 +106,7 @@ def info(directory='mcguire', scene='*', format='json', mode='default'):
if format == 'pbrt':
with open(filename) as f:
if 'WorldBegin' not in f.read(): continue
cmd = f'../yocto-gl/bin/yscene info {options} {extraoptions} {filename}'
cmd = f'../yocto-gl/bin/yscene info {options} {extraoptions} --scene {filename}'
print(cmd, file=sys.stderr)
os.system(cmd)

Expand Down Expand Up @@ -154,7 +154,7 @@ def tonemap(directory='mcguire', scene='*', format='json', mode='filmic'):
glob.glob(f'{directory}/{outprefix}-{format}/{scene}.exr')):
imagename = filename.replace(f'.exr', f'.{outformat}').replace(
f'.hdr', f'.{outformat}')
cmd = f'../yocto-gl/bin/yimage convert --output {imagename} {options} {filename}'
cmd = f'../yocto-gl/bin/yimage convert --output {imagename} {options} --image {filename}'
print(cmd, file=sys.stderr)
os.system(cmd)
img = Image.open(imagename)
Expand Down
File renamed without changes.
Binary file added tests/_assets/shapes/cube.ply
Binary file not shown.
Binary file added tests/_assets/shapes/disk.ply
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added tests/_assets/shapes/teapot.ply
Binary file not shown.
Binary file added tests/_assets/shapes/uvcylinder.ply
Binary file not shown.
File renamed without changes.
253 changes: 253 additions & 0 deletions tests/_version43/features1/features1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
{
"asset": {
"copyright": "Model by Fabio Pellacini from github.com/~xelatihy/yocto-gl",
"generator": "Yocto/GL - https://github.com/xelatihy/yocto-gl",
"version": "4.2"
},
"cameras": [
{
"name": "default",
"frame": [
0.8151804208755493, -0.0, 0.579207181930542, 0.16660168766975403,
0.9577393531799316, -0.23447643220424652, -0.5547295212745667,
0.28763750195503235, 0.7807304263114929, -0.75, 0.4000000059604645,
0.8999999761581421
],
"aspect": 2.4000000953674316,
"focus": 1.2168092727661133
},
{
"name": "front",
"frame": [
1.0, 0.0, 0.0, 0.0, 0.936329185962677, -0.3511234223842621, 0.0,
0.3511234223842621, 0.936329185962677, 0.0, 0.574999988079071,
1.399999976158142
],
"aspect": 3.0,
"focus": 1.4952006340026855
},
{
"name": "back",
"frame": [
-1.0, 0.0, 0.0, 0.0, 0.936329185962677, 0.3511234223842621, 0.0,
0.3511234223842621, -0.936329185962677, 0.0, 0.574999988079071,
-1.399999976158142
],
"aspect": 3.0,
"focus": 1.4952006340026855
},
{
"name": "perspective-sharp",
"frame": [
0.8151804208755493, -0.0, 0.579207181930542, 0.16660168766975403,
0.9577393531799316, -0.23447643220424652, -0.5547295212745667,
0.28763750195503235, 0.7807304263114929, -0.75, 0.4000000059604645,
0.8999999761581421
],
"aspect": 2.4000000953674316,
"focus": 1.2168092727661133
},
{
"name": "perspective-dof",
"frame": [
0.8151804208755493, -0.0, 0.579207181930542, 0.16660168766975403,
0.9577393531799316, -0.23447643220424652, -0.5547295212745667,
0.28763750195503235, 0.7807304263114929, -0.75, 0.4000000059604645,
0.8999999761581421
],
"aspect": 2.4000000953674316,
"focus": 1.2168092727661133,
"aperture": 0.02500000037252903
},
{
"name": "orthographic-sharp",
"frame": [
0.8151804208755493, -0.0, 0.579207181930542, 0.16660168766975403,
0.9577393531799316, -0.23447643220424652, -0.5547295212745667,
0.28763750195503235, 0.7807304263114929, -0.75, 0.4000000059604645,
0.8999999761581421
],
"orthographic": true,
"aspect": 2.4000000953674316,
"focus": 1.2168092727661133
},
{
"name": "orthographic-dof",
"frame": [
0.8151804208755493, -0.0, 0.579207181930542, 0.16660168766975403,
0.9577393531799316, -0.23447643220424652, -0.5547295212745667,
0.28763750195503235, 0.7807304263114929, -0.75, 0.4000000059604645,
0.8999999761581421
],
"orthographic": true,
"aspect": 2.4000000953674316,
"focus": 1.2168092727661133,
"aperture": 0.019999999552965164
}
],
"environments": [
{
"name": "sky",
"emission": [0.5, 0.5, 0.5],
"emission_tex": 0
}
],
"textures": [
{
"name": "sky",
"uri": "textures/sky.hdr"
},
{
"name": "floor",
"uri": "textures/floor.png"
},
{
"name": "uvgrid",
"uri": "textures/uvgrid.png"
},
{
"name": "bumps-normal",
"uri": "textures/bumps-normal.png"
}
],
"materials": [
{
"name": "floor",
"color": [0.699999988079071, 0.699999988079071, 0.699999988079071],
"color_tex": 1
},
{
"name": "bunny-uvgrid-coated",
"type": "glossy",
"color": [1.0, 1.0, 1.0],
"roughness": 0.20000000298023224,
"color_tex": 2
},
{
"name": "bunny-volume-jade",
"type": "refractive",
"color": [0.5, 0.5, 0.5],
"scattering": [
0.30000001192092896, 0.6000000238418579, 0.30000001192092896
]
},
{
"name": "bunny-metal-rough",
"type": "reflective",
"color": [0.6600000262260437, 0.44999998807907104, 0.3400000035762787],
"roughness": 0.20000000298023224
},
{
"name": "sphere-volume-glass",
"type": "refractive",
"color": [1.0, 0.5, 0.5]
},
{
"name": "sphere-plastic-rough-bumped",
"type": "glossy",
"color": [0.5, 0.699999988079071, 0.5],
"roughness": 0.20000000298023224,
"normal_tex": 3
},
{
"name": "arealight1",
"emission": [20.0, 20.0, 20.0]
},
{
"name": "arealight2",
"emission": [20.0, 20.0, 20.0]
}
],
"shapes": [
{
"name": "floor",
"uri": "shapes/floor.ply"
},
{
"name": "bunny",
"uri": "shapes/bunny.ply"
},
{
"name": "sphere",
"uri": "shapes/sphere.ply"
},
{
"name": "arealight1",
"uri": "shapes/arealight1.ply"
},
{
"name": "arealight2",
"uri": "shapes/arealight2.ply"
}
],
"instances": [
{
"name": "floor",
"shape": 0,
"material": 0
},
{
"name": "bunny-uvgrid-coated",
"frame": [
1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, -0.4000000059604645, 0.0,
0.0
],
"shape": 1,
"material": 1
},
{
"name": "bunny-volume-jade",
"shape": 1,
"material": 2
},
{
"name": "bunny-metal-rough",
"frame": [
1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.4000000059604645, 0.0,
0.0
],
"shape": 1,
"material": 3
},
{
"name": "sphere-volume-glass",
"frame": [
1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, -0.20000000298023224, 0.0,
0.0
],
"shape": 2,
"material": 4
},
{
"name": "sphere-plastic-rough-bumped",
"frame": [
1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.20000000298023224, 0.0,
0.0
],
"shape": 2,
"material": 5
},
{
"name": "arealight1",
"frame": [
0.8944271802902222, -0.0, 0.4472135901451111, 0.27562475204467773,
0.7874992489814758, -0.5512495040893555, -0.3521803617477417,
0.6163156628608704, 0.7043607234954834, -0.4000000059604645,
0.800000011920929, 0.800000011920929
],
"shape": 3,
"material": 6
},
{
"name": "arealight2",
"frame": [
0.8944271802902222, 0.0, -0.4472135901451111, -0.27562475204467773,
0.7874992489814758, -0.5512495040893555, 0.3521803617477417,
0.6163156628608704, 0.7043607234954834, 0.4000000059604645,
0.800000011920929, 0.800000011920929
],
"shape": 4,
"material": 7
}
]
}
Loading