Changeset 19820


Ignore:
Timestamp:
11/25/15 16:48:36 (9 years ago)
Author:
dlcheng
Message:

CHG: Removing js multiline string usage for compatibility.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/webgl.js

    r19808 r19820  
    139139        shaders = {};
    140140        shaders[shaderName] = {loaded:false, vsh:{}, fsh:{}};
    141         shaders["colored"]["vsh"]["string"] = `
    142                 attribute vec3 aVertexPosition;
    143                 attribute vec4 aVertexColor;
    144 
    145                 uniform mat4 uMVPMatrix;
    146                 uniform float uAlpha;
    147 
    148                 varying vec4 vColor;
    149 
    150                 void main(void) {
    151                         gl_Position = uMVPMatrix * vec4(aVertexPosition.xyz, 1.0);
    152                         vColor = vec4(aVertexColor.xyz, uAlpha);
    153                 }
    154         `;
    155         shaders["colored"]["fsh"]["string"] = `
    156                 precision mediump float;
    157 
    158                 varying vec4 vColor;
    159 
    160                 void main(void) {
    161                         gl_FragColor = vColor;
    162                 }
    163         `;
     141        shaders["colored"]["vsh"]["string"] =
     142                ['attribute vec3 aVertexPosition;',
     143                'attribute vec4 aVertexColor;',
     144                '',
     145                'uniform mat4 uMVPMatrix;',
     146                'uniform float uAlpha;',
     147                '',
     148                'varying vec4 vColor;',
     149                '',
     150                'void main(void) {',
     151                '       gl_Position = uMVPMatrix * vec4(aVertexPosition.xyz, 1.0);',
     152                '       vColor = vec4(aVertexColor.xyz, uAlpha);',
     153                '}'].join('\n');
     154        shaders["colored"]["fsh"]["string"] =
     155                ['precision mediump float;',
     156                '',
     157                'varying vec4 vColor;',
     158                '',
     159                'void main(void) {',
     160                '       gl_FragColor = vColor;',
     161                '}'].join('\n');
    164162
    165163        shaders[shaderName]["vsh"]["shader"] = getShaderByString(gl, shaders[shaderName]["vsh"]["string"], "vsh");
Note: See TracChangeset for help on using the changeset viewer.