Jump to content

OpenCl weird vectors approximation


DeBrumaire

Recommended Posts

Hello everyone !

I'm currently learning OpenCl. And I found that for a very simple code, OpenCl creates a different result compared to VEX.

I'm trying to get the average position of near points and create a vector that aims toward this mean position.

In VEX, it works as I expect it to work:

image.thumb.png.ab10c00b0cc8105a18f4c5ae988eb9e2.png

But in OpenCl it does this weird approximation:

image.thumb.png.b9a1dc334d452801445dd8c1aa838581.png

For the projects I'm working on, I need my vectors to be precise...

Do you know why it behaves this way ?

Thank you all !

Link to comment
Share on other sites

Salut Mattéo !

The issue is from current_pos
I figured it out by simply exporting each of your float3 attributes into your force attribute, and comparing the result with VEX's.

sumPos has the exact same result, whereas current_pos is different.

Which, if you take a closer look at the line where you load it, you used vload() instead of vload3() !

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...