Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1336)

Unified Diff: o3djs/material.js

Issue 3358020: o3djs: Multiple simple lights, and a new demo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/o3d/samples/
Patch Set: added var declarations Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « o3djs/effect.js ('k') | o3djs/pack.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: o3djs/material.js
===================================================================
--- o3djs/material.js (revision 60893)
+++ o3djs/material.js (working copy)
@@ -113,13 +113,15 @@
* @param {!o3d.Material} material to prepare.
* @param {string} opt_effectType type of effect to create ('phong',
* 'lambert', 'constant').
+ * @param {Object} opt_options Extra options for effect.getStandardShader
*
* @see o3djs.material.attachStandardEffect
*/
o3djs.material.prepareMaterial = function(pack,
viewInfo,
material,
- opt_effectType) {
+ opt_effectType,
+ opt_options) {
// Assume we want the performance list
var drawList = viewInfo.performanceDrawList;
// First check if we have a tag telling us that it is or is not
@@ -146,7 +148,8 @@
o3djs.material.attachStandardEffect(pack,
material,
viewInfo,
- opt_effectType);
+ opt_effectType,
+ opt_options);
// For collada common profile stuff guess what drawList to use. Note: We
// can only do this for collada common profile stuff because we supply
// the shaders and therefore now the inputs and how they are used.
@@ -185,17 +188,20 @@
* o3djs.rendergraph.createView.
* @param {!o3d.Pack} opt_effectPack Pack to create effects in. If this
* is not specifed the pack to prepare above will be used.
+ * @param {Object} opt_options Extra options for effect.getStandardShader
*
* @see o3djs.material.prepareMaterial
*/
o3djs.material.prepareMaterials = function(pack,
viewInfo,
- opt_effectPack) {
+ opt_effectPack,
+ opt_options) {
var materials = pack.getObjectsByClassName('o3d.Material');
for (var mm = 0; mm < materials.length; mm++) {
o3djs.material.prepareMaterial(opt_effectPack || pack,
viewInfo,
- materials[mm]);
+ materials[mm],
+ opt_options);
}
};
@@ -207,17 +213,20 @@
* effect.
* @param {string} effectType Type of effect to create ('phong', 'lambert',
* 'constant').
+ * @param {Object} opt_options Extra options for effect.getStandardShader
*
* @see o3djs.effect.attachStandardShader
*/
o3djs.material.attachStandardEffectEx = function(pack,
material,
- effectType) {
+ effectType,
+ opt_options) {
if (!material.effect) {
if (!o3djs.effect.attachStandardShader(pack,
material,
[0, 0, 0],
- effectType)) {
+ effectType,
+ opt_options)) {
throw 'Could not attach a standard effect';
}
}
@@ -234,13 +243,15 @@
* o3djs.rendergraph.createView.
* @param {string} effectType Type of effect to create ('phong', 'lambert',
* 'constant').
+ * @param {Object} opt_options Extra options for effect.getStandardShader
*
* @see o3djs.effect.attachStandardShader
*/
o3djs.material.attachStandardEffect = function(pack,
material,
viewInfo,
- effectType) {
+ effectType,
+ opt_options) {
if (!material.effect) {
var lightPos =
o3djs.math.matrix4.getTranslation(
@@ -248,7 +259,8 @@
if (!o3djs.effect.attachStandardShader(pack,
material,
lightPos, // TODO(gman): remove this
- effectType)) {
+ effectType,
+ opt_options)) {
throw 'Could not attach a standard effect';
}
}
« no previous file with comments | « o3djs/effect.js ('k') | o3djs/pack.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698