Git Product home page Git Product logo

Comments (11)

afonsolage avatar afonsolage commented on July 17, 2024 2

I'm adding voxel lighting to this engine like Minecraft. Since my interest is the blocky world, I'm using a Flood Fill algorithm, like this one.

I plan to make a PR to add it to godot_voxel, but probably I'll have to wait for separation between blocky and smoothy terrains #41 . Anyway, you can checkout my fork, but it is still under development.

from godot_voxel.

TokisanGames avatar TokisanGames commented on July 17, 2024 1

I don't know anything about minecraft.

This scene has 500 omnilights in it (one in each sphere which is there just to show the location) and runs at over 150fps @1080p on a GTX1060.
image

This has 170 lights spread out more so they illuminate the terrain. The large spheres are bullets, physics objects, not lights. Though they are colored themselves, you can see the colors of the lights reflect off them. This runs at over 200fps @1080p.
image

288 lights at 180fps on blocky.
image

Here I have 50 lights attached to my player and maintained over 100fps while running around. My shader does wierd things and each chunk takes on a different hue, but that's a different problem. At 100 lights attached to my player I could get 40fps while moving. Once I stopped moving fps went back up.
image

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024 1

Makes sense. I'm not familiar with the green thread term, but BlockThreadManager is just a utility to run an actual thread, or more than one. There isn't any thread pool magic, so there is a chance of thread starvation if too many of them are running.
Also, I'm doing a change to BlockThreadManager currently, to make processors accept an array of inputs and outputs so they have a chance to batch some operations.

from godot_voxel.

Zireael07 avatar Zireael07 commented on July 17, 2024

I believe this is a wrong place to ask those questions. FYI, work is underway to change Godot engine to Vulkan, which should not have those limitations any longer.

from godot_voxel.

blockspacer avatar blockspacer commented on July 17, 2024

I believe this is a wrong place to ask those questions. FYI, work is underway to change Godot engine to Vulkan, which should not have those limitations any longer.

Vulkan can`t support wasm(web/js), so Godot may have those limitations for very long time.

Anyway, is it possible to use godot_voxel in games with dynamic terrain that must have some lights (like Minecraft) or we must change game engine?

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

About the issue overall, this module is definitely not dealing in any way with dynamic lighting. That's Godot's job to support that. The only kind of lighting that could be provided here would be derivatives of baked lighting, like the one Minecraft does. I never thought about an architecture for this as I'm focusing on other areas at the moment.

@afonsolage In theory you could already test lighting with a custom generator, which would produce lit blocks when invoked. I haven't read this article yet though, I'm curious how you would handle removal of point lights. I see you use an additional processing thread, do you think it could be part of the updater one on edition? Or it has different requirements?

from godot_voxel.

afonsolage avatar afonsolage commented on July 17, 2024

What you mean by custom generator? Streams?

The reason why I created a new processing thread is because it's a different and isolated work, which can be done in parallel, but before the updater. I'm changing the blocky flow to become: LOAD -> SPREAD LIGHT -> UPDATE MESH.

But it can be part of the updater, as longer it runs before the mesh processing, since it produces the color data of vertices.

I tough it would be a good idea to have a processor for each specialized parallel work, because I'm assuming each processor is a green thread.

from godot_voxel.

blockspacer avatar blockspacer commented on July 17, 2024

Another approach

According to https://dev.gamedev.net/forums/topic/702924-what-gi-is-usable-right-now/

You can handle doors/windows in other ways. Have two versions of lightprobes near doors/windows with one for open and one for closed, or raytrace only probes that are near doors/windows with only geo primitives, and only when those doors/windows open/close, or etc.

May require ddgi support, that can be built from VCT. (For now Godot uses VCT) godotengine/godot#31405

from godot_voxel.

blockspacer avatar blockspacer commented on July 17, 2024

Thanks for responses. Issue resolved.

It is possible to use Godot and godot_voxel in games with dynamic terrain that must have some lights.

from godot_voxel.

TokisanGames avatar TokisanGames commented on July 17, 2024

Ok. Go ahead and close the issue. Thanks.

from godot_voxel.

Zylann avatar Zylann commented on July 17, 2024

Closing as the issue asks for dynamic lights wich is not the job of this module. Baked lights might be, so if needed please open another issue (although @afonsolage is already working on a baked light system).

from godot_voxel.

Related Issues (20)

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.