Skip to content

Commit b1c6522

Browse files
committed
testshade: rename --scalest/--offsetst -> --scaleuv/--offsetuv
Because it modifies the u and v range. There is no s and t.
1 parent 54e5434 commit b1c6522

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

src/testshade/testshade.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ static ShaderGroupRef shadergroup;
101101
static std::string archivegroup;
102102
static int exprcount = 0;
103103
static bool shadingsys_options_set = false;
104-
static float sscale = 1, tscale = 1;
105-
static float soffset = 0, toffset = 0;
104+
static float uscale = 1, vscale = 1;
105+
static float uoffset = 0, voffset = 0;
106106

107107

108108

@@ -496,8 +496,10 @@ getargs (int argc, const char *argv[])
496496
"--shadeimage", &use_shade_image, "Use shade_image utility",
497497
"--noshadeimage %!", &use_shade_image, "Don't use shade_image utility",
498498
"--expr %@ %s", &specify_expr, NULL, "Specify an OSL expression to evaluate",
499-
"--offsetst %f %f", &soffset, &toffset, "Offset s & t texture coordinates (default: 0 0)",
500-
"--scalest %f %f", &sscale, &tscale, "Scale s & t texture lookups (default: 1, 1)",
499+
"--offsetuv %f %f", &uoffset, &voffset, "Offset s & t texture coordinates (default: 0 0)",
500+
"--offsetst %f %f", &uoffset, &voffset, "", // old name
501+
"--scaleuv %f %f", &uscale, &vscale, "Scale s & t texture lookups (default: 1, 1)",
502+
"--scalest %f %f", &uscale, &vscale, "", // old name
501503
"--userdata_isconnected", &userdata_isconnected, "Consider lockgeom=0 to be isconnected()",
502504
"-v", &verbose, "Verbose output",
503505
NULL);
@@ -587,17 +589,17 @@ setup_shaderglobals (ShaderGlobals &sg, ShadingSystem *shadingsys,
587589
if (pixelcenters) {
588590
// Our patch is like an "image" with shading samples at the
589591
// centers of each pixel.
590-
sg.u = sscale * (float)(x+0.5f) / xres + soffset;
591-
sg.v = tscale * (float)(y+0.5f) / yres + toffset;
592-
sg.dudx = sscale / xres;
593-
sg.dvdy = tscale / yres;
592+
sg.u = uscale * (float)(x+0.5f) / xres + uoffset;
593+
sg.v = vscale * (float)(y+0.5f) / yres + voffset;
594+
sg.dudx = uscale / xres;
595+
sg.dvdy = vscale / yres;
594596
} else {
595597
// Our patch is like a Reyes grid of points, with the border
596598
// samples being exactly on u,v == 0 or 1.
597-
sg.u = sscale * ((xres == 1) ? 0.5f : (float) x / (xres - 1)) + soffset;
598-
sg.v = tscale * ((yres == 1) ? 0.5f : (float) y / (yres - 1)) + toffset;
599-
sg.dudx = sscale / std::max (1, xres-1);
600-
sg.dvdy = tscale / std::max (1, yres-1);
599+
sg.u = uscale * ((xres == 1) ? 0.5f : (float) x / (xres - 1)) + uoffset;
600+
sg.v = vscale * ((yres == 1) ? 0.5f : (float) y / (yres - 1)) + voffset;
601+
sg.dudx = uscale / std::max (1, xres-1);
602+
sg.dvdy = vscale / std::max (1, yres-1);
601603
}
602604

603605
// Assume that position P is simply (u,v,1), that makes the patch lie

testsuite/texture-udim/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
# Purposely only create two of the four UDIM textures
99

10-
command += testshade("-g 128 128 --center -scalest 2 2 -od uint8 -o Cout out.tif test")
10+
command += testshade("-g 128 128 --center -scaleuv 2 2 -od uint8 -o Cout out.tif test")
1111
outputs = [ "out.txt", "out.tif" ]

0 commit comments

Comments
 (0)