| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 | 610 |
| 611 | 611 |
| 612 /** | 612 /** |
| 613 * Builds vertex and fragment shader string for a 2-color checker effect. | 613 * Builds vertex and fragment shader string for a 2-color checker effect. |
| 614 * @return {string} The effect code for the shader, ready to be parsed. | 614 * @return {string} The effect code for the shader, ready to be parsed. |
| 615 */ | 615 */ |
| 616 o3djs.effect.buildCheckerShaderString = function() { | 616 o3djs.effect.buildCheckerShaderString = function() { |
| 617 var p = o3djs.effect; | 617 var p = o3djs.effect; |
| 618 var varyingDecls = p.BEGIN_OUT_STRUCT + | 618 var varyingDecls = p.BEGIN_OUT_STRUCT + |
| 619 p.VARYING + p.FLOAT4 + ' ' + | 619 p.VARYING + p.FLOAT4 + ' ' + |
| 620 p.VERTEX_VARYING_PREFIX + 'position' + | 620 p.VARYING_DECLARATION_PREFIX + 'position' + |
| 621 p.semanticSuffix('POSITION') + ';\n' + | 621 p.semanticSuffix('POSITION') + ';\n' + |
| 622 p.VARYING + p.FLOAT2 + ' ' + | 622 p.VARYING + p.FLOAT2 + ' ' + |
| 623 p.VERTEX_VARYING_PREFIX + 'texCoord' + | 623 p.VARYING_DECLARATION_PREFIX + 'texCoord' + |
| 624 p.semanticSuffix('TEXCOORD0') + ';\n' + | 624 p.semanticSuffix('TEXCOORD0') + ';\n' + |
| 625 p.VARYING + p.FLOAT3 + ' ' + | 625 p.VARYING + p.FLOAT3 + ' ' + |
| 626 p.VERTEX_VARYING_PREFIX + 'normal' + | 626 p.VARYING_DECLARATION_PREFIX + 'normal' + |
| 627 p.semanticSuffix('TEXCOORD1') + ';\n' + | 627 p.semanticSuffix('TEXCOORD1') + ';\n' + |
| 628 p.VARYING + p.FLOAT3 + ' ' + | 628 p.VARYING + p.FLOAT3 + ' ' + |
| 629 p.VERTEX_VARYING_PREFIX + 'worldPosition' + | 629 p.VARYING_DECLARATION_PREFIX + 'worldPosition' + |
| 630 p.semanticSuffix('TEXCOORD2') + ';\n' + | 630 p.semanticSuffix('TEXCOORD2') + ';\n' + |
| 631 p.END_STRUCT; | 631 p.END_STRUCT; |
| 632 | 632 |
| 633 return 'uniform ' + p.MATRIX4 + ' worldViewProjection' + | 633 return 'uniform ' + p.MATRIX4 + ' worldViewProjection' + |
| 634 p.semanticSuffix('WORLDVIEWPROJECTION') + ';\n' + | 634 p.semanticSuffix('WORLDVIEWPROJECTION') + ';\n' + |
| 635 'uniform ' + p.MATRIX4 + ' worldInverseTranspose' + | 635 'uniform ' + p.MATRIX4 + ' worldInverseTranspose' + |
| 636 p.semanticSuffix('WORLDINVERSETRANSPOSE') + ';\n' + | 636 p.semanticSuffix('WORLDINVERSETRANSPOSE') + ';\n' + |
| 637 'uniform ' + p.MATRIX4 + ' world' + | 637 'uniform ' + p.MATRIX4 + ' world' + |
| 638 p.semanticSuffix('WORLD') + ';\n' + | 638 p.semanticSuffix('WORLD') + ';\n' + |
| 639 '\n' + | 639 '\n' + |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 effect.name = o3djs.effect.TWO_COLOR_CHECKER_EFFECT_NAME; | 1374 effect.name = o3djs.effect.TWO_COLOR_CHECKER_EFFECT_NAME; |
| 1375 return effect; | 1375 return effect; |
| 1376 }; | 1376 }; |
| 1377 | 1377 |
| 1378 | 1378 |
| 1379 // For compatability with o3d code, the default language is o3d shading | 1379 // For compatability with o3d code, the default language is o3d shading |
| 1380 // language. | 1380 // language. |
| 1381 o3djs.effect.setLanguage('o3d'); | 1381 o3djs.effect.setLanguage('o3d'); |
| 1382 | 1382 |
| 1383 | 1383 |
| OLD | NEW |