Giter Site home page Giter Site logo

clayne / mojoshader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from icculus/mojoshader

0.0 0.0 0.0 23.9 MB

Use Direct3D shaders with other 3D rendering APIs.

Home Page: https://icculus.org/mojoshader/

License: zlib License

Shell 0.02% C++ 0.35% Perl 0.19% C 98.94% CMake 0.41% GLSL 0.09%

mojoshader's Introduction

MojoShader

https://icculus.org/mojoshader/

MojoShader is a zlib-licensed library to work with Direct3D shaders on alternate 3D APIs and non-Windows platforms. The primary motivation is moving shaders to OpenGL languages on the fly. The developer deals with "profiles" that represent various target languages, such as GLSL or ARB_*_program.

This allows a developer to manage one set of shaders, presumably written in Direct3D HLSL, and use them across multiple rendering backends. This also means that the developer only has to worry about one (offline) compiler to manage program complexity, while MojoShader itself deals with the reduced complexity of the bytecode at runtime.

MojoShader provides both a simple API to convert bytecode to various profiles, and (optionally) basic glue to rendering APIs to abstract the management of the shaders at runtime.

Work is in progress to allow MojoShader to work as a replacement stack for the D3DX shader tools. The library already provides a preprocessor and an assembler to generate bytecode from low-level source, and construction of a full HLSL compiler is in progress.

The library is meant to be statically linked to an application (just add a few .c files and headers to your build), allows the app to optionally specify an allocator, and is thread safe (although OpenGL itself is not). It is meant to be embedded in games with a minimum of fuss.

To use this in your project:

  • Add mojoshader*.c and mojoshader*.h to your project.
  • Compile mojoshader*.c
  • If you don't have a C99-compliant compiler, like Microsoft Visual Studio, you'll need to compile the .c files as C++ to get them to build.
  • If you don't have cmake to generate mojoshader_version.h, you can either add a blank file with that name, or add MOJOSHADER_NO_VERSION_INCLUDE to your preprocessor definitions.

mojoshader's People

Contributors

icculus avatar flibitijibibo avatar thespydog avatar krolli avatar aras-p avatar thatcosmonaut avatar kg avatar bartwe avatar brad0 avatar dominickarma avatar johnnyonflame avatar robert-nix avatar yangfl 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.