diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 23:28:34 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 23:28:34 +0000 |
commit | e739a367121f29e64a8c0a0b386fe487d7b52e87 (patch) | |
tree | ced2ca14d897e80c3bd2df34d27158cb1f722801 /o3d/samples | |
parent | 2e0debaa565f8f4f62982dbae1a003f5bdbd0672 (diff) | |
download | chromium_src-e739a367121f29e64a8c0a0b386fe487d7b52e87.zip chromium_src-e739a367121f29e64a8c0a0b386fe487d7b52e87.tar.gz chromium_src-e739a367121f29e64a8c0a0b386fe487d7b52e87.tar.bz2 |
Fixed problem with some parameters being optimized away by the GLSL
compiler.
BUG=none
TEST=ran o3d-webgl pool on Windows with NVIDIA hardware
already reviewed=petersont
Review URL: http://codereview.chromium.org/1748017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples')
-rw-r--r-- | o3d/samples/o3d-webgl-samples/pool.html | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/o3d/samples/o3d-webgl-samples/pool.html b/o3d/samples/o3d-webgl-samples/pool.html index 088cfe5..3214d33 100644 --- a/o3d/samples/o3d-webgl-samples/pool.html +++ b/o3d/samples/o3d-webgl-samples/pool.html @@ -1011,6 +1011,14 @@ function updateContext() { } +function setOptionalParam(material, name, value) { + var param = material.getParam(name); + if (param) { + param.value = value; + } +} + + function initMaterials() { g_materials = { 'solid':{}, @@ -1045,9 +1053,9 @@ function initMaterials() { var target = [0, 0, 0]; g_cameraInfo.getEyeAndTarget(eye, target); - material.getParam('factor').value = 2 / g_tableWidth; - material.getParam('lightWorldPosition').value = g_light; - material.getParam('eyeWorldPosition').value = eye; + setOptionalParam(material, 'factor', 2 / g_tableWidth); + setOptionalParam(material, 'lightWorldPosition', g_light); + setOptionalParam(material, 'eyeWorldPosition', eye); } g_solidMaterial = g_materials['solid']; @@ -1070,7 +1078,7 @@ function updateMaterials() { var eye = [0, 0, 0]; var target = [0, 0, 0]; g_cameraInfo.getEyeAndTarget(eye, target); - g_materials[name].getParam('eyeWorldPosition').value = eye; + setOptionalParam(g_materials[name], 'eyeWorldPosition', eye); } } |