summaryrefslogtreecommitdiffstats
path: root/o3d/samples
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 23:36:51 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 23:36:51 +0000
commit6160179b7f8d1e8ebe0397fab79c651025b0139c (patch)
treeceade915b3521187e53c157d3dd42e46e2f8e11e /o3d/samples
parentc023c19d6d79d33c2ba0afb9da07553e3664abf4 (diff)
downloadchromium_src-6160179b7f8d1e8ebe0397fab79c651025b0139c.zip
chromium_src-6160179b7f8d1e8ebe0397fab79c651025b0139c.tar.gz
chromium_src-6160179b7f8d1e8ebe0397fab79c651025b0139c.tar.bz2
Added rules which generate WebGL-compatible assets to samples_gen.py.
Added conversion step for teapot and cube assets, which are known to work within helloworld.html. Added comment to helloworld.html about enabling the debug rendering context. BUG=none TEST=tested helloworld.html against converted assets Review URL: http://codereview.chromium.org/1793004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45754 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples')
-rw-r--r--o3d/samples/o3d-webgl-samples/helloworld.html3
-rw-r--r--o3d/samples/samples_gen.py19
2 files changed, 19 insertions, 3 deletions
diff --git a/o3d/samples/o3d-webgl-samples/helloworld.html b/o3d/samples/o3d-webgl-samples/helloworld.html
index a02a481..f44a08e 100644
--- a/o3d/samples/o3d-webgl-samples/helloworld.html
+++ b/o3d/samples/o3d-webgl-samples/helloworld.html
@@ -121,6 +121,9 @@ function loadScene(pack, fileName, parent) {
*/
function init() {
o3djs.webgl.makeClients(initStep2);
+ // The following call enables a debug WebGL context, which makes
+ // debugging much easier.
+ // o3djs.webgl.makeClients(initStep2, undefined, undefined, undefined, undefined, undefined, true);
}
/**
diff --git a/o3d/samples/samples_gen.py b/o3d/samples/samples_gen.py
index 94ca89d..c0386db 100644
--- a/o3d/samples/samples_gen.py
+++ b/o3d/samples/samples_gen.py
@@ -39,7 +39,7 @@ assets = [
{'path': 'convert_assets/part3.zip', 'up': y_up},
{'path': 'convert_assets/seven_shapes.zip', 'up': y_up},
{'path': 'convert_assets/stencil_frame.zip', 'up': y_up},
- {'path': 'convert_assets/teapot.zip', 'up': y_up},
+ {'path': 'convert_assets/teapot.zip', 'up': y_up, 'webgl': True},
{'path': 'convert_assets/yard.zip', 'up': y_up},
{'path': 'home-configurators/convert_cbassets/Agra_Rug.kmz', 'up': z_up},
{'path': 'home-configurators/convert_cbassets/Asimi_Rug.kmz', 'up': z_up},
@@ -65,7 +65,7 @@ assets = [
{'path': 'home-configurators/convert_cbassets/Troy_Twin_Sleeper.kmz', 'up': z_up},
{'path': 'io/convert_levels/all_actors.kmz', 'up': y_up},
{'path': 'io/convert_levels/map1.kmz', 'up': y_up},
- {'path': 'simpleviewer/convert_assets/cube.zip', 'up': y_up},
+ {'path': 'simpleviewer/convert_assets/cube.zip', 'up': y_up, 'webgl': True},
]
output_file.write("""# Copyright (c) 2009 The Chromium Authors. All rights reserved.
@@ -87,12 +87,15 @@ output_file.write("""# Copyright (c) 2009 The Chromium Authors. All rights reser
'../converter/converter.gyp:o3dConverter',
],
'actions': [\n""")
-for asset in assets:
+
+def write_action(asset, webgl_mode):
filename = posixpath.splitext(posixpath.basename(asset['path']))[0]
filename = filename.replace('.','_')
filename = filename.replace('-','_')
filename = filename.lower()
name = "convert_" + filename
+ if webgl_mode:
+ name = name + "_webgl"
output = asset['path'].replace('convert_', '')
output = posixpath.splitext(output)[0] + ".o3dtgz"
output_dir = posixpath.dirname(output)
@@ -116,11 +119,21 @@ for asset in assets:
output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n")
output_file.write(" '--no-condition',\n")
output_file.write(" '--up-axis=%s',\n" % asset['up'])
+ if webgl_mode:
+ output_file.write(" '--no-binary',\n")
+ output_file.write(" '--no-archive',\n")
+ output_file.write(" '--convert-dds-to-png',\n")
+ output_file.write(" '--convert-cg-to-glsl',\n")
output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path'])
output_file.write(" '<(_outputs)',\n")
output_file.write(" ],\n")
output_file.write(" },\n")
+for asset in assets:
+ write_action(asset, False);
+ if asset.has_key('webgl'):
+ write_action(asset, True);
+
output_file.write(" ],\n")
# Coalesce copies by directory so we don't have tons of copies rules