• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    C
  • License
    zlib License
  • Created over 6 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Use Direct3D shaders with other 3D rendering APIs.

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.

More Repositories

1

physfs

A portable, flexible file i/o abstraction.
C
517
star
2

SDL_sound

An abstract soundfile decoder.
C
140
star
3

mojoAL

An SDL2-based implementation of OpenAL in a single C file.
C
107
star
4

mojozork

A simple Z-Machine implementation in a single C file. Now with online multiplayer! :)
C
101
star
5

fatelf

Universal binaries for Linux.
C
63
star
6

sdlamp

A tutorial on writing a simple media player with SDL.
C
45
star
7

mojosetup

A standalone installer for Linux software.
C
43
star
8

manymouse

Simple, cross-platform library to handle multiple mice.
C
38
star
9

steamshim

A workaround for GPL software that wants to use the Steamworks SDK.
C++
37
star
10

2ine

An OS/2 "emulator" for Linux.
C
30
star
11

DirkSimple

A dirt-simple Dragon's Lair player
Assembly
27
star
12

theoraplay

A small C library to make Ogg Theora decoding easier.
C
22
star
13

smpeg

Loki Software's MPEG decoding library.
C++
15
star
14

mojoelf

Load ELF binaries from a memory buffer.
Python
10
star
15

duke3d

The icculus.org port of Duke Nukem 3D.
C
8
star
16

inline-reddit

Provide reddit RSS feeds with images inlined.
PHP
7
star
17

fte

Ryan's fork of FTE (originally at http://fte.sf.net/)
C++
6
star
18

buildengine

icculus.org's port of Ken Silverman's Build Engine
C
6
star
19

vbslacker

An abandoned attempt to build an open source Visual Basic.
C
5
star
20

altrace

An OpenAL debugging tool.
C
5
star
21

1pass

A 1Password-compatible password management tool for Linux.
C
5
star
22

buildutils

icculus.org port of the Build Engine utilities.
C
4
star
23

icculusgopher

A simple gopher server.
Perl
4
star
24

gradius

A quick-and-dirty experiment to ask: would Gradius be better with mouse support?
FreeBasic
4
star
25

shadowwarrior

icculus.org Linux port of 3DRealms' Shadow Warrior.
C
4
star
26

smjpeg

Loki Software's Motion JPEG library.
C
4
star
27

palantir

A portable VNC client built on SDL and SDL_net.
C++
4
star
28

twisty-little-utilities

A bunch of simple little life-saver utilities.
Shell
4
star
29

loki_update

Loki Software's update tool.
C
3
star
30

icculusfinger

A powerful Intenet finger system.
Perl
3
star
31

mallocmonitor

Some incomplete tools for tracking memory allocations.
C++
3
star
32

mojocrash

A cross-platform problem-reporting tool.
C
3
star
33

gdb-dataplugins

An experiment in adding data visualization plugins to GDB.
C
2
star
34

palmpdb

Palm Database (PDB) Access Library
C
2
star
35

descent3-bugs

Bug reports for the Linux and Mac versions of Descent 3.
2
star
36

imessage_archive

Archive iMessage chats to an email inbox.
Perl
2
star
37

steamtags

Categorize your Steam library in a web interface.
PHP
2
star
38

toby

A learning experiment with TurtleGraphics.
C
2
star
39

telegard

Abandoned attempt at porting Telegard to Linux
Pascal
2
star
40

mojobasic

Attempt to write an LLVM frontend to BASIC.
C++
2
star
41

xmpp_archive

Ryan's ejabberd/JEP-0136, MySQL to Maildir archiver.
Perl
2
star
42

al_osx

A (now-obsolete!) OpenAL implementation for Mac OS X.
C
2
star
43

alextreg

Code that drives the OpenAL extension registry.
Perl
2
star
44

arcade1up-lcd-marquee

Code to drive the Icculus Arcade1Up LCD marquee project.
C
2
star
45

mojodds

Simple DirectDraw Surface (.DDS) decoder routines.
C
2
star
46

soundboard

Software for a custom soundboard
C
1
star
47

mod_offload

An Apache module to offload bandwidth to caching servers.
C
1
star
48

loki_utils

Loki Software's library of common helper functions.
C
1
star
49

twitterlosses

A script to alert you when people unfollow you on Twitter.
PHP
1
star
50

mojomerge

A cross-platform compare-and-merge utility. wxWidgets!
C++
1
star
51

netqmail

C
1
star
52

libappdir

An experiment in making apps not write to $HOME
C
1
star
53

libdimmer

An extremely incomplete attempt at software to drive theatrical lighting systems hardware.
C
1
star
54

saysomethingnice

The code that powered quicksaysomethingnice.com
PHP
1
star
55

icculusnews

The news queue manager at icculus.org
PHP
1
star
56

loki_patch

Loki Software's loki_patch
C
1
star
57

mojopatch

A standalone tool for updating applications in the field.
C
1
star
58

ioAL

Never-really-started OpenAL implementation
C
1
star
59

icculustweets

Republish tweets on a website or as RSS feed, and archive them to an email folder.
PHP
1
star
60

daddymax

An extremely incomplete attempt at software to manage theatrical lighting systems.
C++
1
star
61

jbbs

An initial attempt at a "modern" BBS, written in Java.
Java
1
star