# What's everyone working on this week (8/2020)?

New week, new Rust! What are you folks up to?

1 Like

Last week, I finally managed to pull myself away from engine dev long enough to participate in a game jam - using Rust and Tetra, of course Quite happy with how it turned out!

This week, I'll hopefully spend some time cleaning up the project so I can open-source it - the code is fairly shambolic at the moment

4 Likes

Went through the final book in the Raytracing in a Weekend series this weekend for my raytracer shrimpray to sample with monte carlo techniques and found it really effective. As it turns out, all rays are not considered equal so adjusting the likelihood of where they bounce can make the accuracy of the image converge better.

With a basic ray tracer, the color of a pixel in an image is determined by shooting several rays at it. If the sample ray hits an object, "information" is collected like the object's color. The ray then bounces off in a random direction with a probability depending on the geometry and material of the object. When the ray is done bouncing around, the accumulated information from the samples is averaged for the resulting color of the pixel. Doing this for every pixel results in the final image on the left.

Monte carlo comes in by throwing probability density functions (PDF) onto the direction the rays bounce in. If it's more probable for rays to bounce in a certain direction, they are more likely to collect "information" from there. In the scene, the PDF's will bias rays towards the ceiling light and glass sphere because there is only darkness without light. The result is a more accurate image with the same number of samples per pixel.

9 Likes

I've been experimenting a whole bunch with what I'm referring to as Control Iterators. Basically an Iterator which returns an Rc to communicate state changes into the Iterator. You can do a whole bunch of neat stuff with this setup, directed iteration through trees, Iterators which mutate not only single values but also the structure of whatever they're iterating over, Iterators who add values, or remove values.
I've put the method to practice in Pluralize but due to the nature of the crate it has a rather large serving of jank as well.

Attempting to make a Tokio-derived crate and server app for Hotline. I've tried the chat server example, now I feel a Hotline server would be the next step up and not too ambitious. It's a fairly old protocol, anyway.

1 Like

@BradyMcd You might be interested in coroutines. I believe they're in nightly behind a flag. There are also crates that implement them without the nice syntax.

I made a simple command-line tool to detect broken and invalid links in Markdown files, broken-md-links.

Has been writing syncrhonization primitives based on OS semaphore

1 Like

Here is a pink window from the framework that I am developing. It's purpose is to create single windows with GLES(2/3) or OpenGL context. It's mainly focused on game development, so only one window is supported. For Windows, it uses WGL as interface (I might add that I am working on supporting EGL for Windows, too), for Linux it uses EGL or GLX, and the window backend can be selected on run-time to Wayland or X11.

Here is the code to create a window (error handling and GL stuff removed for brevity):

``````let mut running: bool = true;
framework::reset_configuration();
framework::configure_window_resizable(true);
framework::configure_window_size(320, 180);
framework::configure_graphics_interface(framework::GRAPHICS_INTERFACE_EGL);
framework::configure_graphics_backend(framework::GRAPHICS_BACKEND_GLES3);
framework::initialize_window();
framework::window_show();
framework::window_set_swap_interval(1);
while running {
while framework::poll_event() {
let event_type = framework::event_get_type();
if event_type == framework::EVENT_TYPE_RESIZE {
} else if event_type == framework::EVENT_TYPE_POINTER_ENTER {
} else if event_type == framework::EVENT_TYPE_POINTER_LEAVE {
} else if event_type == framework::EVENT_TYPE_CLOSE {
running = false;
}
}
framework::window_swap_buffers();
}``````
1 Like

I'm working on getting `wgpu` to run on OpenGL on Linux. I've never worked with graphics APIs or graphics code before so it is going surprisingly well.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.