-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: go back to WebGL1 with guarrenteed extensions. :(
- Loading branch information
Showing
67 changed files
with
182 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
precision highp float; | ||
|
||
in vec3 v_color; | ||
|
||
out vec4 fragColor; | ||
varying vec3 v_color; | ||
|
||
void main() { | ||
|
||
fragColor = vec4(v_color, 1.0); | ||
gl_FragColor = vec4(v_color, 1.0); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
in vec2 position; | ||
attribute vec2 position; | ||
|
||
uniform float scale; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
precision highp float; | ||
|
||
in vec2 v_texCoord; | ||
varying vec2 v_texCoord; | ||
|
||
uniform sampler2D map; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() { | ||
|
||
fragColor = texture(map, v_texCoord); | ||
gl_FragColor = texture2D(map, v_texCoord); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
precision highp float; | ||
|
||
in vec3 v_viewPosition; | ||
in vec3 v_viewNormal; | ||
in vec2 v_uv; | ||
varying vec3 v_viewPosition; | ||
varying vec3 v_viewNormal; | ||
varying vec2 v_uv; | ||
|
||
uniform sampler2D map; | ||
uniform vec3 viewLightPosition; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() { | ||
|
||
vec3 albedo = texture(map, v_uv).xyz; | ||
vec3 albedo = texture2D(map, v_uv).xyz; | ||
vec3 directionToLight = normalize( viewLightPosition - v_viewPosition ); | ||
float lambertianIntensity = dot( directionToLight, v_viewNormal ); | ||
|
||
fragColor = vec4( albedo * lambertianIntensity, 1.0 ); | ||
gl_FragColor = vec4( albedo * lambertianIntensity, 1.0 ); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
src/examples/gettingstarted/5_reflectivePolyhedral/fragment.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
precision highp float; | ||
|
||
in vec3 v_viewPosition; | ||
in vec3 v_viewNormal; | ||
varying vec3 v_viewPosition; | ||
varying vec3 v_viewNormal; | ||
|
||
uniform samplerCube cubeMap; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() { | ||
|
||
vec3 reflectDir = reflect( normalize( v_viewPosition ),normalize(v_viewNormal) ); | ||
fragColor = texture(cubeMap, reflectDir); | ||
gl_FragColor = textureCube(cubeMap, reflectDir); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/examples/gettingstarted/5_reflectivePolyhedral/vertex.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
src/examples/gettingstarted/6_interleavedBuffers/fragment.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
precision highp float; | ||
|
||
in vec3 v_color; | ||
|
||
out vec4 fragColor; | ||
varying vec3 v_color; | ||
|
||
void main() { | ||
|
||
fragColor = vec4(v_color, 1.0); | ||
gl_FragColor = vec4(v_color, 1.0); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
src/examples/gettingstarted/7_metallicRoughness/fragment.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
precision highp float; | ||
|
||
in vec3 v_viewPosition; | ||
in vec3 v_viewNormal; | ||
varying vec3 v_viewPosition; | ||
varying vec3 v_viewNormal; | ||
|
||
uniform samplerCube cubeMap; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() { | ||
|
||
vec3 reflectDir = reflect( normalize( v_viewPosition ),normalize(v_viewNormal) ); | ||
fragColor = texture(cubeMap, reflectDir); | ||
gl_FragColor = textureCube(cubeMap, reflectDir); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.