If not we were wondering about PBRCustomMaterial would be better for us/work with multiview or just moving to straight code is alright as well but unsure about complexity of hooking up to lighting and environment map and would be helpful to be pointed at example if does exist
We can move it out to an include, but that’s assuming nothing else should pass to the gl_Position other than the viewProjection and the worldPos (which is correct in the majority of the case)
I think there’s a misunderstanding in the thread.
Multiview is already working with PBRCustomMaterial / CustomMaterial / plugin materials: if multiview is enabled in the scene, the materials will use multiview rendering.
That’s only the NME which needs to be updated to support multiview node materials.
Yup, only NME I believe as well which might require a new node to deal with : #ifdef MULTIVIEW
if (gl_ViewID_OVR == 0u) {
gl_Position = viewProjection * worldPos;
} else {
gl_Position = viewProjectionR * worldPos;
} #else
gl_Position = viewProjection * worldPos; #endif
I think we only need to update the VertexOutput block with a new entry (for the transformed world position by the viewProjectionR matrix) (the code you pasted above would be generated by this block) and a new View x Projection (right) input matrix to retrieve the viewProjectionR matrix.