summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3djs
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/samples/o3djs')
-rw-r--r--o3d/samples/o3djs/effect.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/o3d/samples/o3djs/effect.js b/o3d/samples/o3djs/effect.js
index 469d4e4..d9d22c4 100644
--- a/o3d/samples/o3djs/effect.js
+++ b/o3d/samples/o3djs/effect.js
@@ -620,15 +620,17 @@ o3djs.effect.buildStandardShaderString = function(material,
*/
var buildVertexDecls = function(material, diffuse, specular) {
var str = 'struct InVertex {\n' +
- ' float4 position : POSITION;\n' +
- ' float3 normal : NORMAL;\n' +
- buildTexCoords(material) +
- buildBumpInputCoords() +
- '};\n' +
- 'struct OutVertex {\n' +
- ' float4 position : POSITION;\n' +
- buildTexCoords(material) +
- buildBumpOutputCoords();
+ ' float4 position : POSITION;\n';
+ if (diffuse || specular) {
+ str += ' float3 normal : NORMAL;\n';
+ }
+ str += buildTexCoords(material) +
+ buildBumpInputCoords() +
+ '};\n' +
+ 'struct OutVertex {\n' +
+ ' float4 position : POSITION;\n' +
+ buildTexCoords(material) +
+ buildBumpOutputCoords();
if (diffuse || specular) {
str += ' float3 normal : TEXCOORD' + interpolant++ + ';\n' +
' float3 surfaceToLight: TEXCOORD' + interpolant++ + ';\n';