-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Primitive picking #1524
Primitive picking #1524
Changes from 3 commits
42f5401
19ea641
a24eac4
ed0faa4
a5ee5b0
c6a2235
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -780,12 +780,16 @@ define([ | |
this._backFaceRS = this._frontFaceRS; | ||
} | ||
|
||
var pickRS; | ||
if (allowPicking) { | ||
// Only need backface pass for picking when two-pass rendering is used. | ||
this._pickRS = this._backFaceRS; | ||
pickRS = clone(renderState, false); | ||
pickRS.cull = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm still not sure that we should do this. This is just to workaround a user-error, right? Why not just render the pick pass the same as the color pass, but with the standard pick states set? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes.
I thought about it, but culling is disabled to only write depth (maybe) when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not following you. If the object is closed and we go inside, it will not be shown in the color pass and should not be pickable in the depth pass. I'm still having trouble understanding why we can't just render the pick pass the same way we render the color pass but with the standard pick state changes. |
||
enabled : false | ||
}; | ||
this._pickRS = context.createRenderState(pickRS); | ||
} else { | ||
// Still occlude if not pickable. | ||
var pickRS = clone(renderState, false); | ||
pickRS = clone(renderState, false); | ||
pickRS.colorMask = { | ||
red : false, | ||
green : false, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was probably my idea, but another problem with the old approach is that if another object occluded the backfaces but not the front, this object would not get picked (or picked first with drill picking).