Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set up the vertex index thing, although it doesn't work yet
- Loading branch information
1 parent
89d63f5
commit 73c557a
Showing
14 changed files
with
398 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,9 +1,5 @@ | ||
// | ||
// Simple passthrough fragment shader | ||
// | ||
uniform vec4 Colour; | ||
|
||
void main() | ||
{ | ||
void main() { | ||
gl_FragColor = Colour; | ||
} | ||
} |
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,9 +1,5 @@ | ||
// | ||
// Simple passthrough vertex shader | ||
// | ||
attribute vec3 in_Position; // (x,y,z) | ||
|
||
void main() | ||
{ | ||
void main() { | ||
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
varying vec4 v_vColour; | ||
|
||
void main() { | ||
gl_FragColor = v_vColour; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// super secret secret: none of these are actually used except for color, it's | ||
// mostly just all here so that the default vertex format can be used (and even | ||
// then, color isn't actually used to store color data). | ||
attribute vec3 in_Position; | ||
attribute vec3 in_Normal; | ||
attribute vec4 in_Colour; | ||
attribute vec2 in_TextureCoord; | ||
|
||
varying vec4 v_vColour; | ||
|
||
uniform vec4 actual_color; | ||
uniform vec3 offsets[8]; | ||
|
||
void main() { | ||
// this is (r | (g << 1) | (b << 2)) except you can't actually do those operations | ||
// in OpenGL ES apparently, so i'm settling for the next best thing | ||
int index = int(floor(in_Colour.r / 255.)) + int(floor(in_Colour.g / 255.)) * 2 + int(floor(in_Colour.b / 255.)) * 4; | ||
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(offsets[index], 1.); | ||
|
||
v_vColour = actual_color; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.