Skip to content

Latest commit

 

History

History

geometry-sketch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Geometry Sketch

The core of the Geometry sketch toolkit is to upload the entire ModelMesh as a texture to the GPU, thereby converting the vertex shader into a parallel computing core that processes grid data, thereby achieving a capability similar to that of a geometry shader. Special shaders for drawing mesh auxiliary views such as normals, tangents, and wireframes are provided in the repository, and other geometry drawing shaders that rely on mesh data can also be easily extended.

Features

  • NormalMaterial: Draw mesh normal line
  • TangentMaterial: Draw mesh tangent line
  • BiTangentMaterial: Draw mesh bi-tangent line
  • WireframeMaterial: Draw mesh wireframe

You can define your own specific shader by using:

${geometryTextureDefine}

void main() {
    int pointIndex = gl_VertexID / 2;
    ${geometryTextureVert}
}

Then your own shader can access all model mesh info in the vertex shader include morph and skin.

npm

The Geometry Sketch is published on npm with full typing support. To install, use:

npm install @galacean/engine-toolkit-geometry-sketch

This will allow you to import package entirely using:

import * as TOOLKIT from "@galacean/engine-toolkit-geometry-sketch";

or individual classes using:

import { SketchRenderer } from "@galacean/engine-toolkit-geometry-sketch";

playground

The usage of this toolkit can be found in :

Links

License

The engine is released under the MIT license. See LICENSE file.