summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-24 05:42:10 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-24 05:42:10 +0000
commitb0f2cbe313015c540ce3db5d660498489842d567 (patch)
tree23e5f0e1d37b4eb039a161edf56c4c10eda72725 /o3d
parent46ebf0640d32b313618fe443a34e959059b2c3f9 (diff)
downloadchromium_src-b0f2cbe313015c540ce3db5d660498489842d567.zip
chromium_src-b0f2cbe313015c540ce3db5d660498489842d567.tar.gz
chromium_src-b0f2cbe313015c540ce3db5d660498489842d567.tar.bz2
Tweaked antialiasing function. Result looks good now in conjunction
with multisampling. BUG=none TEST=none TBR=apatrick Review URL: http://codereview.chromium.org/3040018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/samples/o3djs/gpu2d.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/o3d/samples/o3djs/gpu2d.js b/o3d/samples/o3djs/gpu2d.js
index 4c95527..e4c65f9 100644
--- a/o3d/samples/o3djs/gpu2d.js
+++ b/o3d/samples/o3djs/gpu2d.js
@@ -542,8 +542,10 @@ o3djs.gpu2d.generateLoopBlinnShaderSource_ = function(antialias,
'\n' +
' // Linear alpha\n' +
' // TODO(kbr): figure out why this needs to be\n' +
- ' // negated compared to Cg version.\n' +
- ' float alpha = clamp(sd - 0.5, 0.0, 1.0);\n';
+ ' // negated compared to Cg version, and also why\n' +
+ ' // we need an adjustment by +1.0 for it to look good.\n' +
+ ' // float alpha = clamp(0.5 - sd, 0.0, 1.0);\n' +
+ ' float alpha = clamp(sd + 0.5, 0.0, 1.0);\n';
} else {
alphaComputation = '' +
' float t = klm.x * klm.x * klm.x - klm.y * klm.z;\n' +