summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3djs/effect.js
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/samples/o3djs/effect.js')
-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();
};
/**