Sha256: 93cd7c12e1323e171d0acfc25387c7ad4157a6e9d332aa41ca961ecc14c46de7
Contents?: true
Size: 737 Bytes
Versions: 25
Compression:
Stored size: 737 Bytes
Contents
shared attribute vec4 VERTEX_POSITION; shared uniform mat4 mvMatrix, pMatrix; void main(void) { gl_Position = pMatrix * mvMatrix * VERTEX_POSITION; /* Note that the agorithm here must be followed exactly on the JS side in order to reconstitute the index when it is read. This supports 65,535 objects. If more are needed, we could feasibly open up the alpha channel, as long as blending is disabled. Need to do more tests on this first, however. */ // equivalent to [ int(INDEX/256), INDEX % 256 ] / 255. The last division // is necessary to scale to the [0..1] range. float d = 1.0 / 255.0; float f = floor(INDEX / 256.0); vColor = vec4(f * d, (INDEX - 256.0 * f) * d, 1.0, 1.0); }
Version data entries
25 entries across 25 versions & 1 rubygems