Expose the pick state and use pixel position from params#36
Expose the pick state and use pixel position from params#36hccampos merged 2 commits intopnext:masterfrom
Conversation
hccampos
left a comment
There was a problem hiding this comment.
Thanks for the feature. Could be useful for some people indeed. Just don't agree with exposing internal details of the picking.
| } | ||
|
|
||
| interface IPickState { | ||
| export interface IPickState { |
There was a problem hiding this comment.
Why should this be exported? It is an internal detail of the picking system and shouldn't be used from the outside.
There was a problem hiding this comment.
In the current configuration is it impossible to introduce custom changes to the pick material and the pick render target. For instance, some properties for a material are not considered in the updatePickMaterial(). The same with the render target in updatePickRenderTarget().
There was a problem hiding this comment.
Sure, but why would you want to modify those? The pick material should have only the bare minimum to be able to perform picking. The fact that we are using a material and render-target at all is just an implementation detail. We could just as easily use the octree and do the picking in the CPU and the client shouldn't have to care about that.
Maybe if you provide an example of the exact thing you are trying to accomplish, then we could come up with some option/param to make it possible through the public interface of the octree.
There was a problem hiding this comment.
In the case of multiple viewports you have to be able to correctly set a current viewport size for the pick render target and scissors. In the case of a material there is for example a property useFilterByNormal which reduces the number of visible points. Moreover, when someone introduces custom features for shaders, you need to reflect those changes in the pick material as well.
There was a problem hiding this comment.
So how about having an optional callback in the pick params that would be called with the material and render target after or in updatePickMaterial()?
…assed Prevent doing unnecessary work when pixelPos is passed in params Addition of comments
c5da889 to
e83a2f9
Compare
hccampos
left a comment
There was a problem hiding this comment.
Cool, LGTM. I will merge and release a new version to npm
…` to pick params (#36) - `pixelPosition`: If provided, the picking will use this pixel position instead of the `Ray` passed to the `pick` method. - `onBeforePickRender`: Function which gets called after a picking material has been created and setup and before the point cloud is rendered into the picking render target. This gives applications a chance to customize the renderTarget and the material.
|
@Zielon I released
|
In the case when we want to provide different coordinates for the picking window, the property from
params,pixelPoscan be used.