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

Fixes extreme slowness of Geometry.rayIntersection. #72

Merged
merged 1 commit into from Dec 11, 2013

Conversation

ChrisDenham
Copy link
Contributor

You are all going to love this pull request!

It fixes an extreme inefficiency in 'Geometry.rayIntersection' caused by using the 'indices' property rather than the '_indices' member. This was making three copies of the entire index array for EVERY triangle.

Ray intersections with complex models is now actually usable.

Enjoy!

Chris.

You are all going to love this pull request!

It fixes an extreme inefficiency in 'Geometry.rayIntersection' caused by using the 'indices' property rather than the '_indices' member. This was making three copies of the entire index array for EVERY triangle.

Ray intersections with complex models is now actually usable.

Enjoy!

Chris.
@makc
Copy link
Contributor

makc commented Dec 11, 2013

ouch

https://github.com/ChrisDenham/Alternativa3D/blob/5b16652f83d8c8f8da394ece5a27671dfad0fe4c/src/alternativa/engine3d/resources/Geometry.as#L109

and here I thought that positionBuffer.readFloat()-s were the problem :) 👍

gonchar pushed a commit that referenced this pull request Dec 11, 2013
Fixes extreme slowness of Geometry.rayIntersection.
@gonchar gonchar merged commit 9b22f9d into AlternativaPlatform:master Dec 11, 2013
@gonchar
Copy link
Contributor

gonchar commented Dec 11, 2013

thank you! really helpful

@ChrisDenham
Copy link
Contributor Author

Yeah, me too. I was beginning to think about implementing a mechanism to retain/cache a copy of Vector array so readFloat didn't need to bother converting 4 byte floats to 8 byte 'Number'/double every time. Then I thought..... hey hold on a minute.... surely that's not soooo bad, there's a single microprocessor instruction to convert float to double!

@makc
Copy link
Contributor

makc commented Dec 11, 2013

@ChrisDenham there is whole branch with this mechanism

@ChrisDenham
Copy link
Contributor Author

@makc Thanks. I had a vague recollection of you mentioning something about this before in relation to ray intersection, but couldn't find the reference. Interesting to note that that 'VectorGeometry' branch would 'proportionally' benefit even more from this pull request than the 'master' branch.

@makc
Copy link
Contributor

makc commented Dec 11, 2013

...it is almost 200 commits behind the master. not going to happen :)

@gonchar
Copy link
Contributor

gonchar commented Dec 11, 2013

also my pull request is about vector geometry :) #59

@ChrisDenham ChrisDenham deleted the patch-9 branch April 24, 2015 12:42
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