Skip to content

Commit

Permalink
Updated to use medium-precision in shaders (works better on mobile ha…
Browse files Browse the repository at this point in the history
…rdware) and removed now-unnecessary #ifdefs.
  • Loading branch information
unknown committed Dec 1, 2011
1 parent f04b91b commit 35a02ac
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 73 deletions.
4 changes: 1 addition & 3 deletions example01/index.html
Expand Up @@ -5,9 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vPosition;

Expand Down
8 changes: 2 additions & 6 deletions example02/index.html
Expand Up @@ -9,9 +9,7 @@


<script id="color-shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec4 vColor;

Expand Down Expand Up @@ -40,9 +38,7 @@


<script id="mandelbrot-shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vPlotPosition;
varying vec4 vColor;
Expand Down
4 changes: 1 addition & 3 deletions example03/particles-01-noenable.html
Expand Up @@ -6,9 +6,7 @@


<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

uniform vec4 uColor;

Expand Down
4 changes: 1 addition & 3 deletions example03/particles-01.html
Expand Up @@ -6,9 +6,7 @@


<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

uniform vec4 uColor;

Expand Down
4 changes: 1 addition & 3 deletions example03/particles-02.html
Expand Up @@ -6,9 +6,7 @@


<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

uniform vec4 uColor;

Expand Down
4 changes: 1 addition & 3 deletions example03/particles-03.html
Expand Up @@ -6,9 +6,7 @@


<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

uniform vec4 uColor;

Expand Down
4 changes: 1 addition & 3 deletions lesson01/index.html
Expand Up @@ -7,9 +7,7 @@
<script type="text/javascript" src="glMatrix-0.9.5.min.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

void main(void) {
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
Expand Down
4 changes: 1 addition & 3 deletions lesson02/index.html
Expand Up @@ -7,9 +7,7 @@
<script type="text/javascript" src="glMatrix-0.9.5.min.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec4 vColor;

Expand Down
4 changes: 1 addition & 3 deletions lesson03/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec4 vColor;

Expand Down
4 changes: 1 addition & 3 deletions lesson04/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec4 vColor;

Expand Down
4 changes: 1 addition & 3 deletions lesson05/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;

Expand Down
4 changes: 1 addition & 3 deletions lesson06/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;

Expand Down
4 changes: 1 addition & 3 deletions lesson07/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
Expand Down
4 changes: 1 addition & 3 deletions lesson08/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
Expand Down
4 changes: 1 addition & 3 deletions lesson09/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;

Expand Down
4 changes: 1 addition & 3 deletions lesson10/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;

Expand Down
4 changes: 1 addition & 3 deletions lesson11/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
Expand Down
4 changes: 1 addition & 3 deletions lesson12/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
Expand Down
8 changes: 2 additions & 6 deletions lesson13/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="per-vertex-lighting-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
Expand Down Expand Up @@ -68,9 +66,7 @@


<script id="per-fragment-lighting-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;
varying vec3 vTransformedNormal;
Expand Down
4 changes: 1 addition & 3 deletions lesson14/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="per-fragment-lighting-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;
varying vec3 vTransformedNormal;
Expand Down
4 changes: 1 addition & 3 deletions lesson15/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="per-fragment-lighting-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;
varying vec3 vTransformedNormal;
Expand Down
6 changes: 2 additions & 4 deletions lesson16/index.html
Expand Up @@ -8,9 +8,7 @@
<script type="text/javascript" src="webgl-utils.js"></script>

<script id="per-fragment-lighting-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;

varying vec2 vTextureCoord;
varying vec3 vTransformedNormal;
Expand Down Expand Up @@ -816,7 +814,7 @@
Moon texture courtesy of <a href="http://maps.jpl.nasa.gov/">the Jet Propulsion Laboratory</a>.
<br/>
<br/>

<a href="http://learningwebgl.com/blog/?p=1786">&lt;&lt; Back to Lesson 16</a><br />
</body>

Expand Down

0 comments on commit 35a02ac

Please sign in to comment.