GithubHelp home page GithubHelp logo

drew-fc / characterclippingprotector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hines94/characterclippingprotector

0.0 0.0 0.0 1.83 MB

A unity tool to hide certain areas of character meshes and reduce the amount of clipping between clothing layers

License: MIT License

C# 100.00%

characterclippingprotector's Introduction

Character Clipping Protector

A unity tool to reduce the amount of clipping between clothing layers and characters by hiding areas of the mesh which are occluded by outer layers.

|

Works very well, small issues with certain areas such as armpits as described below.

Loading the Example:

  • Download the project

  • Open the Scene "Character Clipping Test Scene"

  • Reset the meshes on the occlusion pawn to default

  • Run the "Character Clipping Protector" - Check button - on "HumanMesh_WITHCLIPPINGPROTECTOR"

  • Adjust the sliders for differing results

  • Requires the packages: Burst, Jobs & Editor Coroutines

Strengths:

  • Fast - could be potentially used sparingly realtime depending on the mesh

  • Good coverage - Gets most areas and flat/slightly rounded surfaces

Weaknesses:

  • Complex areas - Areas such as the armpits/ inner thighs can be an issue due to the huge variance in angles

  • For large meshes will cause perforance isues

  • Async- must be run in a coroutine

  • Only setup for skinned meshes

Usage:

  • DO NOT RUN in any pose other than T or A pose - will get varying results

  • Setup a specific layer for testing occlusion and set this in the script

  • In editor use the "check" option as described above to run the simulation

  • To run from code simply set the meshes and then start the RunClippingSimulation coroutine (with optional callback when complete)

  • Adjust margin to add "safety" margins where the edges of the mesh occur

Tips:

  • ORDER MESHES in terms of layer with the lowest priority first in the inspector (see example)

  • Split meshes up if required: The script will do a reasonable job on all areas but manual culling could be required in certain situations (split arms/legs/torso/head etc)

  • Calculate all mesh combinations upfront in a loading phase and store the results with the "Caching" feature - will then allow quick culling later during gameplay

Method:

  • Creates a seperate collider mesh to test against for each mesh

  • Uses the new Raycast command to cast for each vertex on each mesh from the outside in

  • Collects results and processes to find areas with overlap

  • Creates a new mesh and hides areas with signigicant overlap

Debugging:

  • Use the debug options on the tool to show either mesh hits (overlapping zones) or every raycast made.

characterclippingprotector's People

Contributors

hines94 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.