picking

GPU Picking inconsistent across devices

孤者浪人 提交于 2020-04-17 22:33:14
问题 I’m trying to implement GPU picking with Points using code I modified from the latter half of this article https://threejsfundamentals.org/threejs/lessons/threejs-picking.html It’s been working fine for me on desktop, but I started testing different browsers and devices and it doesn’t work consistently. I made a Codepen to illustrate https://codepen.io/deklanw/pen/OJVVmEd?editors=1111 body { margin: 0; } #c { width: 100vw; height: 100vh; display: block; } <canvas id="c"></canvas> <script type

Performantly render tens of thousands of spheres of variable size/color/position in Three.js?

我们两清 提交于 2020-03-26 04:04:37
问题 This question is picking up from my last question where I found that using Points leads to problems: https://stackoverflow.com/a/60306638/4749956 To solve this you'll need to draw your points using quads instead of points. There are many ways to do that. Draw each quad as a separate mesh or sprite, or merge all the quads into another mesh, or use InstancedMesh where you'll need a matrix per point, or write custom shaders to do points (see the last example on this article) I've been trying to

Performantly render tens of thousands of spheres of variable size/color/position in Three.js?

徘徊边缘 提交于 2020-03-26 04:04:36
问题 This question is picking up from my last question where I found that using Points leads to problems: https://stackoverflow.com/a/60306638/4749956 To solve this you'll need to draw your points using quads instead of points. There are many ways to do that. Draw each quad as a separate mesh or sprite, or merge all the quads into another mesh, or use InstancedMesh where you'll need a matrix per point, or write custom shaders to do points (see the last example on this article) I've been trying to

WebGL: using framebuffers for picking multiple objects

非 Y 不嫁゛ 提交于 2020-01-25 11:53:27
问题 I am trying to implement picking in WebGL. I have a lot of objects (around 500), and I'd like each one to be allowed to be picked. In order to do that, I did a loop which assigns a unique colour to each object (cf. picking principle): for (var i = 0, len = objects.length; i < len; i++) { framecolors[count++] = i % 256 / 256; //Red framecolors[count++] = Math.floor(i/256) / 256; //Green framecolors[count++] = Math.floor(i/(256*256)) / 256; //Blue } framecolors was then used in a classical

gpu picking - invisible pixels around sprites

﹥>﹥吖頭↗ 提交于 2020-01-11 04:06:08
问题 I'm rendering a picking scene that contains sprites. As my cursor gets close to the sprite, it registers as a color and gets "picked". This invisible border gets larger closer you zoom into the sprites. Open up your console to see the IDs printed in real time. Move your cursor closer and further away to large and small sprites. You'll see that sprites get selected on an invisible border. This behavior does not happen with regular geometry, just with sprites. It's weird because I'm rendering

Jogl, creating only red channel u16 but getting “Texture type and format combination is not valid”

ぐ巨炮叔叔 提交于 2020-01-06 04:54:17
问题 So, I am trying to implement the picking through id. This means with every drawArray a different unique id will be set as uniform and saved in the red component on a texture. 16 bits are more than enough (65k elements), so I choose to use shorts, I know that uniform variable can be only ui, but I decided to gave it a try anyway I also found another question, here, where the answer contains a small example with shorts However here my code to initialize the framebuffer and two textures, one for

LWJGL 3D picking

痞子三分冷 提交于 2019-12-24 07:59:29
问题 So I have been trying to understand the concept of 3D picking but as I can't find any video guides nor any concrete guides that actually speak English, it is proving to be very difficult. If anyone is well experienced with 3D picking in LWJGL, could you give me an example with line by line explanation of what everything means. I should mention that all I am trying to do it shoot the ray out of the center of the screen (not where the mouse is) and have it detect just a normal cube (rendered in

3D Graphics Picking - What is the best approach for this scenario

独自空忆成欢 提交于 2019-12-24 00:32:26
问题 I am working on a project which allows users to pick 3d objects in a scene and I was wondering what everyone thought would be the best way to approach this particular scenario. Basically we have a scene with at least 100 objects (they are low-poly but made from at least ~12-15 triangles) and up to about 1000-2000 objects. Not all the objects will be "pickable" at all times because some objects will occlude others so "pickable" objects probably land in the range between 800-1500 (depending on

Given a 4x4 homogeneous matrix, how can i get 3D world coords?

痴心易碎 提交于 2019-12-23 15:20:31
问题 So i have an object which is getting rotated then translated and rotated again. I am storing a matrix of these translations as an object member. Now when i come to object picking i need to know the 3D world coords of this object. Currently i have been able to get the position of the object like so coords[0] = finalMatrix[12]; coords[1] = finalMatrix[13]; coords[2] = finalMatrix[14]; This is giving me the correct positions of the objects but i want to take the rotations into account as well.

Three.js picking is not working correctly with custom geometry

白昼怎懂夜的黑 提交于 2019-12-23 05:59:52
问题 I have a problem with picking implementation. I found a number of different examples doing what I want, but I really cannot make it work as it should. I mainly followed this example Basically, I have some meshes in my scene and, double clicking any of them, I'd like to change the color of the chosen one. In the scene there are 3 small cubes that are always selected and some more complex meshes that often aren't. I'd like to know if anybody can help me figuring why, if the cubes can be