Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

How to read the pixel at a specific coordinate from color buffer?

$
0
0

Hello, 

Currently I am working on a map application which can let the users to interactive with huge amount of entities including points and polygons. I use leaflet map framework and a library called PixiOverlay to achieve that. The data are stored in particleContainer and also indexed by kd-tree. Therefore, we can select entities on the map by searching the coordinates of a click event in the tree.

Now I want to implement an onHover function that changes the appearance of cursor when the mouse pointer hovers on the entities. Soon I noticed that continually search in the tree takes too much time when the amount of entities is huge.

Although I am new to WebGL, I still tried hard to google for potential solutions. I found there is a color picking algorithm which includes the step "Read the pixel at location (mouse_x,mouse_y) from the color buffer which identifies the object." Is it also possible to read the color of a pixel directly in pixi.js?

Thanks.

Untitled.png


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>