#Blur Renderer Feature 6.3 from manual errors

1 messages · Page 1 of 1 (latest)

somber compass
woven talon
somber compass
#

I remembered that Unity has an SSAO pass. I will check that one for differences in how they handle materials. I assume that one is updated correctly for Unity 6.3

woven talon
somber compass
#

The samples all seem to not use dispose at all. I think the dispose method is part of the cause for the errors. I do not know enough if i need it. i know it's to handle the discarding of the material etc but i am not sure now about whether it should be used

somber compass
#

I created the method below based on Unity's SSAO and ScreenSpaceShadow scripts. this will be called in both Create and AddRenderPasses. i think it should solve the issue when the material gets disposed somewhere in the editor while it still actually is needed.

        private bool TryGetResources()
        {
            if (m_Material != null)
            {
                return true;
            }

            if (m_Shader == null)
            {
                m_Shader = Shader.Find(k_ShaderName);
                if (m_Shader == null)
                {
                    return false;
                }
            }

            m_Material = CoreUtils.CreateEngineMaterial(m_Shader);

            return m_Material != null;
        }
#

This seems to work. so the code above and this below is what i adjusted + a bit in the feature create method and addrenderpasses method to call these methods.

        internal bool Setup(Material material, BlurSettings settings)
        {
            _material = material;
            _settings = settings;

            return _material != null;
        }
#

I want to mark this as solved but do not see how to edit the thread tags