Skip to content

Commit

Permalink
made it so that the updated example shader compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomGamingDev committed Aug 17, 2023
1 parent 371e1fe commit cf20cd6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/shape/vertex.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,15 +634,15 @@ p5.prototype.endContour = function() {
* precision mediump float;
*
* in vec3 aPosition;
* out int instanceId;
* flat out int instanceID;
*
* uniform mat4 uModelViewMatrix;
* uniform mat4 uProjectionMatrix;
*
* void main() {
*
* // copy the instance ID to the fragment shader
* instanceId = gl_InstanceID;
* instanceID = gl_InstanceID;
* vec4 positionVec4 = vec4(aPosition, 1.0);
*
* // gl_InstanceID represents a numeric value for each instance
Expand All @@ -660,15 +660,15 @@ p5.prototype.endContour = function() {
* precision mediump float;
*
* out vec4 outColor;
* in int instanceID;
* flat in int instanceID;
* uniform float numInstances;
*
* void main() {
* vec4 red = vec4(1.0, 0.0, 0.0, 1.0);
* vec4 blue = vec4(0.0, 0.0, 1.0, 1.0);
*
* // Normalize the instance id
* float normId = float(instanceID) / (numInstances - 1.0);
* float normId = float(instanceID) / numInstances;
*
* // Mix between two colors using the normalized instance id
* outColor = mix(red, blue, normId);
Expand Down

0 comments on commit cf20cd6

Please sign in to comment.