Jump to content

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
Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...