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

bug fix: clear angle divisor for all geometries if instancing is used. #7225

Closed
wants to merge 3 commits into from
Closed

Conversation

emnh
Copy link

@emnh emnh commented Sep 23, 2015

This fixes the issue I mentioned in #5171 : when angle instancing is used together with regular geometries, there are strange problems, for example objects that do not render or textures are uniformly coloured by one of its pixel values.

I am not sure if this is the best way to fix it, but at least it works for now.

@mrdoob
Copy link
Owner

mrdoob commented Sep 23, 2015

/ping @benaadams

@benaadams
Copy link
Contributor

Definately bug here; but the divisor reset should probably go in WebGLState, probably enableAttribute should take note of the divisor if set; and then reset back to 0 if not specified and changed > 0?

@emnh
Copy link
Author

emnh commented Sep 24, 2015

@benaadams I tried to do what you said in the 2nd commit.

Note: If I set state.usedInstancedBufferCount to 0 again after resetting then it did not work.


var extension = extensions.get( 'ANGLE_instanced_arrays' );

if ( extension != null ) {
Copy link
Owner

Choose a reason for hiding this comment

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

I suspect we don't need this check. We can assume it's available if usedInstancedBufferCount is not 0...?

Copy link
Author

Choose a reason for hiding this comment

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

Ok. Fixed.

@benaadams
Copy link
Contributor

Does extensions.get and extensions.vertexAttribDivisorANGLE for every attribute in the scene once instancing is used; and twice for the instanced attribute.

This does fix the issue but should be able to cut down the gpu comms a little more; having a look into it.

@benaadams
Copy link
Contributor

This work better? #7230

@emnh
Copy link
Author

emnh commented Sep 24, 2015

@benaadams Unfortunately your patch #7230 shows the same problem as without it..

@emnh
Copy link
Author

emnh commented Sep 24, 2015

Oh wait, I might have checked out the wrong branch.. just a sec

@emnh
Copy link
Author

emnh commented Sep 24, 2015

@benaadams It works now :)

@benaadams benaadams mentioned this pull request Sep 24, 2015
@mrdoob
Copy link
Owner

mrdoob commented Sep 24, 2015

#7230

@mrdoob mrdoob closed this Sep 24, 2015
@emnh emnh deleted the dev branch September 24, 2015 19:48
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