Graphics.DrawMeshInstancedProcedural

Switch to Manual
public static void DrawMeshInstancedProcedural (Mesh mesh, int submeshIndex, Material material, Bounds bounds, int count, MaterialPropertyBlock properties, Rendering.ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera, Rendering.LightProbeUsage lightProbeUsage, LightProbeProxyVolume lightProbeProxyVolume);

Parameters

mesh@param mesh Mesh, который будет нарисован.
submeshIndex@param submeshIndex Какое подмножество меша будет нарисовано. Это применимо только для мешей, состоящих из нескольких материалов.
material@param material Используемый Material.
boundsThe bounding volume surrounding the instances you intend to draw.
countThe number of instances to be drawn.
propertiesAdditional material properties to apply. See MaterialPropertyBlock.
castShadowsDetermines whether the Meshes should cast shadows.
receiveShadowsDetermines whether the Meshes should receive shadows.
layer@param layer Используемый Слой.
cameraIf null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only.
lightProbeUsage LightProbeUsage for the instances.

Description

Draws the same mesh multiple times using GPU instancing. This is similar to Graphics.DrawMeshInstancedIndirect, except that when the instance count is known from script, it can be supplied directly using this method, rather than via a ComputeBuffer.

To render the instances with light probes, provide the light probe data via the MaterialPropertyBlock and specify lightProbeUsage with LightProbeUsage.CustomProvided. Check LightProbes.CalculateInterpolatedLightAndOcclusionProbes for the details.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961