@@ -40,7 +40,7 @@ namespace UnityFx.Outline
4040 private readonly TextureDimension _rtDimention ;
4141 private readonly RenderTargetIdentifier _rt ;
4242 private readonly RenderTargetIdentifier _depth ;
43- private readonly CommandBuffer _commandBuffer ;
43+ private readonly CommandBuffer _commandBuffer ;
4444 private readonly OutlineResources _resources ;
4545
4646 #endregion
@@ -213,24 +213,41 @@ public OutlineRenderer(CommandBuffer cmd, OutlineResources resources, RenderTarg
213213 }
214214
215215 /// <summary>
216- /// Renders outline around a single object. This version allows enumeration of <paramref name="renderers"/> with no GC allocations.
216+ /// Renders outline around a single object.
217217 /// </summary>
218218 /// <param name="obj">An object to be outlined.</param>
219- /// <seealso cref="Render(IReadOnlyList{Renderer}, IOutlineSettings)"/>
220- /// <seealso cref="Render(Renderer, IOutlineSettings)"/>
219+ /// <seealso cref="Render(IReadOnlyList{OutlineRenderObject})"/>
221220 public void Render ( OutlineRenderObject obj )
222221 {
223222 Render ( obj . Renderers , obj . OutlineSettings , obj . Tag ) ;
224223 }
225224
226225 /// <summary>
227- /// Renders outline around a single object. This version allows enumeration of <paramref name="renderers"/> with no GC allocations.
226+ /// Renders outline around multiple <paramref name="objects"/>.
227+ /// </summary>
228+ /// <param name="objects">An object to be outlined.</param>
229+ /// <exception cref="ArgumentNullException">Thrown if <paramref name="objects"/> is <see langword="null"/>.</exception>
230+ /// <seealso cref="Render(OutlineRenderObject)"/>
231+ public void Render ( IReadOnlyList < OutlineRenderObject > objects )
232+ {
233+ if ( objects is null )
234+ {
235+ throw new ArgumentNullException ( nameof ( objects ) ) ;
236+ }
237+
238+ for ( var i = 0 ; i < objects . Count ; i ++ )
239+ {
240+ Render ( objects [ i ] ) ;
241+ }
242+ }
243+
244+ /// <summary>
245+ /// Renders outline around multiple <paramref name="renderers"/>.
228246 /// </summary>
229247 /// <param name="renderers">One or more renderers representing a single object to be outlined.</param>
230248 /// <param name="settings">Outline settings.</param>
231249 /// <param name="sampleName">Optional name of the sample (visible in profiler).</param>
232250 /// <exception cref="ArgumentNullException">Thrown if any of the arguments is <see langword="null"/>.</exception>
233- /// <seealso cref="Render(OutlineRenderObject)"/>
234251 /// <seealso cref="Render(Renderer, IOutlineSettings, string)"/>
235252 public void Render ( IReadOnlyList < Renderer > renderers , IOutlineSettings settings , string sampleName = null )
236253 {
@@ -267,13 +284,12 @@ public void Render(IReadOnlyList<Renderer> renderers, IOutlineSettings settings,
267284 }
268285
269286 /// <summary>
270- /// Renders outline around a single object .
287+ /// Renders outline around a single <paramref name="renderer"/> .
271288 /// </summary>
272289 /// <param name="renderer">A <see cref="Renderer"/> representing an object to be outlined.</param>
273290 /// <param name="settings">Outline settings.</param>
274291 /// <param name="sampleName">Optional name of the sample (visible in profiler).</param>
275292 /// <exception cref="ArgumentNullException">Thrown if any of the arguments is <see langword="null"/>.</exception>
276- /// <seealso cref="Render(OutlineRenderObject)"/>
277293 /// <seealso cref="Render(IReadOnlyList{Renderer}, IOutlineSettings, string)"/>
278294 public void Render ( Renderer renderer , IOutlineSettings settings , string sampleName = null )
279295 {
@@ -301,18 +317,9 @@ public void Render(Renderer renderer, IOutlineSettings settings, string sampleNa
301317 _commandBuffer . EndSample ( sampleName ) ;
302318 }
303319
304- /// <summary>
305- /// Gets depth texture identifier for built-in render pipeline.
306- /// </summary>
307- public static RenderTargetIdentifier GetBuiltinDepth ( RenderingPath renderingPath )
308- {
309- return ( renderingPath == RenderingPath . DeferredShading || renderingPath == RenderingPath . DeferredLighting ) ? BuiltinRenderTextureType . ResolvedDepth : BuiltinRenderTextureType . Depth ;
310- }
311-
312320 /// <summary>
313321 /// Specialized render target setup. Do not use if not sure.
314322 /// </summary>
315- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
316323 public void RenderObjectClear ( OutlineRenderFlags flags )
317324 {
318325 // NOTE: Use the camera depth buffer when rendering the mask. Shader only reads from the depth buffer (ZWrite Off).
@@ -448,6 +455,11 @@ private void Blit(RenderTargetIdentifier src, int shaderPass, Material mat, Mate
448455 }
449456 }
450457
458+ private static RenderTargetIdentifier GetBuiltinDepth ( RenderingPath renderingPath )
459+ {
460+ return ( renderingPath == RenderingPath . DeferredShading || renderingPath == RenderingPath . DeferredLighting ) ? BuiltinRenderTextureType . ResolvedDepth : BuiltinRenderTextureType . Depth ;
461+ }
462+
451463 #endregion
452464 }
453465}
0 commit comments