GithubHelp home page GithubHelp logo

radicalcsg / chisel.prototype Goto Github PK

View Code? Open in Web Editor NEW
460.0 35.0 33.0 12.25 MB

Work in progress prototype for the Chisel Level Editor, for Unity

License: MIT License

C# 99.46% ShaderLab 0.54%
csg mapping leveldesign level-design level-editor bsp chisel realtime constructive-solid-geometry unity

chisel.prototype's Introduction

Chisel is an extension for Unity that allows for rapid, iterative, non destructive level editing!

Example


Notes:

  • Chisel requires Unity 2022.1.0b5 or newer
  • UX is still under development
  • CSG algorithm is still under development
  • It is not yet ready for production, but please feel free to try it out, or better yet, help out!

Features (incomplete)

  • Constructive Solid Geometry Algorithm that generates geometry in real-time
  • Add and remove geometry to your level using CSG allows for fluid, interactive, non destructive workflows
  • Higher level "generators" that create more complicated geometry to perform CSG with, while retaining context of what it is you're creating (if you create stairs, these will remain stairs that you can edit and tweak)
  • Hierarchical Constructive Solid Geometry, allows for generators and brushes to be act as if they're one whole (composite), to perform CSG on other objects with
  • Works well with prefabs, drag and drop windows onto walls including their holes
  • Draw 2D shapes (possible to turn straight lines into curves) on existing CSG surfaces and extrude them
  • Precise snapping to surfaces, edges, vertices and grid lines
  • Rotatable & movable grid

Planned Features (incomplete, and in random order):

Packages overview:

  • com.chisel.core Low-level API and functionality (based on DOTS technology)
  • com.chisel.editor Unity Scene Editor functionality and API, tools and UI
  • com.chisel.components Unity Monobehaviour runtime API (to allow for possible ECS replacement in future)
  • com.scene.handles.extensions Custom scene handle extensions

Extensions:

Known issues:

If you find any failure cases, if possible please provide us with a reproducible scene so we can more easily fix it!

The core technology is based on the algorithm explained in this GDC 2020 talk

GDC Video

chisel.prototype's People

Contributors

babooncodes avatar bryanhaley avatar henry00is avatar jeffvella avatar jmickle66666666 avatar logicalerror avatar nukeandbeans avatar zalo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chisel.prototype's Issues

Improve handle movement

Currently when dragging a handle over a plane the movement doesn't follow the mouse properly, this should be improved. Keep in mind that in some situations it's not desired to actually follow the mouse properly. For instance when a plane creates a horizon in the distance and the mouse crosses the horizon, this would create an infinite movement if it was "precisely following the mouse".

Vertex coloring

The ability to paint colors, or other custom data, on brush vertices would be very useful

Warnings about using deprecated Prefab API

Packages\com.chisel.components\Chisel\Components\API.private\CSGNodeHierarchyManager.cs(865,11): warning CS0618: 'PrefabUtility.GetPrefabType(Object)' is obsolete: 'Use GetPrefabAssetType and GetPrefabInstanceStatus to get the full picture about Prefab types.'

Packages\com.chisel.components\Chisel\Components\API.private\CSGNodeHierarchyManager.cs(865,65): warning CS0618: 'PrefabType' is obsolete: 'PrefabType no longer tells everything about Prefab instance.'

Packages\com.chisel.editor\Chisel\Editor\Components\Containers\Model\Editor\CSGModelEditor.cs(267,16): warning CS0618: 'PrefabUtility.GetPrefabType(Object)' is obsolete: 'Use GetPrefabAssetType and GetPrefabInstanceStatus to get the full picture about Prefab types.'

Packages\com.chisel.editor\Chisel\Editor\Components\Containers\Model\Editor\CSGModelEditor.cs(268,21): warning CS0618: 'PrefabType' is obsolete: 'PrefabType no longer tells everything about Prefab instance.'

Packages\com.chisel.editor\Chisel\Editor\Components\Containers\Model\Editor\CSGModelEditor.cs(268,50): warning CS0618: 'PrefabType' is obsolete: 'PrefabType no longer tells everything about Prefab instance.'

Brush 'layers' or contents

In practice it's very useful to be able to place brushes in a level that only add to the MeshCollider, or the reverse: only add to the visible mesh, but not to the collider.
It's also useful to be able to add brushes for things like water, where you do not want to remove the parts of other brushes that are inside of it, but you do want to do the reverse..
Furthermore, sometimes, for efficiency reasons, you want some brushes to not perform CSG with other brushes at all.
If we have a system where there are certain user definable 'layers' (but with a different name) and be able to define how they interact with each other, then we could give users some sensible defaults and let them set up additional use cases if they need to.

