summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorluchen@google.com <luchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 19:52:40 +0000
committerluchen@google.com <luchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 19:52:40 +0000
commit1750a95d56338a475b83c929b0b7eed861199db5 (patch)
treea2f68cbd73e848a47aece62cb1b3ff8218b75442 /o3d
parent1f0f54f4442d001ef10f44781b9d2200ece3ad40 (diff)
downloadchromium_src-1750a95d56338a475b83c929b0b7eed861199db5.zip
chromium_src-1750a95d56338a475b83c929b0b7eed861199db5.tar.gz
chromium_src-1750a95d56338a475b83c929b0b7eed861199db5.tar.bz2
Adding wireframe light indicator to shadow map demo.
Review URL: http://codereview.chromium.org/2718003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49304 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/samples/o3d-webgl-samples/shadow-map.html11
-rw-r--r--o3d/samples/o3d-webgl/effect.js7
-rw-r--r--o3d/samples/o3djs/effect.js4
3 files changed, 11 insertions, 11 deletions
diff --git a/o3d/samples/o3d-webgl-samples/shadow-map.html b/o3d/samples/o3d-webgl-samples/shadow-map.html
index bf1969a..7940410 100644
--- a/o3d/samples/o3d-webgl-samples/shadow-map.html
+++ b/o3d/samples/o3d-webgl-samples/shadow-map.html
@@ -244,10 +244,10 @@ function initMaterials() {
var shadowVertexShader = document.getElementById('shadowVertexShader').text;
var shadowPixelShader = document.getElementById('shadowPixelShader').text;
-
+
g_shadowMaterial = g_pack.createObject('Material');
g_shadowMaterial.drawList = g_shadowViewInfo.performanceDrawList;
-
+
var shadowEffect = g_pack.createObject('Effect');
shadowEffect.loadVertexShaderFromString(shadowVertexShader);
shadowEffect.loadPixelShaderFromString(shadowPixelShader);
@@ -382,10 +382,9 @@ function createShapes() {
function createLightShape() {
var inverseMatrix = g_math.matrix4.inverse(g_lightViewProjection);
-/*
// Scale and translate a cube of side length 2 to get a box
// that extends from [-1, -1, 0] to [1, 1, 1].
- var shape = o3djs.debug.createLineCube(
+ var shape = o3djs.lineprimitives.createLineCube(
g_pack,
o3djs.material.createConstantMaterial(g_pack,
g_colorViewInfo,
@@ -393,12 +392,12 @@ function createLightShape() {
2,
g_math.matrix4.compose(
g_math.matrix4.translation([0, 0, 0.5]),
- g_math.matrix4.scaling([1, 1, 0.5])));*/
+ g_math.matrix4.scaling([1, 1, 0.5])));
g_lightFrustumTransform = g_pack.createObject('Transform');
g_lightFrustumTransform.localMatrix = inverseMatrix;
g_lightFrustumTransform.parent = g_client.root;
- //g_lightFrustumTransform.addShape(shape);
+ g_lightFrustumTransform.addShape(shape);
}
diff --git a/o3d/samples/o3d-webgl/effect.js b/o3d/samples/o3d-webgl/effect.js
index b0386d7..4d10b72 100644
--- a/o3d/samples/o3d-webgl/effect.js
+++ b/o3d/samples/o3d-webgl/effect.js
@@ -430,10 +430,11 @@ o3d.Effect.prototype.getParameterInfo = function() {
var sasTypeName = sasTypes[name] || '';
var className = paramTypes[info.type] || '';
var numElements = 0; // TODO(petersont): Add array support.
- var semantic = semanticMap[name].semantic || o3d.Stream.UNKNOWN_SEMANTIC;
+ var semantic = (semanticMap[name] && semanticMap[name].semantic) ?
+ semanticMap[name].semantic : o3d.Stream.UNKNOWN_SEMANTIC;
- infoArray.push(new EffectParameterInfo(
- name, className, numElements, semantic, sasClassName));
+ infoArray.push(new o3d.EffectParameterInfo(
+ name, className, numElements, semantic, sasTypeName));
}
return infoArray;
diff --git a/o3d/samples/o3djs/effect.js b/o3d/samples/o3djs/effect.js
index 7c87cef..0d23889 100644
--- a/o3d/samples/o3djs/effect.js
+++ b/o3d/samples/o3djs/effect.js
@@ -1310,11 +1310,11 @@ o3djs.effect.attachStandardShader = function(pack,
// help the user get something on the screen. We check to make sure they
// are not connected to something otherwise we'll get an error.
var param = material.getParam('lightWorldPos');
- if (!param.inputConnection) {
+ if (param && !param.inputConnection) {
param.value = lightPos;
}
var param = material.getParam('lightColor');
- if (!param.inputConnection) {
+ if (param && !param.inputConnection) {
param.value = [1, 1, 1, 1];
}
return true;