Supporting multiview for VR Quest2 with custom PBR NME material

Is this possible right now ?

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

@RaananW might know what is required in the shader ?

There is this old thread about doing it through pure code for reference:

I am pretty sure this is not available in not material at the moment, @RaananW, this might be a nice addition ?

@nasimiasl might help with the custom material approach ?

1 Like

Yeah, this would be a great addition to custom materials.

This is what we have in the default material:

#ifdef MULTIVIEW
	if (gl_ViewID_OVR == 0u) {
		gl_Position = viewProjection * worldPos;
	} else {
		gl_Position = viewProjectionR * worldPos;
	}
#else
	gl_Position = viewProjection * worldPos;
#endif

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)

Would that preclude using vertex position offset for vertices, or does that get evaluated as the input into worldPos as well?

The only different in multiview is the viewProjection variable.

1 Like