summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authoramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 17:31:29 +0000
committeramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 17:31:29 +0000
commitc28be2f52c47f143df0109ccaa9d4dec15fb257c (patch)
treec382ae9fad7fd9c7513f13d37c48f0695f7cf684 /o3d
parentea68c06a2c5182d1a06ce804306aeab17ed75dc5 (diff)
downloadchromium_src-c28be2f52c47f143df0109ccaa9d4dec15fb257c.zip
chromium_src-c28be2f52c47f143df0109ccaa9d4dec15fb257c.tar.gz
chromium_src-c28be2f52c47f143df0109ccaa9d4dec15fb257c.tar.bz2
Fixed primitives' glsl shaders: it was missing MatrixLoadOrder directive.
Review URL: http://codereview.chromium.org/1766002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45459 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/samples/o3djs/effect.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/o3d/samples/o3djs/effect.js b/o3d/samples/o3djs/effect.js
index 2465c98..2213627 100644
--- a/o3d/samples/o3djs/effect.js
+++ b/o3d/samples/o3djs/effect.js
@@ -310,8 +310,7 @@ o3djs.effect.glsl.endPixelShaderMain = function(color) {
*/
o3djs.effect.o3d.entryPoints = function() {
return '// #o3d VertexShaderEntryPoint vertexShaderFunction\n' +
- '// #o3d PixelShaderEntryPoint pixelShaderFunction\n' +
- '// #o3d MatrixLoadOrder RowMajor\n';
+ '// #o3d PixelShaderEntryPoint pixelShaderFunction\n';
};
@@ -323,6 +322,11 @@ o3djs.effect.glsl.entryPoints = function() {
return '';
};
+o3djs.effect.glsl.matrixLoadOrder =
+o3djs.effect.o3d.matrixLoadOrder = function() {
+ return '// #o3d MatrixLoadOrder RowMajor\n';
+};
+
/**
* Sets the shader language used. Passing 'glsl' will cause all generated
@@ -617,7 +621,8 @@ o3djs.effect.buildCheckerShaderString = function() {
' outColor = directionalIntensity * check;\n' +
p.endPixelShaderMain(
p.FLOAT4 + '(outColor.rgb, check.a)') +
- '\n' + p.entryPoints();
+ '\n' + p.entryPoints() +
+ p.matrixLoadOrder();
};
@@ -887,7 +892,8 @@ o3djs.effect.buildStandardShaderString = function(material,
p.beginPixelShaderMain() +
getColorParam(material, 'emissive') +
p.endPixelShaderMain('emissive') +
- p.entryPoints();
+ p.entryPoints() +
+ p.matrixLoadOrder();
};
/**
@@ -931,7 +937,8 @@ o3djs.effect.buildStandardShaderString = function(material,
' lightColor *' +
' (ambient * diffuse + diffuse * litR.y)).rgb,\n' +
' diffuse.a)') +
- p.entryPoints();
+ p.entryPoints() +
+ p.matrixLoadOrder();
};
/**
@@ -990,7 +997,8 @@ o3djs.effect.buildStandardShaderString = function(material,
' + specular * litR.z *' +
' specularFactor)).rgb,\n' +
' diffuse.a)') +
- p.entryPoints();
+ p.entryPoints() +
+ p.matrixLoadOrder();
};
/**
@@ -1045,7 +1053,8 @@ o3djs.effect.buildStandardShaderString = function(material,
' + specular * litR.z *' +
' specularFactor)).rgb,\n' +
' diffuse.a)') +
- p.entryPoints();
+ p.entryPoints() +
+ p.matrixLoadOrder();
};
/**