I have an additional question to this: How do you actually use these for your own project?
I have opened the examples and looked through all the stuff, and tried importing the materials and render settings into my project. I created a new Renderer Feature in my UniversalRenderPipelineAsset_Renderer.asset and under overrides, added the OutlineHull material provided with the examples.
The outline is created in the color I picked, but the outline thickness is way too high, even on the lowest setting.
There must be something wrong, but since there is no explanation whatsoever provided with the example, I have a hard time figuring out what to do. The example provides two methods of creating the outlines, but as a somewhat beginner I have no idea which files belong to which method even…
Edit:
Nevermind I figured it out: The scale for the model I have imported from blender is off… even though it seems to be the right size for the scene, the X,Y and Z scales are each 100 instead of 1. I guess I must have forgotten to apply the scale in Blender at some point.
Nevertheless, since these are low-poly models, it turns out the approach doesn’t work very well for those. The outlines sometimes seem to float some distance away from the actual model and since they’re inverted normals often don’t look very good.
Still looking for a better approach…
The other example in the demo project uses something named “blit”. For now, adding the two “Blit” scripts provided with the example to my project allowed me to create Blits as renderer features and I could use the sobelBlit material to create the outline. However, it creates a funny effect where the objects are outlined properly in the scene view in the editor, but in the actual game window it has the outlines from the editor overlayed on top of the game, which obviously doesn’t make any sense. Even in the Unity demo, the outlines from the editor will show up in the game window. But in the official demo, if I set the game to fullscreen it works properly…
If I maximize the game into fullscreen in my own project, there are no outlines displayed at all. Any ideas what could be causing this and how to fix it?
Edit again:
Ok, it turned that in the UniversalRenderPipelineAsset, you need to enable Depth Texture as well as Opaque Texture. The outlines from the Blit thingy are also influenced by the camera’s clipping plane, that is if the clipping plane is too near, the outlines tend to fade out.
I managed to get it to work now, and even though method 2 produces much nicer outlines, there doesn’t seem to be a way to change their color. It would also be nice if we could lower the opacity on the outlines.
I took a look at the SobelFilter.shader, but I don’t think I’ll be able to find out how to manipulate it to create the effects I want…