Jump to content
JJ FX

Point vs Primitive wrangle

Recommended Posts

Hi guys, 

So recently I've been doing some really heavy math within wrangles. And I was disappointed when I checked the performances between a point a prim wrangle. They both have same calculation times. Usually my code goes like:

int points[] = primpoints(0, @primnum)

for (int i=1; i<len(points); i++) {
	// Do more stuff here
		// And even more for loops here
}

So if this is run in prim wrangle the calculations run per prim (because its a wrangle), and then per point (because of the loop).

Switching to point wrangle it should be like (pseudocode):

foreach point (because its a point wrangle) {
	int points[] = primpoints(0, @primnum)

	for (int i=1; i<len(points); i++) {
		// Do more stuff here
			// And even more for loops here
	}
}

So it would just create an additional loop, possibly causing some overriding of the values.

However both methods performs exactly the same. I've tested it on 30mln points geometry many times. Can any1 explain me why?

Edited by JJ FX

Share this post


Link to post
Share on other sites

You're doing a pretty similar thing in both wrangles so assuming you have a similar amount of point and prims on the mesh then it would take a similar amount of time.

Also you aren't doing the same operation as @primnum in a point wrangle seems to grab a random surrounding prim

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×