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

GPGPU birds example with GLTF loader and MeshStandardMaterial #19318

Merged
merged 6 commits into from
May 12, 2020

Conversation

santi-grau
Copy link
Contributor

  • Extending the GPGPU birds demo so that it can load any GLTF model/animation and use MeshStandardMaterial to shade.
  • GLTF vertices are baked onto a texture. One frame per row
  • Texture is passed to the vertex shader along with a frame reference.
  • MeshStandardMaterial is applied

Demo here :
https://uber-gpgpu-demo.glitch.me

  • On demo, a new geo is loaded randomly, may be confusing...

This is my first PR ever. Not sure if this is even helpful or correctly done but would like to learn the process to contribute to three in the future.

Copy link
Collaborator

@looeee looeee left a comment

Choose a reason for hiding this comment

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

When I reloaded and saw the flocking horses: 🤯 😍

This is really cool, great work.


var token = '#define STANDARD';
var insert = 'attribute vec4 reference;';
insert += 'attribute vec4 seeds;';
Copy link
Collaborator

Choose a reason for hiding this comment

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

This section would be nicer written as a template string. @Mugen87 do we allow these in examples yet?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, I think we can use template strings in examples. They're using modules anyway.

Copy link
Collaborator

@looeee looeee May 9, 2020

Choose a reason for hiding this comment

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

@santi-grau can you change this to use template strings?

var insert = /* glsl */`
    attribute vec4 reference;
    attribute vec4 seeds;
    attribute vec3 birdColor;
    uniform sampler2D texturePosition;
    ...  
    `;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! will look into all this during the weekend :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Put all the 'replacement' strings into a template string. Hope this is what you meant. :S

examples/webgl_gpgpu_birds.html Outdated Show resolved Hide resolved
examples/webgl_lights_hemisphere.html Outdated Show resolved Hide resolved
@mrdoob
Copy link
Owner

mrdoob commented May 8, 2020

Santiii! Mola!! 🤩

@mrdoob mrdoob added this to the r117 milestone May 8, 2020
@looeee
Copy link
Collaborator

looeee commented May 9, 2020

Live example using githack.

@mrdoob mrdoob merged commit 89438bb into mrdoob:dev May 12, 2020
@mrdoob
Copy link
Owner

mrdoob commented May 12, 2020

Thanks!

@munrocket
Copy link
Contributor

munrocket commented May 12, 2020

Okay, mrdoob just merged the commit without screenshot. Prepare to bugs in a repo.

@santi-grau
Copy link
Contributor Author

Sorry guys, I'm really new to collaborating on github, I normally work on small stuff on my own. Is there anything I can do to help?

@munrocket
Copy link
Contributor

We are new too, the problem that reviewers don’t care. That’s all :D

@mrdoob
Copy link
Owner

mrdoob commented May 12, 2020

@santi-grau Don't worry! I'll take care of it 👌

@Mugen87
Copy link
Collaborator

Mugen87 commented May 12, 2020

@mrdoob I've added the screenshot with 0af67e4 so #19341 has a clean build.

@mrdoob
Copy link
Owner

mrdoob commented May 12, 2020

@Mugen87 Thanks!

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.

5 participants