diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-01 04:21:40 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-01 04:21:40 +0000 |
commit | 70c8e97a69ef8806b1812b2cd0ebe831f3792cb6 (patch) | |
tree | 4c5b5e5b71ce99f91910b3fd569443f0f07a4e72 /o3d/tests | |
parent | 13a8961bf84b7132e2ae588ea644bf7b8012fe75 (diff) | |
download | chromium_src-70c8e97a69ef8806b1812b2cd0ebe831f3792cb6.zip chromium_src-70c8e97a69ef8806b1812b2cd0ebe831f3792cb6.tar.gz chromium_src-70c8e97a69ef8806b1812b2cd0ebe831f3792cb6.tar.bz2 |
Update samples to use more utility functions where
appropriate.
A few places used pseudoRandom. That is in math.js
now so they use that.
Other places there is now
o3djs.material.createBasicMaterial and
o3djs.material.createMaterialFromFile that save
10-20 lines per sample.
This CL will require new reference images.
There are 2 other things I'd like to consider.
#1) Changing every sample that uses shaders/texture-only.shader
to use o3djs.material.createConstantMaterial or some variation.
The problem with o3djs.material.createConstantMaterial is it
requires you pass it a texture if you want a constant textured
material. All the samples create the material first, then
later add the texture.
So, I could add a new o3djs.material.createTextureOnlyMaterial.
At the same time that would mean changing those samples from
setting stuff on 'texSampler0' to 'emissive'
#2) I'd like to change the shader builder so it stops
adding "Sampler" to textured materials. As it is if
the material uses a color it makes the param called "diffuse"
but if it's a texture it makes it "diffuseSampler".
That sucks because it means the code has to do crap like
var param = material.getParam('diffuse');
if (param) {
// it's a color
} else {
param = material.getParam('diffuseSampler');
if (param) {
// it's a texture.
}
}
If we stopped that silliness we could just do
var param = material.getParam('diffuse');
if (param) {
if (param.isA('o3d.ParamTexture')) {
// it's textured.
} else {
// it's not.
}
}
Unfortunately to fix this requires changing the o3dConverter
as well since it uses those conventions. Should we do this?
Review URL: http://codereview.chromium.org/182024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25015 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/tests')
-rw-r--r-- | o3d/tests/selenium/sample_list.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/o3d/tests/selenium/sample_list.txt b/o3d/tests/selenium/sample_list.txt index 6f957ee..6109159 100644 --- a/o3d/tests/selenium/sample_list.txt +++ b/o3d/tests/selenium/sample_list.txt @@ -83,7 +83,7 @@ medium canvas-fonts screenshot pdiff_threshold(200) pdiff_ medium canvas-texturedraw medium checkers screenshot pdiff_threshold(200) medium convolution screenshot pdiff_threshold(200) -medium culling screenshot pdiff_threshold(450) downsample(1) +medium culling screenshot(9) pdiff_threshold(450) downsample(1) medium debugging screenshot pdiff_threshold(200) pdiff_threshold_mac(3000) medium displayfps small generate-texture screenshot pdiff_threshold(200) except(*iexplore) @@ -91,13 +91,13 @@ medium hellocube screenshot pdiff_threshold(200) medium hellocube-colors screenshot pdiff_threshold(200) medium helloworld screenshot pdiff_threshold(200) medium hud-2d-overlay screenshot pdiff_threshold(200) pdiff_threshold_win(200) -medium instance-override screenshot pdiff_threshold(200) +medium instance-override screenshot(2) pdiff_threshold(200) medium instancing screenshot pdiff_threshold(200) medium juggler screenshot downsample(1) medium julia screenshot small multiple-views screenshot pdiff_threshold(200) medium old-school-shadows screenshot pdiff_threshold(200) -medium particles screenshot pdiff_threshold(200) +medium particles screenshot(2) pdiff_threshold(200) medium primitives screenshot pdiff_threshold(200) pdiff_threshold_mac(20000) colorfactor(.7) medium procedural-texture screenshot pdiff_threshold(200) medium render-targets screenshot pdiff_threshold(200) @@ -112,7 +112,7 @@ small texturesamplers screenshot pdiff_threshold_win(1200) p medium tutorial-primitive screenshot pdiff_threshold(200) pdiff_threshold_mac(10400) large vertex-shader screenshot timeout(45000) pdiff_threshold(200) except(*iexplore) medium vertex-shader-animation screenshot pdiff_threshold(200) -medium zsorting screenshot pdiff_threshold_win(200) pdiff_threshold_mac(39500) +medium zsorting screenshot(9) pdiff_threshold_win(200) pdiff_threshold_mac(39500) # box2d-3d works in browsers but for some reason times out on some configs #large box2d-3d/box2d-3d timeout(45000) except(*googlechrome) large simpleviewer/simpleviewer screenshot pdiff_threshold(100) |