mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-17 05:49:30 -07:00
Added some documentation, cleaned up some code, fleshed out the remaining work to make the project a little easier for newcomers to approach
This commit is contained in:
@@ -26,6 +26,7 @@ void main() {
|
||||
vUV = (aPosition + aCorner) * quadSize;
|
||||
vGlyph = texture2D(lastState, aPosition * quadSize);
|
||||
|
||||
// Calculate the world space position
|
||||
float quadDepth = 0.0;
|
||||
if (volumetric && !showComputationTexture) {
|
||||
quadDepth = fract(vGlyph.b + time * animationSpeed * forwardSpeed);
|
||||
@@ -34,16 +35,17 @@ void main() {
|
||||
vec2 position = (aPosition + aCorner * vec2(density, 1.)) * quadSize;
|
||||
vec4 pos = vec4((position - 0.5) * 2.0, quadDepth, 1.0);
|
||||
|
||||
// "Resurrected" columns are in the green channel,
|
||||
// and are vertically flipped (along with their glyphs)
|
||||
vChannel = vec3(1.0, 0.0, 0.0);
|
||||
if (volumetric && rand(vec2(aPosition.x, 0)) < resurrectingCodeRatio) {
|
||||
pos.y = -pos.y;
|
||||
vChannel = vec3(0.0, 1.0, 0.0);
|
||||
}
|
||||
|
||||
// Convert the world space position to screen space
|
||||
if (volumetric) {
|
||||
if (rand(vec2(aPosition.x, 0)) < resurrectingCodeRatio) {
|
||||
pos.y = -pos.y;
|
||||
vChannel = vec3(0.0, 1.0, 0.0);
|
||||
}
|
||||
|
||||
pos.x /= glyphHeightToWidth;
|
||||
|
||||
pos = camera * transform * pos;
|
||||
} else {
|
||||
pos.xy *= screenSize;
|
||||
|
||||
Reference in New Issue
Block a user