[SOLVED] VR Example with version 2.6.1

Good morning everyone, I’m having problems with a PlayCanvas VR project that I initialized from the Template project. I only tried to change the version to 2.6.1, but when I run the VR, I get the error:

Vertex attribute [vertex_position] at location 0 required by the shader is not present in the currently assigned vertex buffers, while rendering [Pass:RenderPassForward RT:WebglFramebuffer | Camera: Camera, Layer: World(OPAQUE) | Node: model, Material: Controller] 

The test project is https://playcanvas.com/project/1330604/overview/test-vr-kit-261

Thanks for support.

3 Likes

We have a fix in 2.7.1 Only validate shader vertex attributes when vertex buffers are set by mrxz · Pull Request #7561 · playcanvas/engine · GitHub
You can likely ignore it, as it does not change the behaviour, and only logs error in the debug build. Alternatively use 2.7.1 engine which is available as RC in the Editor)

1 Like

Thanks for response, but I tried version 2.7.1 and that fixed it, however, the issue persists that as soon as I interact with a Box with the controller, it now throws this error:

viewport-error-console.js:161 TypeError: Cannot read properties of undefined (reading '0')
    at WebglGraphicsDevice.commitFunction.<computed> (webgl-graphics-device.js:420:27)
    at WebglGraphicsDevice.draw (webgl-graphics-device.js:1817:58)
    at ForwardRenderer.drawInstance (renderer.js:831:20)
    at ForwardRenderer.renderForwardInternal (forward-renderer.js:649:30)
    at ForwardRenderer.renderForward (forward-renderer.js:680:14)
    at ForwardRenderer.renderForwardLayer (forward-renderer.js:788:14)
    at RenderPassForward.renderRenderAction (render-pass-forward.js:305:22)
    at RenderPassForward.execute (render-pass-forward.js:241:22)
    at RenderPassForward.render (render-pass.js:459:22)
    at FrameGraph.render (frame-graph.js:173:29)

:cry:

I see what the problem is. I’ll get the original template fixed. To fix it locally, open the controller.js script, and fix the line 74 to this:

mesh.setParameter('material_diffuse', [mesh.pickedColor.r, mesh.pickedColor.g, mesh.pickedColor.b]);

1 Like

I created an issue to fix it on our side

Thanks for the report @smth-mmusso

1 Like

Thanks