Skip to content

Commit

Permalink
Merge pull request #20438 from linbingquan/dev-tag-glsl
Browse files Browse the repository at this point in the history
Examples: add glsl tag.
  • Loading branch information
mrdoob authored Oct 1, 2020
2 parents 9ef27d1 + 04b4cdd commit 0b9c0f3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/webgl2_volume_cloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

// Material

const vertexShader = `
const vertexShader = /* glsl */`
in vec3 position;
uniform mat4 modelMatrix;
Expand All @@ -121,7 +121,7 @@
}
`;

const fragmentShader = `
const fragmentShader = /* glsl */`
precision highp float;
precision highp sampler3D;
Expand Down
4 changes: 2 additions & 2 deletions examples/webgl2_volume_instancing.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

// Material

const vertexShader = `
const vertexShader = /* glsl */`
in vec3 position;
in mat4 instanceMatrix;
Expand All @@ -72,7 +72,7 @@
}
`;

const fragmentShader = `
const fragmentShader = /* glsl */`
precision highp float;
precision highp sampler3D;
Expand Down
4 changes: 2 additions & 2 deletions examples/webgl2_volume_perlin.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

// Material

const vertexShader = `
const vertexShader = /* glsl */`
in vec3 position;
uniform mat4 modelMatrix;
Expand All @@ -102,7 +102,7 @@
}
`;

const fragmentShader = `
const fragmentShader = /* glsl */`
precision highp float;
precision highp sampler3D;
Expand Down
3 changes: 2 additions & 1 deletion examples/webgl_shadow_contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
depthMaterial.onBeforeCompile = function ( shader ) {

shader.uniforms.darkness = depthMaterial.userData.darkness;
shader.fragmentShader = `
shader.fragmentShader = /* glsl */`
uniform float darkness;
${shader.fragmentShader.replace(
'gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );',
Expand All @@ -160,6 +160,7 @@
`;

};

depthMaterial.depthTest = false;
depthMaterial.depthWrite = false;

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_compute.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
pointerGroup
];

const computeShader = `#version 450
const computeShader = /* glsl */`#version 450
#define PARTICLE_NUM ${particleNum}
#define PARTICLE_SIZE ${particleSize}
#define ROOM_SIZE 1.0
Expand Down

0 comments on commit 0b9c0f3

Please sign in to comment.