Giter VIP home page Giter VIP logo

exengine's Introduction

bye


exengine, a C 3D game engine.

Discuss | Website | TODO

What exactly is exengine?

exengine is a 3d engine that takes a slightly different approach than other libraries and engines do, in that it's a code-base you include directly into your own. Rather than using it as a static/shared library.

This approach allows easy and direct access to the engine back-end should you want to make modifications to suit your specific needs, so think of it as more of a template.

Assuming you don't want to set up your own build system (I can't blame you), you can clone the repo and use the existing build system and file structure as a starting template. It compiles on Linux, BSD, and Windows. It might compile and run on MacOS, but this isn't directly supported any more.

The contents of main.c/game.c are only supplied as examples to showcase how one might use the engine.

What are the features?

  • Simple and small
  • A straight-forward C99 codebase
  • A deferred* and forward renderer
  • Various light casters
  • Smooth shadow mapping
  • Normal & specular mapping
  • Half-kernel SSAO (deferred only)
  • IQM model loading
  • 3D model animation
  • Scene manager
  • Instancing
  • Polygon soup collision detection
  • Smooth collision response
  • Various cameras
  • More to come..

(External) Depends

  • A C99 compiler, preferably gcc. Clang and others should also work
  • OpenGL 3.3+
  • SDL2

Credits

Getting Started

Documentation

The current method of documentation is code comments, every engine header has extensive documentation as to its purpose and how one might use it. Better documentation will come in the near future.

Using & Compiling

Simply clone the repository and install the required libraries and compilers listed below for the OS you are using.

This only applies to those wanting to use the current build system and game code as a starting template, and not those wanting to include exengine into an existing project or build system.


Linux

sudo apt-get update
sudo apt-get install build-essential libsdl2-dev
cd src && make

The resulting binary will be in src/build/


Windows

Download and install Cygwin with the following packages. All required libraries for Windows are included in the codebase.

Alternatively switch to category view and set 'Devel' to install. This method takes up 1-2GB of space

mingw64-x86_64-gcc
make
zip

You can also install the Linux subsystem for Windows 10, after which you just need to run the following.

sudo apt update
sudo apt install mingw-w64 make zip
cd /mnt/c/Users/MyUsername/Desktop/exengine/src

After this compiling is the same as Linux, except for the addition of setting the OS variable.

cd C:\exengine\src (or wherever you've put this)
OS=Windows_NT make

the resulting .exe will be in src/build/


OpenBSD

Make sure you have the correct dependicies installed, the equivalent of linux using pkg_add. For OpenBSD specific you will need the 'gmake' and 'gcc' packages. The gcc package will install a more modern compiler as egcc in your path.

after this the compilation is almost the same as in linux, this time specificly using gmake (stands for GNU make).

cd src && gmake

Stand-alone (recommended)

Alternatively you can drop the exengine/ directory right into your own project and use it with your own build system. This method obviously takes more work and time.


Gallery

scrot scrot scrot scrot scrot scrot

exengine's People

Contributors

solenum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

exengine's Issues

dirlight and ssao

Curious if dirlight and ssao that were moved to src/exengine/render/legacy are coming back? Seems from the commit history a refactoring effort might have stalled, but hopefully not forever...

Excellent project and code quality, btw. Finding it very nice to read and use, so thanks for all the effort :)

OpenGL ES 2.0 / WebGL (v1) Back-porting

Could ExEngine be back-ported to OpenGL ES 2.0 / WebGL (v1) to support older browsers and devices? If so, would it involve re-writing the shaders, or are there specific OpenGL ES 3.0 / WebGL2 calls being made by the engine?

*pose* field never used in IQM

I see you code at line 98 of iqm.c

the ex_frame_t_pose = NULL, not initialize before using in function ex_model_update_matrices .

above it is the first question.
the other one is skeleton may be the joint coordinate system of each bone? right?

Discord

Hey exezin, I used to join your IRC channel in past but nowadays nearly every gamer is on Discord. Did you ever consider to open a Discord server for your engine? Discord makes it way easier to share code snippets with Markdown and syntax highlighting, share images via drag&drop etc.

Examples & Docs

Would it be possible to have more examples whose code we can view (like that game with a ball on YouTube that you made, or the examples in your website)? What about documentation?

Right now, this engine seems to be a great idea but if you don't entirely know how to use it it's a bit pointless...

Looking forward to it

"Could not load" multiple files

On a fresh build approximately 10 minutes before submitting this, the game executable fails to load data/conf.ini and data/shaders/text.glsl

This is on a relatively recent (last updated ~48 hours ago) build of Arch with GCC version 11.2.0 and SDL version 2.0.20-2. On the off chance this matters, the CPU is a Ryzen 5 2500u and the program was launched using the internal GPU for rendering

If I missed any relevant information, do let me know.

Deferred renderer setting not working

Unfortunately all I'm getting is a black screen, it works fine in forward rendering mode and the imgui stuff still renders, not sure why this is happening so figured I'd let you know.

Redundant memset operation on coll_tree

file: scene.c line:36, 37
memset(s->coll_tree->region.min, 0, sizeof(vec3));
memset(s->coll_tree->region.max, 0, sizeof(vec3));

file octree.c line:15, 16
memset(o->region.min, 0.0f, sizeof(vec3));
memset(o->region.max, 1.0f, sizeof(vec3));

I think default we can set to 0.0 both sides.

Uniformed code style

I see your some of functions, the return type defined bool, however you alway use 0 or 1 as the return value.

maybe you should include #include <stdbool.h> , instead of 0 or 1 with true or false.

above all, just my personal advice.

last but not the least, I like you project.

warning: missing braces around initializer

https://github.com/exezin/exengine/blob/7edbadecf833822138e7f4b2e20346b8c46e5728/src/exengine/render/shader.c#L4
https://github.com/exezin/exengine/blob/7edbadecf833822138e7f4b2e20346b8c46e5728/src/exengine/render/shader.c#L5

These two lines generate a compile warning

warning: missing braces around initializer [-Wmissing-braces]

I see that you check if the index of the values in the following lines:
https://github.com/exezin/exengine/blob/7edbadecf833822138e7f4b2e20346b8c46e5728/src/exengine/render/shader.c#L21
https://github.com/exezin/exengine/blob/7edbadecf833822138e7f4b2e20346b8c46e5728/src/exengine/render/shader.c#L26

Therefore I don't know if this will break the logic you have here. But I propose the following solution (it seemed equal on my system but maybe I am missing the change)

GLint ex_uniform_map[256][256] = {{0}};
GLint ex_uniform_locations[256][256] = {{0}};

I'm submitting this as an issue so you can double check if the shader logic is still intact with this change.

Taking sponza as a test scene

Hi, I recently try to load sponza scene as my test scene.

The scene file consists of two types of media, one is obj mesh file, the other one are images.

however, right now, the iqm tool chain not parser the mtl or usemtl to recognize material texture as the resource id later on.

so in my eyes, I should add some features that support mtl parser for obj format files. because only under this way, we probably gain texture id use you iqm loader.

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.