Git Product home page Git Product logo

meshtrimmer's Introduction

Snapshot

起因

Unity能裁剪Sprite的矩形变成Overdraw更少的多边形, 但是找遍全网都没有基于Mesh的透明裁剪, 于是就自己动手实现了这个工具。

原理

将Mesh上使用的贴图使用Unity内置的透明裁剪变成的多边形, 然后将这个多边形与原始Mesh的多边形做相交处理, 最后将相交重叠部分的多边形重新生成Mesh。

核心插件

Unity的内置裁剪函数SpriteUtility.GenerateOutline, 多边形库Clipper做相交运算, 三角化库LibTessDotNet生成Mesh。

使用方法

给Prefab挂上MeshTrimmer,设置参数 点击TrimMesh就能自动生成Overdraw更少的Mesh

meshtrimmer's People

Contributors

genechiu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.