Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

MountainLabs

92
Posts
3
Topics
6
Followers
25
Following
A member registered Nov 08, 2021 · View creator page →

Creator of

Recent community posts

Looks  exceptional!

Thank you!

Amazing, I'm glad you like them!

Vorxel? I like the new name, its super cool.

Amazing! Can't wait to see whats next.

I thought Frozein's video was quite impressive, what exactly did you learn that changed everything?

(3 edits)

It is also strange that you say you think it is the ray origins and diretions that are not calculated correctly, (although you could very possibly be right, I wouldn't doubt it) But it is strange, because if I do a basic ray box intersection using the same ray directions and origins there is no warping at all. The warping exists entirely within the DDA algorithm I have. Here it is:


fn Sphere_DDA_March(
    start_pos: vec3<f32>,  // Starting position of the ray in world space
    end_pos: vec3<f32>,    // Ending position of the ray in world space
    voxel_size: vec3<f32>,       // Size of each voxel in the voxel grid
    bounds: vec3<i32>,     // Dimensions of the voxel grid (width, height, depth)
) -> vec4<f32> {
    var direction: vec3<f32> = normalize(vec3<f32>(end_pos - start_pos));
    var step: vec3<i32> = vec3<i32>(
    select(-1, 1, direction.x > 0.0),
    select(-1, 1, direction.y > 0.0),
    select(-1, 1, direction.z > 0.0)
    );
    var tMax: vec3<f32> = vec3<f32>(
        ((select(floor(start_pos.x / voxel_size.x) + 1.0, floor(start_pos.x / voxel_size.x), direction.x < 0.0) * voxel_size.x) - start_pos.x) / direction.x,
        ((select(floor(start_pos.y / voxel_size.y) + 1.0, floor(start_pos.y / voxel_size.y), direction.y < 0.0) * voxel_size.y) - start_pos.y) / direction.y,
        ((select(floor(start_pos.z / voxel_size.z) + 1.0, floor(start_pos.z / voxel_size.z), direction.z < 0.0) * voxel_size.z) - start_pos.z) / direction.z
    );
    var tDelta: vec3<f32> = vec3<f32>(
        abs(voxel_size.x / direction.x),
        abs(voxel_size.y / direction.y),
        abs(voxel_size.z / direction.z)
    );
    let center: vec3<f32> = vec3<f32>(15.0);
    var ray_world_coord = vec3<f32>(vec3<f32>(current_voxel) * voxel_size);
    var ray_dist: f32 = f32(sqrt(((ray_world_coord.x - camera.position.x) * (ray_world_coord.x - camera.position.x)) + ((ray_world_coord.y - camera.position.y) * (ray_world_coord.y - camera.position.y)) + ((ray_world_coord.z - camera.position.z) * (ray_world_coord.z - camera.position.z))));
    while(ray_dist < 256.0){
        ray_world_coord = vec3<f32>(vec3<f32>(current_voxel) * voxel_size);
        var world_cord = vec3<f32>(vec3<f32>(current_voxel) * voxel_size);
        ray_dist = f32(sqrt(((ray_world_coord.x - camera.position.x) * (ray_world_coord.x - camera.position.x)) + ((ray_world_coord.y - camera.position.y) * (ray_world_coord.y - camera.position.y)) + ((ray_world_coord.z - camera.position.z) * (ray_world_coord.z - camera.position.z))));
        var dist: f32 = f32(sqrt(((world_cord.x - center.x) * (world_cord.x - center.x)) + ((world_cord.y - center.y) * (world_cord.y - center.y)) + ((world_cord.z - center.z) * (world_cord.z - center.z))));
        if (dist < 60.0){
            let start_light: vec3<f32> = vec3<f32>(world_cord.x, world_cord.y + -0.5, world_cord.z);
            let end_light: vec3<f32> = vec3<f32>(world_cord.x, world_cord.y + 10.0, world_cord.z);
            let output = DDA_Light(start_light, end_light, voxel_size, bounds);
            if (output == 0) {
                return vec4<f32>(1.0, ray_dist / 100.0, 0.0, 1.0);
            } else {
                return vec4<f32>(0.75, ray_dist / 100.0, 0.0, 1.0);
            }
            
        }
        if (tMax.x < tMax.y && tMax.x < tMax.z) {
            current_voxel.x += step.x;
            tMax.x += tDelta.x;
        } else if (tMax.y < tMax.z) {
            current_voxel.y += step.y;
            tMax.y += tDelta.y;
        } else {
            current_voxel.z += step.z;
            tMax.z += tDelta.z;
        }
    }
    return vec4<f32>(0.0);
}

Firstly, positive y should be up, anything else is heresy, and what is a projection matrix? I see everybody using one, but I don't use one myself. How do they work?

Thats an interesting idea! a boss triangle!

I like the first one.

P.S. the bug is most prevalent at the poles of the sphere.
(this sphere has 6 poles where each face on a cube would be)

Thank you!

Sweet! Looks great!

How odd, why is that caused?

Thanks for the math! it looks super cool!

Very cool!

4/10 ouch!

Fabulous, very fun for a quick playthrough.

It is.

Hey this is awesome! I've spend the last 3 or so weeks changing how my engine uses buffers, and hilariously, I changed from fragment rendering to compute rendering this last week actually :) I'm glad to see your still making progress!

Laws
Copyright
Engine
AI

All of the above need to be added to the rules.
At least the engine rules and copyright.
I am not a participator I'm just making a suggestions :)
Also I like how blasphemy is against the rules, its a nice touch.

Yeah no problem, hope you had success with it. :D God bless.

Nintendo's layers rn:
Síndrome | Wiki Los increibles | Fandom

How did you manage that?

Dang, I know I should be looking at the ambient occlusion, but your voxels are so crystal clear!

Yeah I'm currently planning on open sourcing my engine. what can I say, I like free stuff, I assume everybody else does as well. royalties is a pretty fair way of doing it, personally I prefer paying for a onetime license (if just for the current version).

Bro same.

This project is so underrated.

Dang, Looks awesome.

Biggest thing I could recommend is more coherency between objects in game, don't mix voxel with low poly etc.

Wow.

Awesome thanks, both these seem amazing!

PS: Thats how I plan to get GI, I'll just have all the rays check if they hit a voxel and if so add it to a buffer of hit voxels, then just have yet another compute shader shade all hit voxels, the result of which will be per-voxel GI. (not complete GI just area wide not full world GI)

Indeed, If I run into any trouble I will ask :D I think I'll probably do the voxel raytracing first, and just have the meshing later, I'll have the voxel raytracer write to the Depth-Buffer and then just have the rasterizer compare depthbuffer distance and check if it should render that particular pixel or not. But I'll be doing all raytracing in a compute shader which will fill a texture and have that texture be read by the fragment shader later.

(2 edits)

Hey, thanks! I won't be using all of bevy, I'm going to write my own voxel renderer, I'm not a fan of how bevy does it (default rendering). So i'll just be writing my own and integrating it with the rest of the system. Its a neat game engine this project was made using only the ecs side of bevy no default renderer or other libs at all: https://store.steampowered.com/app/2198150/Tiny_Glade/ Kinda similar to what I'm doing, but with voxels.

Hmm, Whats the difference between conetracing and pathtracing? and how would you implement a cone tracer?

This looks awesome!