fyroxengine / fyrox Goto Github PK
View Code? Open in Web Editor NEW3D and 2D game engine written in Rust
Home Page: https://fyrox.rs
License: MIT License
3D and 2D game engine written in Rust
Home Page: https://fyrox.rs
License: MIT License
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.
winit
has key input issue on macOS: rust-windowing/winit#1470
It says that macOS Accesibility prevents key inputs from going as DeviceEvent
s. 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
.
rg3d-physics should be improved to support rigid body dynamics.
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.
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.
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.
High dynamic range rendering (HDR) should be added.
Most parts of engine are not documented yet, this should be fixed.
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?
Example of how to use sound must be added.
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.
Animation blending machine is very powerful tool to create complex animations, but it is hard to use properly without good example.
Resource manager still lacks proper async/.await support, this must be fixed.
#23 is part of this issue.
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.
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.
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
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:
println!
at the beginning. The print is called correctly, but the sound still seems to loop quickly despite me explicitly setting it not to.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!
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 ?
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
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.
Hi there! I think it'd be better to make [https://docs.rs/rg3d/0.11.0/rg3d/engine/resource_manager/struct.ResourceManager.html#method.request_texture_async](this method) supports rust async/await
.
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.
Shadow maps renderer still does not use instancing, this must be fixed.
Basic example can be extended to simple game - probably something like simple exploration game.
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)
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.
Since rg3d-physics will be removed, custom linear algebra should be replaced with nalgebra to remove redundant conversion of vectors, matrices and stuff back and forth.
Engine still lacks PBR, it should be added.
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.
Resources should be loaded asynchronously, there is already experimental async loading of textures, but still no support for async loading of model and sound resources.
Engine has powerful UI library, but there is still no good examples of how to use it, this should be fixed.
There is quite significant FPS drop when rendering point shadows cubemaps. Also some sort of built-in frame profiler should be added.
Engine has built-in support for making savegames, but it should have good example of how to use it.
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.
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:
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.
What are the current capabilities and plans for multiplayer support? Will there be a multiplayer demo?
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?
Hey, thanks for you crate! Are there any documentations?
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.
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 !
alsa backend sometime spam errors in output (buffer underrun), this should be fixed.
As I understand it is more convenient if you are developing this alone, but this will improve time to dive into you engine.
Love it by the way!
I can send a PR if you don't have any objection.
Currently there is only one example and it is broken. Add more examples for each aspect of engine.
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 ?
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.
rg3d-physics provides very basic physics and should be replaced with rapier.
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:
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. 😅
Renderer should have LOD system, each Mesh scene node must support array of LOD resources.
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.
I saw that there was some GLSL involed and just wanted to tell you that Embark studios is working on a GLSL Rust replacement.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.