Giter VIP home page Giter VIP logo

fyrox's Introduction

Fyrox

Fyrox - a modern Rust game engine

License (MIT) CI Status audit Dependency status Crates.io docs.rs Discord Lines of code

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor. Formerly known as rg3d

Read the official Fyrox book here. It contains comprehensive information about many aspects of the engine, starting by "how to build" and ending by various tutorials.

Community

You can always ask your question in Discord server - Join the Discord server, or directly in Discussions.

Examples

You can run examples directly in your web browser, the full list of demo projects is available here. Source code for each demo project can be found here.

Support

If you want to support the development of the project, click the link below. Preferrable way is to use Boosty - this way the money will be available for the development immediately. Alternatively you can can use Patreon, but in this case the money will be on-hold for unknown period of time (details are here).

Contributing

Contributions are very welcome! See the contributions guidelines for more info. Check the good first issue label to see where you can help.

Sponsors

The engine is supported by very generous people, their donations provides sustainable development of the engine:

Brandon Thomas | Taylor C. Richberger | Avery Wagar | George Atkinson | Erlend Sogge Heggen | Mitch Skinner | ozkriff | Taylor Gerpheide | zrkn | Aleks Row | Edward L | L.apz | Luke Jones | toyboot4e | Vish Vadlamani | Alexey Kuznetsov | Daniel Simon | Jesper Nordenberg | Kornel | Parham Gholami | Yuki Ishii | Joseph Catrambone | MGlolenstine | zamar lomax | Gheorghe Ugrik | Anton Zelenin | Barugon | Tom Leys | Jay Sistar | tc | false | BlueSkye | Ben Anderson | Thomas | Iulian Radu | Vitaliy (ArcticNoise) Chernyshev

JetBrains

JetBrains provided an open-source all-products license for their products which drastically helps in development of the engine.

JetBrains logo.

Copyright © 2000-2021 JetBrains s.r.o. JetBrains and the JetBrains logo are registered trademarks of JetBrains s.r.o.

fyrox's People

Contributors

adamnemecek avatar b-guild avatar bocksdin avatar deersilver avatar dralta avatar eggshark avatar gbutler69 avatar gideongrinberg avatar git2013vb avatar iceguye avatar jacobtread avatar jepotter1-archive avatar lenscas avatar lordcoconut avatar martin-t avatar minusgix avatar mrdimas avatar observant2 avatar olegoandreev avatar pcbeard avatar riddhiman007 avatar san-smith avatar shyamjayakannan avatar thomashauth avatar tiltedteapot avatar toyboot4e avatar victorkoenders avatar vigdail avatar voronar avatar w-flo 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  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

fyrox's Issues

Add binary FBX 7500 support

Binary FBX starting from 7500 version has different size of null-record - 25 null bytes instead of 13 in previous versions, this should be taken into account when loading binary FBX. Binary FBX of version 7500 can be produced by exporting any model from Blender. Also it has u64 end_offset, num_attrib, attrib_list_len in header of node instead of u32 for previous versions.
Starting point: fbx::document::binary::read_binary_node

Add user interface example

Engine has powerful UI library, but there is still no good examples of how to use it, this should be fixed.

Add basic example

Currently there is only one example and it is broken. Add more examples for each aspect of engine.

Sound: Various issues under Windows

Not sure how to title this issue, and I'm not sure if my use of Windows is relevant. I've been trying to use rg3d-sound in Bevy, and have hit an odd issue where my footstep sound is slightly delayed every few seconds. I also, very occasionally, get an issue where sound glitches and can be heard panned slightly differently in the stereo field, as if the source parameters aren't quite synced.

I thought I'd try creating a reproduction, which I have here. But while I can't reproduce the delay, I've found a few issues that may be related.

Essentially, I took your play_sound example, subbed in my footstep sound, and added a loop { ... } block. I need to start/stop my footstep sound more or less quickly based on step length, so I need to control the looping. Here's what I discovered:

  • I have the loop set to sleep for 5 seconds, with a println! at the beginning. The print is called correctly, but the sound still seems to loop quickly despite me explicitly setting it not to.
  • If I use from_millis(5000) for the sleep, the behavior changes. After 20-30 seconds, I start getting audio artifacts similar to the ones I occasionally experience, where the source sounds slightly out of sync.

It's quite possible that I'm misusing the library here, but it seems like it's misbehaving in ways that don't make sense. I don't understand why the source doesn't play once per 5 seconds, nor do I understand the odd audio artifacts here. I might expect performance degradation at higher speeds as the mutex deadlocks, but not at 1/5 seconds.