Distance Measure Tool

An easy to use distance measurement tool would be great. Something like in unreal engine would be perfect. Just a line + measurement above it when you click between the two points being measured.

Generators should have a version number

Since generators create all their brushes from scratch, any change in behaviour could potentially drastically change how a level created using generators would look.
So we cannot simply change a generator once people have already started using it, but we might end up in situations where we feel we really do need to improve a generator.
By adding version numbers we can make it possible to handle scenarios like upgrading/converting generators, or having different behaviours for different versions of generators. This gives us more control in situations like this.

Vertex color volume decals

a subdivided volume with colors defined at it's points, which can be moved around in the scene
where brush vertices end up in the volume, the colors will be interpolated and applied to the vertex

Clip Tool

A relatively standard tool in CSG editors, a clip tool where you can quickly create a plane and split/clip brushes.

Ability to edit generic brushes

Right now generic brushes do not have an editor that allows you to move it's vertices, clip it, or split edges. etc. This should be created

Isolate/Hide brushes

hide

Ability to hide or isolate specific brushes, very useful when working on complex scenes.

Unity 2019 has visibility controls which would be best to use, but a solution would need to be made for 2018 if we support that too.

World units for snapping distance

For ease of reference, an option to show customisable distance units wherever distances are shown (space permitting).

  • Add setting to toggle showing world units (default on?)
  • Add setting to define the units show (default m for meters)
  • Show units on bottom toolbar for snapping distance

Material modifying brushes

We should have special brushes that cut the brushes that it intersects, but doesn't add or remove any geometry itself. But it does modify the materials of the brushes it intersects with.

Freedraw should support self-intersecting shapes

It would be nice from a workflow perspective to support self intersecting shapes when in freedraw mode.
For example, making an hourglass shape with 4 vertices, where 2 edges intersect. Right now this is an invalid shape, but if the polygon decomposition code could handle self intersections, there essentially wouldn't be any 2D shape that would fail. (except for straight lines)

Finish the pathed/linear/spiral stairs generators

The pathed stairs doesn't always properly generate brushes, and this needs to be fixed.
All the stairs generator don't have all the features that the other stairs generators have and it would be nice to share more code and clean things up.
The pathed stairs should also have an option to fill it's interior

Surface Editor

Surface Editor Tool

  • Modify texture offset, rotation and scale
  • Apply materials quickly and easily
  • Copy material and surface properties from one face to another
  • Automatically UV of entire brush or selected faces based on worldspace coordinates and given scale
  • Select default material for new brushes
  • "Follow Face" (Match UV offset for multiple faces by dragging over them)

Texture offset changes should be aligned to grid unless the Shift modifier is held. Rotation and scale should work the same too.

Offset/Rotate/Scale should honor the relevant selected tool in Unity
screenshot 2019-03-07 11 09 57

A list of recent/frequently used materials for easy selection, plus user-definable groups of materials to select from, with customizable previews (show Sphere, Plane, Cube preview etc, resize previews as in the unity Project window)

Ability to snap UVs to edges of the face and edges of the texture, and shear textures.

Some mockups should be created to plan the UI and features out and get a feel for what considerations may arise.

Need to have a proper hashing solution

Need to have a proper hashing solution, written in C#, to quickly hash arrays of Vector3/Vector4/floats/ints to easily determine if meshes are identical.

Surface colors

The ability to set a color to an entire surface of a brush

More snapping options for generators

When changing the shape of a generator, we need to be able to snap against more things than just the grid.
This means we need to add support for handles to snap against a variety of things.
For example, snap against vertex, position where grid intersects an edge/surface, uv-space snapping of vertices to perfectly align a vertex with a texture etc. etc.

Bevel/Chamfer tool

Able to bevel/chamfer edges, with optional subdivisions to create smoothed edges.

Chamfer example

Subtractive Workflow

Users should easily be able to work in a subtractive workflow, so the void is solid by default rather than empty.

I believe this was discussed to be implemented as a single infinite additive brush at the top of the hierarchy, but we should also consider how it should work on the UX end.

It could be a visible toggle (for instance in the tool bar) called "Fill Void" or similar. This could toggle the infinite brush you start with. Any thoughts?

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.