using System; using UnityEngine; using UnityEngine.TerrainTools; namespace UnityEditor.TerrainTools { /// /// An interface that allows rendering of terrain-brushes for both preview purposes and to modify the terrain. /// NOTE: This uses the GPU so material properties will also need to be dealt with prior to rendering. /// public interface IPaintContextRender : IDisposable { /// /// Sets up the material properties required when rendering a terrain-brush. /// /// The paint-context to use. /// The brush-transform to be rendered. /// The material whose properties are to be initialised. void SetupTerrainToolMaterialProperties(PaintContext paintContext, BrushTransform brushTransform, Material material); /// /// Renders the terrain-brush using the specified material/pass to the paint-context provided. /// /// The paint-context to modify. /// The material to use when rendering to the terrain. /// The pass on the material to use. void RenderBrush(PaintContext paintContext, Material material, int pass); } /// /// An interface that represents the method for rendering the terrain-brush preview. /// public interface IPaintContextRenderPreview : IPaintContextRender { /// /// Renders a preview of the terrain-brush using the specified material/pass and paint-context provided. /// /// The paint-context to preview the changes against. /// The type of texture to preview. /// The brush-transform to be rendered. /// The material to use when rendering to the terrain. /// The pass on the material to use. void RenderBrushPreview(PaintContext paintContext, TerrainBrushPreviewMode previewTexture, BrushTransform brushTransform, Material material, int pass); } }