Questions tagged [rust]
Rust is a multi-paradigm programming language designed for performance and safety, especially safe concurrency
31 questions
1
vote
1
answer
177
views
How the intersection of BVH boxes can determine whether or not a triangle appears?
I'm programming a Ray Tracer using Rust and OpenGL, I've already made Ray Tracing work in the basics by converting the data to an SSBO and sending it to the Shader in a basic way... The problem is ...
0
votes
1
answer
88
views
What's wrong with the TBN map?
I'm trying to import 3D models into OpenGL using Rust and GLFT models, the problem is that this function used to work... Now it doesn't work at all!
It's working to load the 3D model, with the texture ...
-1
votes
1
answer
149
views
Isometric Rendering Doesn't Align
I've been starting to experiment with 2D rendering, in particular isometric rendering.
So far I've been having issues getting my tiles to line up.
I am currently writing this in Rust using the Bevy ...
1
vote
1
answer
72
views
Pan orthographic non-axis-aligned camera
I'm trying to create a panning control for a camera in bevy, but I can't seem to get the panning logic right when the camera is rotated. It works fine if the camera transform is directly facing the XY ...
0
votes
0
answers
106
views
Efficient PRNG for WASM and x86_64?
For a game I am finishing, I need a random sequence that can be generated in Wasm and in the server, yielding the same result.
This generated 64-bit(or more if supported by WASM) numbers sequence is ...
1
vote
1
answer
203
views
How do I make the joints and weights skinned with the variables I'm using?
For some time now I have been trying to do skeleton animation using Rust and OpenGL(specifically the gl library), I loaded the animation information correctly(with the gltf library), the bone ids and ...
2
votes
0
answers
138
views
How to correctly rotate 2D orthographic projection around a central point?
I want to rotate a 2D orthographic projection around the centre point of my view. However, something is off (it looks like a translation) but I'm not sure what.
To put some concrete values on the ...
0
votes
1
answer
234
views
Why might performance of a Rust-sdl2 project be better while profiling?
I'm making a simple SDL2-based Rust game, on an OSX laptop. Graphics mostly involves drawing lots of colored squares to the screen. Performance is really slow for what I'm doing, so I decided to ...
1
vote
1
answer
658
views
How to rotate 2D image in 3D space using a quaternion
I am trying to rotate a flat 2D image around a 2D origin in 3D space. The problem I am having is that the image becomes stretched after the rotation. I am using the WGSL from this tutorial, but with ...
0
votes
1
answer
324
views
How to implement movement with move speed in a multiplayer game?
I'm developing a MMO RPG using Rust and bevy both in the client and the server, which means that I'm using ECS on both sides. My game is tile based, so each tile is a point in my map in the server, ...
9
votes
1
answer
5k
views
In Bevy ECS, what is a good way to have entities reference each other?
I am wondering if there is a better way than storing the entity ID. For the sake of example, let's assume I have a world with many entities who implement the component Name. Every x amount of time I ...
0
votes
0
answers
289
views
How can I convert a raw pixel buffer (1D array) into a 2D array?
I have to deal with a raw buffer representing some pixels, specifically the pixels crate. So far I am able to do some magic from the examples, however it is terribly bad when it comes to readability ...
1
vote
1
answer
765
views
Rust lang and Cheaters
So I started to learn Rust for personal usage, i am Back-end Node.js dev originally.
And I see that people often say Rust is a very secure solution because of memory management. In theory games/...
0
votes
0
answers
631
views
How can I render a texture in a specific x/y position on the screen? (OpenGL - glium)
I am in the process of writing a 2D game in Rust, and decided to use glium for the graphics part. So far I'm doing fine, able to render textures and shapes ...
1
vote
1
answer
812
views
How to fix texture atlas border bleeding?
I am having an issue with texture bleeding, I am getting these lines that border each tile:
I have tried to solve the issue by rounding/flooring, but that does not work either.
The texture atlas has ...
0
votes
1
answer
137
views
How can I implement the player being able to place tiles on a 1d array grid?
Tell me if I need to provide more info.
My tile-based sandbox game needs to allow the Player to place tiles He has collected. But the problem is, I do not know how I can place the tile based on the ...
2
votes
1
answer
311
views
How to properly handle hundreds of layers of tiles
GOAL
I am making a top-down tile-based sandbox game, and it will have 400 layers of destroyable terrain, It will not use chunks, it will store the map in memory like Terraria, but only render the ...
1
vote
1
answer
786
views
Network mechanism for an RTS multiplayer game
I'm writing a real time strategy game in Rust. In this game each player controls one of two armies facing off on a battle zone. To better understand the gameplay, my project is an open source version ...
1
vote
1
answer
144
views
Having a Logic Error in my tile rendering code
I am a novice programmer.
In my program, I can render a 5000 x 500 map, but it renders incorrectly, instead of this :
,,~,,,,~,,,,,~,~,,,,,~~,,,~,,,~,,,~,,~~~,~~~,,,~,,,,~,~,,,~~,~,,~,~,~~,~,,,,,~,,~~,...
1
vote
1
answer
193
views
How to identify the visible tiles and select them for rendering?
I can render a 5000 x 5000 tile map, but it takes forever to load, and the performance is horrid.
It takes around 30 seconds to Render all the tiles, So how can I render only the visible tiles?
Here ...
0
votes
1
answer
991
views
How to write Perlin Noise generated data to a vector in Rust?
Tell me if i need to be more specific.
My program is advanced enough that it can read tile data from a .txt file and display a tile image for each tile ('~' = water), I am trying to make my game use a ...
0
votes
2
answers
485
views
How would I go about preparing my skybox for a z-up world orientation?
**Solved!**
Special thanks to comments from Maximus Minimus and Jherico. Scroll down for the solution made in the shader.
I am working on a vulkan renderer in rust using the ash crate. I would like to ...
1
vote
1
answer
364
views
What could be causing my texture in ash Vulkan to render lighter?
I have just completed the Vulkan tutorial using rust and the ash crate. I've been following along with this repository. I am unable to determine what is causing my textures to render lighter. If ...
0
votes
1
answer
69
views
Ponderate dijkstra relative to previous position
I use dijkstra in my rust game to find path to a destination. My game is in a square grid like this:
There is, for illustration, the Rust code which use dijkstra:
...
1
vote
1
answer
769
views
Unity ECS: Is it bad to use variable data within SystemBase?
I'm currently trying to port a flight dynamics model that I've implemented in Rust to Unity. The original FDM utilized the Hecs ECS, and I plan on implementing this same model in Unity using the ECS ...
0
votes
1
answer
289
views
Should a server run all maps in one loop, or a thread/game loop per map?
I'm working on a real time multiplayer browser-based game.
The game is top down on variable size tile based maps. There is no central map where all players come together, the entire game plays out in ...
1
vote
1
answer
468
views
SetFullscreenState not returning
When I call the IDXGISwapChain::SetFullscreenState method, it does not return. The window goes fullscreen, but accepts no further input. A ...
0
votes
0
answers
111
views
How do I colour a mesh in Kiss3d?
This is a question about the sebcrozet/kiss3d graphics engine for the Rust programming language. I have managed to create a mesh using group.add_mesh(). Now I want ...
0
votes
1
answer
497
views
Black texture when manually creating from image
I am trying to create a ID3D11Texture2D from a RgbaImage loaded from a .jpg. The below code produces no errors. However, the texture is black when it is actually ...
0
votes
2
answers
242
views
Tile based collision detection errors if player is smaller than tiles
I have implemented a tilemap where each tile is at a non-negative x and y position. (So at the moment think like chess)
At the moment a tile is 16, 16 pixels in ...
3
votes
1
answer
396
views
Render moveable entities into 3D isometric world?
I have a separate list of moveable entities, and then the regular 3D map, represented by a 2D array of stacks of tiles. My problem is that right now, I'm rendering my moveable entities after the map, ...