项目作者: Tw1ddle

项目描述 :
:sparkles: WebGL palette/toon shader demo using TypeScript and three.js
高级语言: JavaScript
项目地址: git://github.com/Tw1ddle/webgl-palette-shader.git
创建时间: 2015-01-17T10:21:16Z
项目社区:https://github.com/Tw1ddle/webgl-palette-shader

开源协议:MIT License

下载


webgl-palette-shader

Deprecation note - this is old code using an early version of TypeScript. It will probably take some work to get building.

This is a single pass palette shader demo made using TypeScript, WebGL and three.js. It does phong shading on the scene and then indexes into a palette texture based using the fragment luminance for the final colours. The implementation extends the default three.js phong shader to do this.

The demo moves a directional light over a model of a city to showcase the effect. Try it out here: https://www.samcodes.co.uk/webgl/palette-shader/

Building

For building I recommend the latest version of Visual Studio (2015 preview) with integrated TypeScript support. All libraries and type definitions are included in the jslib and tslib folders. The common submodule is currently used only for icons and artwork on my personal website.

Screenshots

Heatmap palette:

Purple palette: