Skip to content

Conversation

@msub2
Copy link
Contributor

@msub2 msub2 commented Mar 4, 2022

  • Line and stamp brushes now use indexed BufferGeometries to replace the TriangleStrip drawMode that was being used before.
  • Cube/Sphere/Rainbow brushes are now properly added to the a-drawing entity and behave properly by disappearing when the user undoes a stroke made with one.
  • Made small adjustments to address three.js API updates over the years
  • Adjusts BufferAttribute updateRanges to only update as much as has been drawn (as in Performance: sharedbuffergeometry update ranges #249). This results in visibly better performance while drawing.

msub2 and others added 8 commits March 4, 2022 17:30
This removes the remaining references to TriangleStripDrawMode.
In its place is a vertex index buffer that seems to be working.
Still currently an issue with strokes made after an undo action.
Undoing a stroke and then drawing again would cause it to read old data.
Now vertex/index buffers are cleared back to the prevIdx on undo/clear.
For whatever reason they still aren't rendering though.
This modifies the way indices are sent to the index buffer.
If the brush is strip-based, we know verts are being sent 2 at a time.
If it's stamp based, we know verts are being sent 3 at a time.
SharedBufferGeometry now has a strip flag and sets indices accordingly.
These brushes were not being added to the a-drawing entity.
They were also missing an undo function, which is now implemented.
Rainbow brush was adjusted to use indexed BufferGeometry.
Increased index buffer size for sharedbuffergeometry.
flatShading: true
});
this.geometry = new THREE.BoxGeometry(1, 1, 1);
this.drawing = document.querySelector('.a-drawing');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.drawingEl for style consistency

this.object3D.add(this.mesh);
this.mesh.visible = false
this.mesh.visible = false;
this.drawing = document.querySelector('.a-drawing');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.drawingEl

flatShading: true
});
this.geometry = new THREE.IcosahedronGeometry(1, 0);
this.drawing = document.querySelector('.a-drawing');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.drawingEl

@dmarcos
Copy link
Member

dmarcos commented Mar 8, 2022

Super appreciated!

@dmarcos dmarcos merged commit 0de00fb into aframevr:master Mar 8, 2022
@msub2 msub2 deleted the patch-5 branch March 10, 2022 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants