render stencil portals (stereo)
This commit is contained in:
@@ -16,9 +16,9 @@ namespace EscapeRoomEngine.Portal.Runtime
|
||||
|
||||
private class PortalCameraRenderPass : ScriptableRenderPass
|
||||
{
|
||||
private static readonly List<ShaderTagId> ShaderTagIds = new List<ShaderTagId>
|
||||
private static readonly List<ShaderTagId> ShaderTagIds = new()
|
||||
{
|
||||
new("SRPDefaultUnlit"), new("UniversalForward"), new("UniversalForwardOnly")
|
||||
new ShaderTagId("SRPDefaultUnlit"), new ShaderTagId("UniversalForward"), new ShaderTagId("UniversalForwardOnly")
|
||||
};
|
||||
|
||||
private RenderStateBlock _renderStateBlock;
|
||||
@@ -74,8 +74,15 @@ namespace EscapeRoomEngine.Portal.Runtime
|
||||
var originalPosition = cameraTransform.position;
|
||||
var originalRotation = cameraTransform.rotation;
|
||||
var originalProjection = camera.projectionMatrix;
|
||||
camera = linkedPortal.SetUpCamera(camera);
|
||||
RenderingUtils.SetViewAndProjectionMatrices(_commandBuffer, camera.worldToCameraMatrix, GL.GetGPUProjectionMatrix(camera.projectionMatrix, true), false);
|
||||
camera = linkedPortal.SetUpCamera(camera,
|
||||
camera.stereoEnabled
|
||||
? cameraData.xr.multipassId == 0
|
||||
? Camera.MonoOrStereoscopicEye.Left
|
||||
: Camera.MonoOrStereoscopicEye.Right
|
||||
: Camera.MonoOrStereoscopicEye.Mono);
|
||||
RenderingUtils.SetViewAndProjectionMatrices(_commandBuffer,
|
||||
camera.worldToCameraMatrix,
|
||||
GL.GetGPUProjectionMatrix(camera.projectionMatrix, true), false);
|
||||
|
||||
// execute command buffer
|
||||
context.ExecuteCommandBuffer(_commandBuffer);
|
||||
|
||||
Reference in New Issue
Block a user