[spline/bezier]Fix patch subdivision counts correctly.

This commit is contained in:
xebra 2014-11-25 23:37:53 +09:00
parent ab0eeb18f3
commit 8cc7d8c71a
2 changed files with 4 additions and 4 deletions

View file

@ -177,8 +177,8 @@ void _SplinePatchFullQuality(u8 *&dest, int &count, const SplinePatchLocal &spa
// Increase tesselation based on the size. Should be approximately right? // Increase tesselation based on the size. Should be approximately right?
// JPCSP is wrong at least because their method results in square loco roco. // JPCSP is wrong at least because their method results in square loco roco.
int patch_div_s = (spatch.count_u - 3) * gstate.getPatchDivisionU() / 3; int patch_div_s = (spatch.count_u - 3) * gstate.getPatchDivisionU();
int patch_div_t = (spatch.count_v - 3) * gstate.getPatchDivisionV() / 3; int patch_div_t = (spatch.count_v - 3) * gstate.getPatchDivisionV();
if (patch_div_s <= 0) patch_div_s = 1; if (patch_div_s <= 0) patch_div_s = 1;
if (patch_div_t <= 0) patch_div_t = 1; if (patch_div_t <= 0) patch_div_t = 1;

View file

@ -162,8 +162,8 @@ void TransformDrawEngine::SubmitBezier(void* control_points, void* indices, int
// like the splines, so we subdivide across the whole "mega-patch". // like the splines, so we subdivide across the whole "mega-patch".
if (num_patches_u == 0) num_patches_u = 1; if (num_patches_u == 0) num_patches_u = 1;
if (num_patches_v == 0) num_patches_v = 1; if (num_patches_v == 0) num_patches_v = 1;
int tess_u = gstate.getPatchDivisionU() / num_patches_u; int tess_u = gstate.getPatchDivisionU();
int tess_v = gstate.getPatchDivisionV() / num_patches_v; int tess_v = gstate.getPatchDivisionV();
if (tess_u < 4) tess_u = 4; if (tess_u < 4) tess_u = 4;
if (tess_v < 4) tess_v = 4; if (tess_v < 4) tess_v = 4;