Skip to content

Support for 2022.2? #531

@enickel00

Description

@enickel00

First off, a big thanks to all the developers working on this project. This has been a big aid to quickly training new vision models and has given us the ability to experiment quickly with different CNN designs.

I've been using the perception package successfully with Unity 2021.3 for some time now. However, I'd like to switch to 2022.2 because this release has a denoiser built in for the pathtracing renderer. When I make a new HDRP project in 2022.2 and import the perception package I get the following error in the console:

Library\PackageCache\com.unity.perception@0.11.2-preview.2\Runtime\GroundTruth\RenderPasses\CrossPipelinePasses\GroundTruthCrossPipelinePass.cs(55,19): error CS0246: The type or namespace name 'RendererListDesc' could not be found (are you missing a using directive or an assembly reference?)

When I look up that code I see that RendererListDesc is being used, but Unity is having an issue finding it. Perhaps the package which this belongs to has changed, and I need a new 'import' statement at the top of the code? Not exactly sure, and I'm not a programmer by background so sorry if this is a stupid request, but does anyone have a suggestion to fix this error?

using System;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;

namespace UnityEngine.Perception.GroundTruth
{
    abstract class GroundTruthCrossPipelinePass : IGroundTruthGenerator
    {
        public Camera targetCamera;

        bool m_IsActivated;

        protected GroundTruthCrossPipelinePass(Camera targetCamera)
        {
            this.targetCamera = targetCamera;
        }

The next section starts with line 55 which was referenced in the error message:

 protected RendererListDesc CreateRendererListDesc(
            Camera camera,
            CullingResults cullingResult,
            string overrideMaterialPassName,
            int overrideMaterialPassIndex,
            Material overrideMaterial,
            LayerMask layerMask)
        {
            var shaderPasses = new[]
            {
                new ShaderTagId("Forward"), // HD Lit shader
                new ShaderTagId("ForwardOnly"), // HD Unlit shader
                new ShaderTagId("SRPDefaultUnlit"), // Cross SRP Unlit shader
                new ShaderTagId("UniversalForward"), // URP Forward
                new ShaderTagId("LightweightForward"), // LWRP Forward
                new ShaderTagId(overrideMaterialPassName), // The override material shader
            };

            var stateBlock = new RenderStateBlock(0)
            {
                depthState = new DepthState(true, CompareFunction.LessEqual),
            };

            var result = new RendererListDesc(shaderPasses, cullingResult, camera)
            {
                rendererConfiguration = PerObjectData.None,
                renderQueueRange = new RenderQueueRange { lowerBound = 0, upperBound = 5000 },
                sortingCriteria = SortingCriteria.CommonOpaque,
                excludeObjectMotionVectors = false,
                overrideMaterial = overrideMaterial,
                overrideMaterialPassIndex = overrideMaterialPassIndex,
                stateBlock = stateBlock,
                layerMask = layerMask,
            };
            return result;
        }

Alternatively, is there a branch of this perception package code which has been tested on 2022.2?

Thanks in advance,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions