Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit tests for all ImageMapTexture wrap modes (issue #24)
- Loading branch information
Showing
10 changed files
with
182 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# -*- coding: utf-8 -*- | ||
################################################################################ | ||
# Copyright 1998-2018 by authors (see AUTHORS.txt) | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
################################################################################ | ||
|
||
import unittest | ||
import pyluxcore | ||
|
||
from pyluxcoreunittests.tests.utils import * | ||
from pyluxcoreunittests.tests.imagetest import * | ||
|
||
################################################################################ | ||
# ImageMapTexture wrap repeat test | ||
################################################################################ | ||
|
||
def TestWrapRepeat(cls, params): | ||
StandardSceneTest(cls, params, "simple/tex-wrap-repeat.cfg", "WrapRepeat") | ||
|
||
class WrapRepeat(ImageTest): | ||
pass | ||
|
||
WrapRepeat = AddTests(WrapRepeat, TestWrapRepeat, GetTestCases()) | ||
|
||
################################################################################ | ||
# ImageMapTexture wrap black test | ||
################################################################################ | ||
|
||
def TestWrapBlack(cls, params): | ||
StandardSceneTest(cls, params, "simple/tex-wrap-black.cfg", "WrapBlack") | ||
|
||
class WrapBlack(ImageTest): | ||
pass | ||
|
||
WrapBlack = AddTests(WrapBlack, TestWrapBlack, GetTestCases()) | ||
|
||
################################################################################ | ||
# ImageMapTexture wrap white test | ||
################################################################################ | ||
|
||
def TestWrapWhite(cls, params): | ||
StandardSceneTest(cls, params, "simple/tex-wrap-white.cfg", "WrapWhite") | ||
|
||
class WrapWhite(ImageTest): | ||
pass | ||
|
||
WrapWhite = AddTests(WrapWhite, TestWrapWhite, GetTestCases()) | ||
|
||
|
||
################################################################################ | ||
# ImageMapTexture wrap clamp test | ||
################################################################################ | ||
|
||
def TestWrapClamp(cls, params): | ||
StandardSceneTest(cls, params, "simple/tex-wrap-black.cfg", "WrapClamp") | ||
|
||
class WrapClamp(ImageTest): | ||
pass | ||
|
||
WrapClamp = AddTests(WrapClamp, TestWrapClamp, GetTestCases()) | ||
|
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,18 @@ | ||
ply | ||
format ascii 1.0 | ||
comment Created by Blender3D 249 - www.blender.org, source file: | ||
element vertex 4 | ||
property float x | ||
property float y | ||
property float z | ||
property float s | ||
property float t | ||
element face 2 | ||
property list uchar uint vertex_indices | ||
end_header | ||
3.775332 3.845772 0.003744 2 -1 | ||
3.775332 -3.674710 0.003744 2 2 | ||
-3.755317 -3.674709 0.003744 -1 2 | ||
-3.755316 3.845773 0.003744 -1 -1 | ||
3 0 1 2 | ||
3 0 2 3 |
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,4 @@ | ||
film.width = 512 | ||
film.height = 384 | ||
scene.file = resources/scenes/simple/tex-wrap-black.scn | ||
|
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,19 @@ | ||
scene.camera.lookat.orig = 0 -1 10 | ||
scene.camera.lookat.target = 0.0 0.0 0.0 | ||
################################################################################ | ||
scene.textures.imagetex.type = imagemap | ||
scene.textures.imagetex.file = resources/img/grid.png | ||
scene.textures.imagetex.wrap = black | ||
################################################################################ | ||
scene.materials.whitematte.type = matte | ||
scene.materials.whitematte.kd = imagetex | ||
################################################################################ | ||
scene.shapes.room.type = mesh | ||
scene.shapes.room.ply = resources/scenes/simple/room-nowall.ply | ||
################################################################################ | ||
scene.objects.room.material = whitematte | ||
scene.objects.room.shape = room | ||
################################################################################ | ||
scene.lights.l1.type = infinite | ||
scene.lights.l1.file = resources/hdr/arch.exr | ||
scene.lights.l1.gain = 4.0 4.0 4.0 |
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,4 @@ | ||
film.width = 512 | ||
film.height = 384 | ||
scene.file = resources/scenes/simple/tex-wrap-clamp.scn | ||
|
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,19 @@ | ||
scene.camera.lookat.orig = 0 -1 10 | ||
scene.camera.lookat.target = 0.0 0.0 0.0 | ||
################################################################################ | ||
scene.textures.imagetex.type = imagemap | ||
scene.textures.imagetex.file = resources/img/grid.png | ||
scene.textures.imagetex.wrap = clamp | ||
################################################################################ | ||
scene.materials.whitematte.type = matte | ||
scene.materials.whitematte.kd = imagetex | ||
################################################################################ | ||
scene.shapes.room.type = mesh | ||
scene.shapes.room.ply = resources/scenes/simple/room-nowall.ply | ||
################################################################################ | ||
scene.objects.room.material = whitematte | ||
scene.objects.room.shape = room | ||
################################################################################ | ||
scene.lights.l1.type = infinite | ||
scene.lights.l1.file = resources/hdr/arch.exr | ||
scene.lights.l1.gain = 4.0 4.0 4.0 |
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,4 @@ | ||
film.width = 512 | ||
film.height = 384 | ||
scene.file = resources/scenes/simple/tex-wrap-repeat.scn | ||
|
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,19 @@ | ||
scene.camera.lookat.orig = 0 -1 10 | ||
scene.camera.lookat.target = 0.0 0.0 0.0 | ||
################################################################################ | ||
scene.textures.imagetex.type = imagemap | ||
scene.textures.imagetex.file = resources/img/grid.png | ||
scene.textures.imagetex.wrap = repeat | ||
################################################################################ | ||
scene.materials.whitematte.type = matte | ||
scene.materials.whitematte.kd = imagetex | ||
################################################################################ | ||
scene.shapes.room.type = mesh | ||
scene.shapes.room.ply = resources/scenes/simple/room-nowall.ply | ||
################################################################################ | ||
scene.objects.room.material = whitematte | ||
scene.objects.room.shape = room | ||
################################################################################ | ||
scene.lights.l1.type = infinite | ||
scene.lights.l1.file = resources/hdr/arch.exr | ||
scene.lights.l1.gain = 4.0 4.0 4.0 |
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,4 @@ | ||
film.width = 512 | ||
film.height = 384 | ||
scene.file = resources/scenes/simple/tex-wrap-white.scn | ||
|
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,19 @@ | ||
scene.camera.lookat.orig = 0 -1 10 | ||
scene.camera.lookat.target = 0.0 0.0 0.0 | ||
################################################################################ | ||
scene.textures.imagetex.type = imagemap | ||
scene.textures.imagetex.file = resources/img/grid.png | ||
scene.textures.imagetex.wrap = white | ||
################################################################################ | ||
scene.materials.whitematte.type = matte | ||
scene.materials.whitematte.kd = imagetex | ||
################################################################################ | ||
scene.shapes.room.type = mesh | ||
scene.shapes.room.ply = resources/scenes/simple/room-nowall.ply | ||
################################################################################ | ||
scene.objects.room.material = whitematte | ||
scene.objects.room.shape = room | ||
################################################################################ | ||
scene.lights.l1.type = infinite | ||
scene.lights.l1.file = resources/hdr/arch.exr | ||
scene.lights.l1.gain = 4.0 4.0 4.0 |