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

Instancing reset #7230

Merged
merged 5 commits into from
Sep 24, 2015
Merged

Instancing reset #7230

merged 5 commits into from
Sep 24, 2015

Conversation

benaadams
Copy link
Contributor

No description provided.

@benaadams
Copy link
Contributor Author

Gah; that was poor. Yes should be =

@benaadams
Copy link
Contributor Author

The bane of premature optimization...

@mrdoob
Copy link
Owner

mrdoob commented Sep 24, 2015

I think I would separate it though...

state.enableAttribute( programAttribute );
state.setAttributeDivisor( programAttribute, data.meshPerAttribute, extension );

@benaadams
Copy link
Contributor Author

Issue is enableAttribute wouldn't have the info; so would need to reset to 0 for every attribute as per #7225; or every enableAttribute would need to be always later followed by a setAttributeDivisor call including renderBufferImmediate, LensFlarePlugin and SpritePlugin

@benaadams
Copy link
Contributor Author

Could maybe make a state.enableAttribute and state.enableAttributeWithDivisor (better name); that have differing param counts?

@mrdoob
Copy link
Owner

mrdoob commented Sep 24, 2015

Could maybe make a state.enableAttribute and state.enableAttributeWithDivisor (better name); that have differing param counts?

That sounds good!

@benaadams
Copy link
Contributor Author

Something more like that? (not tested)

@emnh
Copy link

emnh commented Sep 24, 2015

Tested. Works.

@benaadams
Copy link
Contributor Author

:shipit:

Is it an issue this is wrong in v72? Want a PR to master?

@mrdoob
Copy link
Owner

mrdoob commented Sep 24, 2015

I think it's fine... r72 already had quite a bit of post-release fixes...

@benaadams
Copy link
Contributor Author

OK, will leave master. Will likely cause a huge number of future merge conflicts if I tried - don't want you cursing me come r73 😜

@mrdoob
Copy link
Owner

mrdoob commented Sep 24, 2015

I still consider all this stuff experimental and unstable API so it's kind of expected 😊

@benaadams
Copy link
Contributor Author

As an aside: using instancing for 1x1 plane billboards will be likely slower than 4x duplication (position alone) as the gpu needs needs to process more data in the shader (position + offset); with larger models then instancing becomes more suitable as the CPU->GPU bandwidth becomes the bottleneck rather than the shader. I think the tradeoff starts happening around 100 vertices per model - though the api for updating is simpler for instancing - but that can be hidden by library.

mrdoob added a commit that referenced this pull request Sep 24, 2015
@mrdoob mrdoob merged commit e9bd4a1 into mrdoob:dev Sep 24, 2015
@mrdoob
Copy link
Owner

mrdoob commented Sep 24, 2015

Thanks guys!

@benaadams benaadams deleted the instancing-reset branch September 24, 2015 20: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.

3 participants