Hello, i copied the blur renderer feature without modifications from Unity. It seems like there are a few errors i get in some edge cases.
I think if i build the project with the game view opened, i sometimes get errors about the material. Is it maybe known if there are still problems wth rendergraph or extra checks the code needs?
#Blur Renderer Feature 6.3 from manual errors
1 messages · Page 1 of 1 (latest)
I don't know this stuff well enough to say what's wrong with it, but because that example is for 6.1 and seems to have been reworked into something else in 6.3 docs, it's not expected to work
Yeah, i think that's part of the problem, but i just couldn't find a complete sample in the manual for 6.3 it seems all split up now
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
You can also get a bunch of examples from the package manager for your version of URP
yeah will check those too. It should not be too hard to have it working correctly i hope. I just need a basic working one to reference for a custom one.
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
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