Skip to content
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

Wrong parameter for renderPass in @luma.gl model.draw() #854

Open
SauvageThomas opened this issue Jan 28, 2025 · 4 comments · May be fixed by #855
Open

Wrong parameter for renderPass in @luma.gl model.draw() #854

SauvageThomas opened this issue Jan 28, 2025 · 4 comments · May be fixed by #855
Labels
bug Something isn't working

Comments

@SauvageThomas
Copy link

Describe the bug
The renderPass is not correctly sent to the model.draw function. It's very impacting because it blocks any render with recent luma versions.

deck.ts:259  deck: drawing XRLayer({id: 'image-sub-layer-0,512,512,0-TiffPixelSource-#detail-view#'}) to picking:hover: renderPass.popDebugGroup is not a function TypeError: renderPass.popDebugGroup is not a function
    at _Model.draw (model.ts:405:18)
    at XRLayer.draw (index.mjs:549:13)
    at layer.ts:1084:16
    at withGLParameters (with-parameters.ts:37:13)
    at WebGLDevice.withParametersWebGL (webgl-device.ts:353:12)
    at XRLayer._drawLayer (layer.ts:1076:24)
    at PickLayersPass._drawLayersInViewport (layers-pass.ts:282:17)
    at PickLayersPass._drawLayers (layers-pass.ts:130:28)
    at PickLayersPass.render (layers-pass.ts:95:19)
    at PickLayersPass._drawPickingBuffer (pick-layers-pass.ts:87:32)

To Reproduce
Steps to reproduce the behavior:
The easiest way to reproduce the bug is to update to the latest deck.gl and luma.gl version and run any viv code, for exemple, Avivator will fail.

By looking in debug mode, it seems that the code il already present but is hidden by Luma that is not really doing anything with the renderPass. But, in recent versions the bug makes it imposible to draw anything.

Expected behavior
The bug is really easy to solve, the problem is that opts are passed to model.draw, while it should have been renderPass.

This single line solves the issue:
model.draw(opts['renderPass']);

This should be done in xr-layer.js and xr-3d-layer.js.

I've tested it by cloning locally and it works.

Thanks for this library

@SauvageThomas SauvageThomas added the bug Something isn't working label Jan 28, 2025
manzt added a commit that referenced this issue Jan 28, 2025
Fixes #854, which I believe was introduced in #805.
@manzt manzt linked a pull request Jan 28, 2025 that will close this issue
2 tasks
@manzt
Copy link
Member

manzt commented Jan 28, 2025

Applied changes in #855. I wasn't able to reproduce, but maybe I don't have the latest version of luma? what version this happen on?

Deck.gl often introduce breaking changes in minor versions. Viv is currently compatible with <v9.1.

EDIT: I'm able to reproduce on Deck.gl v9.1 (and Luma v9.1). @ilan-gold, the fix is #855 appears to work on both v9.0 and v9.1, but I don't see anything in the upgrade guide around these changes.

@SauvageThomas
Copy link
Author

From what I see, in 8.5 , the param was opts:

https://github.com/visgl/luma.gl/blob/3e88f49787328cd4e69e26ea47cfb720337e0a43/modules/engine/src/lib/model.js#L275

And in 9.0, it changed to renderPass
https://github.com/visgl/luma.gl/blob/2068c74ce8b2417f64f4e80993ecf71085d2219d/modules/engine/src/model/model.ts#L347

They might have forgotten it in the guide because using the last param did not introduce a bug directly.

@ilan-gold
Copy link
Collaborator

@SauvageThomas How did this bug arise? Were you trying to use a more recent version of luma or deck than we support?

@SauvageThomas
Copy link
Author

@ilan-gold it was because I was using the 9.1 version for deck.gl and luma.gl.
In 9.0 the parameter is also wrong but it does not produce a bug. Right now, I downgraded to match your versions (9.0.33 and 9.0.27) and the bug does not occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants