Code Monkey home page Code Monkey logo

three-d's Introduction

Logo

three-d

crates.io Docs.rs Continuous integration MIT licensed

What is it?

A renderer which seeks to make graphics simple but still have the power to draw whatever you desire.

three-d

  • makes it possible to combine high-level features with custom shaders so you can focus on the important stuff.
  • can be used by those without any graphics experience and who just want to draw something.
  • tries to do stuff in a few simple lines of code.
  • aims to be as explicit as possible so there is no surprices for you - no hidden magic.
  • targets both desktop and web so you can develop on desktop and deploy on web (with no need for web development and everything that goes with it, except a few lines of html).

The crate consist of three main modules for drawing, context, core and renderer, and two optional utility modules, io and window:

Module Description
context Low-level rendering module - requires a solid understanding of graphics concepts. Gives you complete control over both setup and rendering.
core Mid-level rendering module - requires at least some knowledge about graphics concepts. Use this if you want to write your own shaders and but don't want to spend time on setup and error handling. Can be combined with low-level calls in the context module as long as any graphics state changes are reset.
renderer High-level rendering module - requires no knowledge about graphics concepts. Use this if you just want to draw something on the screen. Features include methods for rendering different types of standard objects with different types of shading. Can be combined seamlessly with the mid-level features in the core module and also with calls in the context module as long as the graphics state is reset.
io Contains functionality to load any type of asset runtime on both desktop and web as well as parsers for different image and 3D model formats. Also includes functionality to save data which is limited to desktop.
window Contains functionality for creating a window on both cross-platform desktop (requires the "glutin-window" feature) and web (requires the "canvas" feature). Also contain render loop, event handling and camera control functionality. Can be replaced by anything that provides an OpenGL or WebGL2 graphics context.

Examples

PBR example Several examples covering most features can be found in the examples folder where you will also find an overview and links where you can try out each example on web. Check out the triangle example for a gentle introduction. The examples that fit with a specific release can be found in the branch for that release, ie. the examples for the 0.9 release can be found in the 0.9 branch.

Build

Desktop:

Build and run an example, in this case 'triangle':

$ cargo run --example triangle --release

Web:

Prerequisites:

Build and generate web output (webassembly, javascript and html files) into the pkg folder:

$ wasm-pack build examples/triangle --target web --out-name web --out-dir ../../pkg

Start the server and go to http://localhost:8080 in a browser:

$ http-server

Supported browsers

Chrome, Firefox, Edge and Safari.

Other

Feature requests and bug reports are more than welcome, just open an issue or start a discussion. Contributions are highly appreciated, please feel free to reach out or simply create a pull request against the master branch.

three-d's People

Contributors

asny avatar mikayex avatar stepancheg avatar haraldreingruber-dedalus avatar raevenoir avatar jbrd avatar rynti 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.