Am I doing something obviously wrong? Full disclosure: haven't had my coffee yet. :)

Thanks!

Add compressed textures support

Compressed textures are used to improve performance and reduce memory load. At least support of S3TC-compressed textures should be added. A loader for DDS textures should be added too, because DDS contains compressed textures.

Add simple first person example

I think it can be cool to have a simple example of how to move the camera in the space, and see the arms of the… hum… creature you're in. Like the point of view in rusty-shooter.

Add a way to select mixer buffer size in rg3d-sound.

Right now mixer buffer length has fixed length and for some cases it is too big which could cause noticeable lag. Solution is not too easy because mixer buffer length must have very specific properties:

  1. HRTF uses lots of FFTs and interpolation, so it divides mixer buffer in few parts, each part must have length that will give pow2 number when summed with HRIR length. Otherwise performance will be two times worse.
  2. It must not be too low, because there is a soft cap of hardware buffer length of sound output device - if it will be too low there will be clicks in output sound.

That being said, output buffer length should be tweakable, but not in frames. It is better to be able to tweak number of interpolation steps. The value is hardcoded for now in context.rs:91.

Texture Filtering Setting?

This might be an exotic request, but I started doing low poly modeling with pixely textures. In Blender I can set the interpolation mode to closest (= GL_NEAREST). rg3d seems to set it to LINEAR (or Blender doesn't export it into FBX correctly?).

Is this something that rg3d reads from file?

Implement dual paraboloid shadow mapping for point lights

Rendering of shadow map for point light in naive approach with cubemap takes enormous amount of GPU resource. There is a solution for that - dual paraboloid shadow mapping, which is short requires to render scene only 2 times instead of 6 in case of cube map.

Add lightmaps support

Precomputed light is very useful when your light source are not moving, it significantly cheaper than dynamic light. Simple lightmapper should be implemented and there should be a way to apply lightmaps on surfaces.

Add terrain

Adaptive terrain should be added, terrains usually used in outdoor scenes. Terrains should have levels-of-details system to reduce quality of chunks that far away from camera to improve rendering performance. Terrains should be editable in rusty-editor.

Add async scene loading example

Since any scene can be created in separate thread(s), we can create example that shows classic loading screen while scene being formed in other thread.

Idea: Shaders

I've seen some interesting usages of shaders in many games. And I think that having a shaders support inside the game engine itself is good.

In my head shaders can be used in many ways to improve the game graphics.
They should be optional, so the game can run without any shader, it's better for my toaster computer

Implement instancing

Right now there same meshes are rendered by separate draw calls, this is very inefficient and performance could be improved by add instancing to the renderer.

Key input issue on mac

winit has key input issue on macOS: rust-windowing/winit#1470

It says that macOS Accesibility prevents key inputs from going as DeviceEvents. So, on macOS, keyboard input events can only be captured as WindowEvent, unless somehow configuring Accesibility.

I made a commit to enable key input on macOS in the 3rd_person example: toyboot4e@2f2dafe. I can make such changes and make a PR, but I'm not sure if it's good to get key input as WindowEvent.

Add screen space ambient occlusion

Currently ambient lighting is awful - there is no sense of volume at all - just sense of flat surface, screen space ambient occulision (SSAO) will greatly improve perception and it is easy to implement.

Supporting large maps files

I want to build an RPG on top of rg3d but, can I have an extremely large map ?
Having a large map can cause issues with memory, so I was thinking about the possibility of charging only chunks of the map, but, is it possible with the actual state of the engine ?

Wayland support

I'v tested the examples using sway, weston (wayland) and i3 (X11) WM and key input in wayland seems to be broken, it does nothing when in X11 it turn the model.

Also related to wayland and to tiling WM (this bug appear only in sway and not in weston) the display size of the content of the window is cut, resizing the windows fix it.
screen of the bug

Why no external vector library?

Hey, great project!

I was wondering why you implemented vectors etc. yourself and not use the nalgebra crate for example? Any features missing there?

More context maybe: I need to rotate a vector and hoped to do a matrix-vector multiplication, but as far as I see there's no way.

Sound: Play one-off sound, then stop audio thread again?

I would like to add some sound an application. However, I only need to play a short sound (a few seconds) every few minutes. When using rg3d-sound, the Context spawns a mixer thread in the background which consumes 100% cpu (of one core). Unfortunately, I cannot find a way to stop this thread again (not even if I execute std::mem::drop(context) after playing the sound).

Is there some way to create a Context in such a way that it automatically stops itself again after playing the sound, so that my application doesnt need that high CPU resources all the time?

Wayland doesn't support exclusive fullscreen, but, it support fullscreen.

When I start rusty-shooter, and go to the parameters, I can change the resolution of the game or pass it in fullscreen.
But if I do it, the game crash with this error message

thread 'main' panicked at 'Wayland doesn't support exclusive fullscreen', /home/eragon/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.22.1/src/platform_impl/linux/wayland/window.rs:342:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

(I can run the game with RUST_BACKTRACE=1 If you need more info)
Of course there is more lines after the panic, like GL texture was destroyed

I think it's not related to rusty-shooter but more to the implementation of wayland and fullscreen inside the engine.

PS: Sure X.org and Wayland is different, and there is a long way to go before having a good support of wayland. But I think If you(because… I don't think I'm not actually ready to help more than testing the engine and reporting bug) can fix these bugs(this one, and the one related to the mouse and the keyboard input) you can have a pretty good support of wayland.

Good luck, and thank you for your work on the engine, this is amazing !

Suported 3d file format

What are the supported format, I'v seen many fbx files and png in the examples and in rusty-shooter there is also some tga, ogg and dae files.
But do you have a list of actually supported files format ?(in this crate and also in related crates, like rg3d-sound).
Do you plan to support more files format ? Like obj or jpg(if they aren't supported yet)

Use an ECS with rg3d

I'm sorry i don't know where i can ask my questions about how the engine work and other related things…

I'v look at rusty-shooter code and, I don't find any ECS related stuff, do you think It is possible to use and ECS like legion or specs(or anything else) and this game engine ?

I have another question, I want to use this game engine, I know it is not enough mature to be used in a real production, and that's exactly why i want to use it. I want to participate to this engine. Where should i start to help ?

Low fps for little geometry?

Context: I'm playing around with level generation and wanted to generate some rooms.

So I generated a map and instanced the floor tiles like this:

        for x in 0..level.map.len() {
            for y in 0..level.map[0].len() {
                if level.map[x][y] == 0 {
                    continue;
                }

                let floor_handle = floor_resource
                    .lock()
                    .unwrap()
                    .instantiate_geometry(&mut scene);

                scene.graph[floor_handle]
                    .local_transform_mut()
                    .set_scale(Vec3::new(0.2, 0.2, 0.2));

                scene.graph[floor_handle]
                    .local_transform_mut()
                    .offset(Vec3::new(20.0 * x as f32, 0.0, 20.0 * y as f32));
            }
        }

A floor tile has 8 vertices and a 16x16px texture. I'm rendering 2032 tiles in this example:

grafik

I shrunk the window down to less then a quarter of my 4k screen, so the resolution shouldn't be a problem.
Also I set the quality settings to low (no ssao, also no lights in the scene except ambient "light").

Any idea why it performs so poorly? My PC runs Witcher 3 at max details in 2k resolution at nearly 60fps, so I don't think the polygon count is a problem here. 😅

Fix renderer performance issues

There is quite significant FPS drop when rendering point shadows cubemaps. Also some sort of built-in frame profiler should be added.

Add macOS backend.

There is still no backend for macOS. This should be easy to add.

Update. Implementation notes.
Backend is a simple audio player, it has single audio source with buffer that divided in two parts. Audio renderer will fill one part of buffer, while other will play. In other words audio source must use data streaming. You can use other backends as reference, they all very simple, less than 150 lines of code.

Q: Why can't you implement it by yourself?
A: I don't have any device I can test it on, and buy one to just make a backend is not great option.

Add save/load example

Engine has built-in support for making savegames, but it should have good example of how to use it.

Add sky box

Skybox should be added for cameras. Skybox usually used in outdoor scenes to imitate sky and show distant level details which are "baked" into image.

Add verbosity levels for logger.

Right now logger may spam messages which could significantly complicate debugging if you using console for that, so there is a need to add severity for log messages and some methods that will allow you to set verbosity level or even disable messages at all.

Geometry appears too late

In this example, when running towards the tiles and turning around very fast, the floor tiles at the edge of the screen appear too late, so it looks like they disappear and load again when needed. This effect shouldn't be visible to the player.

Add occlusion culling for ligth sources

Right now distant objects that are hidden "behind a wall" are not culled, they still eats precious GPU resources. This could be fixed by implementing occlusion culling.

EDIT. For now occulusion culling should be implemented only for light sources.

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.