Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Falling snow brush #172

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Falling snow brush #172

wants to merge 11 commits into from

Conversation

msfeldstein
Copy link
Contributor

The holidays are almost here, and i've lived in california so long i've forgotten that there's supposed to be snow!

I've implemented a falling snow brush, that uses a point-sprite cloud, and vertex shaders to make them fall nicely.

I also added a binary=true flag for the loading of a demo.apa file which seems to have broken

this.geometry.attributes.position.needsUpdate = true;
this.geometry.attributes.linePosition.needsUpdate = true;

this.geometry.setDrawRange(0, this.data.numPoints * this.subdivisions);
Copy link
Member

Choose a reason for hiding this comment

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

what does subdivisions means? I believe it should be ' * FLAKES_PER_POINT` isn't it?

@msfeldstein
Copy link
Contributor Author

good catch, i didn't notice the thousands of flakes drawing at exactly 0,0,0. Updated.

@fernandojsg
Copy link
Member

  • Could you make it that the snow start falling at the painting position? Right now if you press at some point, many particles appears at the same time over and under the position, it could be great if they just start at the controller's position and they start falling down from there.
  • Even if it's snow, it could be nice if it uses the selected color instead of just white.
  • Adjust the min/max size of the particles as right now if you select the minimum brush size the particle is almost invisible.
    /cc @feiss what do you think ^ ?

@msfeldstein
Copy link
Contributor Author

Ok updated all three

  • Originally had made the snow start at random locations since i thought it would be weird to have the flakes all distribute in such a uniform place, but its actually cool to draw them that way then have them disperse to random locations after 2 or 3 cycles
  • Added color selection
  • Capped the minimum flake size at 5 which seems to be mostly visible. I didn't bump the max size as it just looks weird too big.

@fernandojsg
Copy link
Member

thanks!, @feiss @dmarcos could you take a look at it as I won't be able to test it on a vive for a week

@feiss
Copy link
Member

feiss commented Dec 28, 2016

Nice addition! I would animate the rotation and add some scale variation to the flakes, but it is nice as it is too :)

I tested the last commit, and everything looks fine, but:

  • Date.now() is not recommended, you have timestamp in addPoint() and timeOffset in tick(). Date.now() adds unnecessary overhead and asynchrony.

  • If you start painting and keep the trigger pressed, you can see that the flakes are not always spawning at the pointerPosition, but they start appearing in lower and lower positions.

Merry Christmas!

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.

None yet

3 participants