Jesse Hughes
Jesse Hughes
  • 4
  • 15 321
Bonsai Voxel Engine Devlog 1.5.2 :: Renderer Performance Update
github.com/scallyw4g/bonsai
discord.com/invite/kmRpgXBh75
#voxel #voxelart #gameengine #engine #voxelengine #voxels #magicavoxel #bonsaivoxel
Переглядів: 1 547

Відео

The Editor Update :: 1.5.0 :: Bonsai Voxel Engine Devlog
Переглядів 6 тис.2 місяці тому
github.com/scallyw4g/bonsai discord.com/invite/kmRpgXBh75 #voxel #voxelart #gameengine #engine #voxelengine #voxels #magicavoxel #bonsaivoxel
Devlog 0 -- Bonsai Voxel Engine
Переглядів 6 тис.2 місяці тому
github.com/scallyw4g/bonsai discord.com/invite/kmRpgXBh75 #voxel #voxelart #gameengine #engine #voxelengine #voxels #magicavoxel #bonsaivoxel
I Built a Level in my Custom Voxel Engine
Переглядів 1,2 тис.3 місяці тому
github.com/scallyw4g/bonsai discord.com/invite/kmRpgXBh75 #voxel #voxelart #gameengine #engine #voxelengine #voxels #magicavoxel #bonsaivoxel

КОМЕНТАРІ

  • @Canilho
    @Canilho 15 днів тому

    I really wish to understand these things a bit better. I have programmed in so many different things and my knowledge about openGL is not much more than when I left University as I've never used it for anything but personal experiments. I really would like to understand it better tho. I am also a big fan.of shaders, but it's something I have picked up a few times, but also have not look up too deep into it.

    • @scallyw4g
      @scallyw4g 15 днів тому

      The good news is that, for me, this project started as just a personal experiment. Fast forward a bunch of years and it's actually a thing now! Just keep at it, you'll get better :D

  • @khrob
    @khrob 16 днів тому

    What are you using to edit? I know a bunch of folk who use Da Vinci Resolve and swear by it.

    • @scallyw4g
      @scallyw4g 16 днів тому

      Yeah a few people recommended that one already, thanks!

  • @benrex777productions9
    @benrex777productions9 16 днів тому

    I have never heard of Nsight before. That seems like a useful tool. Although in my case I haven't needed it so far. But it is good to know that it exists. When it comes to video editing I just bought the microphone Shure PGA27 which a sound technician recommended to me, I have a nice mic stand and I use DaVinci Resolve. I have a pretty bad ear when it comes to noisy, poppy or distorted audio. So I just went with something that is sure to work and ignored it from then on.

    • @scallyw4g
      @scallyw4g 16 днів тому

      Yeah NSight is pretty useful for profiling. There's also RenderDoc which some people like better for debugging, but NSight is the best profiler IMO Thanks for the recommendation!

  • @LoginusLagonow
    @LoginusLagonow 16 днів тому

    See system microphone settings. Pay attention to two settings : - sampling frequency, the best setting should be the value you use in the video (it will probably be 44.1 kHz, but Windows has a default setting of 48 KHz - this may be the first cause of the problem). - make sure that you do not have "increasing microphone performance" enabled, very large values of this parameter will overdrive the value and there will be crackling noises. From the audio editing side - in the editing program, select whether fragments should always be cut at the zero crossing point, or select the transition between fragments to be gradual. - Some programs have the function of catching crackles and noise and reducing it. You can try the "DaVinci Resolve" program. If the crackling occurs only when speaking, wear a cloth at some distance from the microphone.

    • @scallyw4g
      @scallyw4g 16 днів тому

      11/10 comment, thanks for the tips! The popping gets introduced by the audio codec (or something) in the editing software I use. The mp3s I record are smooth when played back through VLC, but when I cut them together they start popping. I'll check DaVinci Resolve out, thanks again!

  • @benrex777productions9
    @benrex777productions9 20 днів тому

    So, now I'm subscribed to you with my correct UA-cam channel. I like those brush implementations. Could you make a video with your game idea? It sounds like you have ambitious plans.

    • @scallyw4g
      @scallyw4g 20 днів тому

      Thanks! I'll try to remember to talk about the game ideas I have more. IDK if they warrant a whole video at this point though :)

    • @benrex777productions9
      @benrex777productions9 20 днів тому

      @@scallyw4g No problem. Do everything at your own pace. That's the nice things of devlogs. As long as you make some progress you are still among the more productive people and you will have some audience.

  • @benrex7775
    @benrex7775 20 днів тому

    Does biweekly mean twice a week or every two weeks. :D

    • @scallyw4g
      @scallyw4g 20 днів тому

      I meant every two weeks -- life's gotten in the way of this project for the last few weeks; I moved and I'm on a trip to Thailand right now, but I'm almost through the next big changeset I'm going to do before I make another video. Should be Soon™

  • @KabelkowyJoe
    @KabelkowyJoe Місяць тому

    5:00 Instead of message just hook yourself to keyboard and don't allow anyone else to grab keystrokes? Keyboard Hook Example, HHOOK llkbdhhook; LRESULT LowLevelKeyboardProc(INT nCode, WPARAM wParam, LPARAM lParam) { if (nCode!=HC_ACTION) {return CallNextHookEx(llkbdhhook,nCode,wParam,lParam); } //Here you put your stuff register BOOL fProcHandled; // helper variable, keyboard was handled register KBDLLHOOKSTRUCT *pkbdllhook = (KBDLLHOOKSTRUCT*)lParam; // Ctrl, Alt, Tab, activate Tab if Ctrl+Alt was pressed, don't clear Ctr, Alt state, other keys clears that state if (wParam==WM_KEYDOWN) { switch (pkbdllhook->vkCode) { case VK_LCONTROL: // CONTROL triggered down event KeyPressed.Ctrl =true; goto KBRETURN; break; case VK_LMENU: // ALT triggered down event KeyPressed.Alt =true; goto KBRETURN; case VK_TAB: // TAB trigger down KeyPressed.Tab = true; if (KeyPressed.Alt==true && KeyPressed.Ctrl==true) goto CTALTTAB; else goto KBRETURN; // allow other programs handle that key whatever it was default: if (KeyPressed.Alt==true && KeyPressed.Ctrl==true) goto SHORTCUT; // if Ctr + Alt was pressed handle shortcuts else goto KBRETURN; // if not just allow other programs handle that break; }} else { // Ctrl, Alt lub Tab i KEY UP UP UP UP RELEASED, clear variables and allow others to handle keyaboard if (wParam==WM_KEYUP) switch (pkbdllhook->vkCode) { case VK_LCONTROL: // CTRL KeyPressed.Ctrl=false; if (KeyPressed.Locked==true) goto CTALTTAB; else goto KBRETURN; case VK_LMENU: // ALT KeyPressed.Alt =false; if (KeyPressed.Locked==true) goto CTALTTAB; else goto KBRETURN; }} //------------------------------------ KBRETURN: //allow others to read that, unhandled return CallNextHookEx(llkbdhhook,nCode,wParam,lParam); //------------------------------------ CTALTTAB: // CTRL ALT TAB CASE handled by some function within program, don't clear CTRL+ALT, allow TAB to be sequencially pressed, and trigger calling for some function each and every time fProcHandled = WindowSwitcherProc(pkbdllhook->vkCode,wParam); if (fProcHandled) { return true; // if handled return true } else CallNextHookEx(llkbdhhook,nCode,wParam,lParam); // if not allow other programs to handle that //------------------------------------ SHORTCUT: // CTRL ALT + ANY OTHER KEY clear the CTRL ALT once it's handled fProcHandled = ShortcutProc(pkbdllhook->vkCode,wParam); if (fProcHandled){ KeyPressed.Ctrl== false; KeyPressed.Alt = false; // clear the global variables, return, true handled return true; } else CallNextHookEx(llkbdhhook,nCode,wParam,lParam); // unhandled allow other programs to handle return false; default return, of this callback wasnt handled } //--------------------------------------------------------------------------- ///Helper for callback, define shortcuts pressed once, require CTR+ALT to be pushed again, if handled, contrary to section where Tab was handled that one allowed multiple strokes while user kept CTR+ALT pressed down, there two types of "helpers" here. LRESULT ShortcutProc(INT aCode, INT aEdge) { //------------------------------------ static DWORD last_time = time(NULL); static DWORD current_time; //------------------------------------ current_time = time(NULL); if (current_time - last_time > 60 * 100) { // you can filter out multiple key presses too fast, } //------------------------------------ // Here define what each key press do, allow if Alt, Ctrl was pressed not released, while your windo was active, your windo was first in hook chain switch (aCode) { //------------------------------------ case VK_END: // kill application on top //------------------------------------ if (Desktop->Action(KILL_PROCESS,GetForegroundWindow(),0,0)) Tips_form->Execute("PANEL->Process: KILLED!",true,false); return true; //------------------------------------ case VK_F1: // show help window case '1': // 1 case 'X': // X CTR + ALT + X } return 0; // ZERO FALSE to ALLOW other programs handle Or return true to confirm key being handled } // Initialize all stuff WINMAIN WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { HANDLE hMutex = ::CreateMutex(NULL,TRUE,"sstsoft::mutex::Panel.VCL"); if (GetLastError()==ERROR_ALREADY_EXISTS) {return MessageBox(0,"Running multiple copies is not allowed", "YOur appli cation", MB_OK|MB_ICONERROR|MB_SYSTEMMODAL); } //------------------------------------ KeyPressed.Ctrl = KeyPressed.Alt = KeyPressed.Locked = false; // Hook activated! llkbdhhook = SetWindowsHookEx(WH_KEYBOARD_LL,(HOOKPROC)LowLevelKeyboardProc,(HINSTANCE)HInstance, 0); // mousehook = SetWindowsHookEx(WH_MOUSE,(HOOKPROC)MouseProc, (HINSTANCE)HInstance, 0); // cwphook = SetWindowsHookEx(WH_CALLWNDPROC,(HOOKPROC)CallWindowProc, (HINSTANCE)HInstance, 0); // file hook is also possible don't have example, never tested, WaitForMultipleObjects is better anyway so.. //do whatever you want /// cleanup UnhookWindowsHookEx(llkbdhhook); CloseHandle(hMutex); }

    • @KabelkowyJoe
      @KabelkowyJoe Місяць тому

      Just copied from oooooold program i wrote yeears ago. CallbackProc is your function called by Windows, Tab, can be any other key such as +,- or whatever. ShortuctProc is your helper special case when just one key stroke is allowed require Ctrl+Alt to be released. Each time. Working but saddly require permission, manifest and all that UAC things since Vista, this kind of hooking not only allow handle keyboard also mouse, windows, and even files before such event is sent to another program basically work as (antivirus) or virus :> Most of old games had been using this as main way to grab geys, insted of message. Because allow grab keys even if you application window is hidden. Very special way to grab keys. Manifest is just bunch of XML code attatched to RC file to require UAC to ask user for permission. That wont work for regular user..

  • @TheMechanicalCoder32
    @TheMechanicalCoder32 Місяць тому

    Which features are you most excited / most ambitious in implementing for your engine in the far future?

    • @scallyw4g
      @scallyw4g Місяць тому

      Far future? Good question. I kinda take it one day at a time. In the near term I'm going to do a render-distance improvement pass and optimize the renderer somewhat. In the medium term (< 1year from now) I'm going to do GI, which I'm quite looking forward to. Other than that, I guess the thing I'm looking forward to the most is making a game with it :D

  • @neropatti
    @neropatti Місяць тому

    The discord invite in the description has expired :b

    • @scallyw4g
      @scallyw4g Місяць тому

      Oops, thanks! Fixed

  • @hatac
    @hatac Місяць тому

    Early keyboards had three functions per key; lower case, upper case and ALT. Newer keyboards moved these Alt functions to the function bar, F1 to F 12, the special keys and the number pad. So the Alt coding is still set to wait for those functions even though we have new keys for them. Most game code just overrides it but your starting from scratch.

  • @Skeffles
    @Skeffles 2 місяці тому

    This looks fantastic!

  • @benceblazsovics9123
    @benceblazsovics9123 2 місяці тому

    just do a relaxing 15min video about building a giant castle next time. it's so satisfying to watch :D also will you ever do other meshes than whole voxels? and will you ever randomize face normals a bit for extra detail?

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Yeah I liked doing a timelapse too -- I'll do more of those in the future :) The engine does load OBJ meshes, although they don't really interact with the world in any real way. TBD if I'll do anything fancier there. Maybe if I get a random stroke of inspiration one day. I've not thought about randomizing face normals (I assume you mean by slightly skewing them, not really randomizing). There are facilities for calculating smooth normals from the noise functions that generate the world, but that data doesn't get stored at the moment. Might see if I can pack it down small enough to store per-voxel normals in the future.

  • @kovoneka
    @kovoneka 2 місяці тому

    I see these ::, i know the language you've written it in.

  • @chucksneedmoreland
    @chucksneedmoreland 2 місяці тому

    could you explain a bit more on how the lattice coordinates work in relation to the voxel coordinates?

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Sure thing. So, the noise lattice can be any arbitrary size. It's just the distance in world coordinates (voxel coordinates) the lattice points are from one-another. The 'one weird trick' is that you can operate in lattice-relative coordinates. That is, you only care about the distance from the previous lattice coordinate (or surrounding lattice coordinates) to the current voxel you're computing a noise value for. You can do a lot of the work in integer to compute those offsets, then go to float right at the end when computing a 0-1 value (how far along the range of the lattice you are) at the very end. I'd link to the code, but I'm pretty sure it's unintelligible because there's a bunch of other junk mixed in with it. I'm going to work on more world-gen stuff next, and if this works out well I'll do a video and/or blog with specifics

    • @chucksneedmoreland
      @chucksneedmoreland 2 місяці тому

      @@scallyw4g thanks for the explanation

  • @Reviire
    @Reviire 2 місяці тому

    This is really cool! What's the performance like right now, in regards to things like several random edits to the voxel data, sequential edits to the data, etc?

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Good question, and thanks! WRT. editing performance, I'd qualify it as reasonable. It's certainly usable for my purposes. If you're doing small regions of a few thousand voxels, it's a frame or two of latency. You can edit regions of up to about 100k voxels with barely-perceptible latency .. a million takes somewhere in the range of half a second. The overall renderer performance is also .. okay. I've got a laptop with a 3070 and on small-ish scenes it runs at about 100fps. This video was recorded on a 30hz monitor, so the framrate's locked at 30fps. The next big job I'm doing is to overhaul the renderer and world storage situation, which should improve this by quite a bit. I'd like to hit 240fps on middle and low-end cards for modest scenes, which I think is pretty achievable.

  • @samuelhulme8347
    @samuelhulme8347 2 місяці тому

    I’m just pleased this is open source. There are great voxel engines on UA-cam however most of them are not open source - so not useful. You’ve got a new subscriber.

  • @novadea1643
    @novadea1643 2 місяці тому

    Back when mouses weren't common the Alt key was used to switched focus to the menu and back (still does for most applications), which I'd guess is where the VK_MENU keycode comes from. Also the menu shortcuts used Alt + some character from the menu command (marked with & in front in the command name, which Windows automagically underlines and uses for the shortcut) eg. Alt + S for &Save, which I'd guess is the reason for the WM_SYSKEYDOWN/UP messages. Depending on how you're creating the window you should be able to disable the system menu eg. if you're using WS_OVERLAPPEDWINDOW that includes WS_SYSMENU.

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Interesting, thanks for sharing :D

  • @Woltvint
    @Woltvint 2 місяці тому

    Looks fantastic!

  • @Tuhin-it1xo
    @Tuhin-it1xo 2 місяці тому

    which language i need ? to use your voxel engine. It's great

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Thanks! The engine's written in C++ You can download the latest prebuilt binaries from here if you just want to play around with it github.com/scallyw4g/bonsai/releases/tag/v1.5.1-rc1 Or compile from source; directions in the readme github.com/scallyw4g/bonsai

  • @varand7
    @varand7 2 місяці тому

    This looks so cool! The surface brush can make some nice ruins. Btw, maybe a long shot, but your code style kinda reminds me of handmade hero. Have you done that by any chance?

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Thanks! Yep, definitely watched every episode of HMH

    • @varand7
      @varand7 2 місяці тому

      @@scallyw4g Awesome! I'm still very far from that. But great to see projects using that style in the wild

  • @SandyMHughes
    @SandyMHughes 2 місяці тому

    It's looking great so far!

  • @dottedboxguy
    @dottedboxguy 2 місяці тому

    that seems pretty damn cool ! can't wait to see where it goes

  • @Sylfa
    @Sylfa 2 місяці тому

    When it comes to being backwards compatible with your data files you *can't* go wrong looking at how Blender does it. Similarly to what you described, it saves a descriptor of what fields goes in which offset. Then it just stores the data right from memory to disk, and maps which memory address maps to which file offset. Afterwards, you can just parse the descriptor, deal with any missing data caused by new features, and correct the pointers. Oh, and correct endianness if necessary. They "recently" made some breaking changes, but prior to that you could still open a file saved in the first alpha version in the latest version. It cares a bit more about being fast at saving though, since you do that a lot more than you load your work. If you want to make loading faster some of the work could be done on save instead.

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Awesome comment, thanks! Yeah I think saving the descriptor alongside the data is pretty much the only way to go. I guess there's probably some nuance there depending on what the application goals are, but AFAIK it's what most serialization libraries do.

  • @GabeRundlett
    @GabeRundlett 2 місяці тому

    I really admire your speaking skills! That's something I struggle with a lot.

    • @LegoDinoMan
      @LegoDinoMan 2 місяці тому

      Whoa! A voxel legend, I hope you're having a good day! I feel like you do a great job speaking

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Thanks man :) If I'm being honest, these videos have taken an embarrassing number of tries to get done ..

  • @TheQxY
    @TheQxY 2 місяці тому

    Nice. The white noise brush would be more useful with a density slider (noise threshold) and maybe an option to "blur" by introducing a Guassian to the noise threshold.

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Yep, there's a threshold slider :) Gaussian blurring is harder because there's no closed-form equation for a gaussian blur; the result relies on the surrounding values. The next-best thing would probably be a small-period value noise, which I'll probably add in the future.

  • @7Dev.
    @7Dev. 2 місяці тому

    I remember when I first started using linux as my main os, my middle mouse button didn't work. I tried changing everything in the os to make it work, it ended up being the mouse itself 😅

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Hah, that's good. I one time had a machine that would very occasionally type a random character out of nowhere. Turned out, I had a bluetooth keyboard in my closet that I'd forgotten about with some stuff sitting on top of it that would very infrequently shift (ghosts something something?). This went on for months before I finally figured it out. I have no idea how the battery in that thing lasted for so long.

    • @7Dev.
      @7Dev. 2 місяці тому

      @@scallyw4g I would have never figured that out ☠️

  • @niuage
    @niuage 2 місяці тому

    Starting to look real good :)

  • @ethangore8697
    @ethangore8697 2 місяці тому

    Your brush system looks really nice

  • @lopsidedpolygon
    @lopsidedpolygon 2 місяці тому

    🎉💜🤍💜🤍💜🤍

  • @7Dev.
    @7Dev. 2 місяці тому

    I like how the noise is global, different structures connect in a pretty way

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Good eye. That property turns out to be particularly useful.

  • @reevesmcmemes1824
    @reevesmcmemes1824 2 місяці тому

    I dont expect a tutorial or anything but do you think youll go into technical details with these devlogs? Looks pretty promising!

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Yeah I'll probably do a mix of kinda artsy ones and technical ones, depending on what I'm working on at the time.

  • @lopsidedpolygon
    @lopsidedpolygon 2 місяці тому

    This is the... sixth? eighth? novel voxel engine devlog channel youtube has pushed on me in the last 30 days 😂 Keep up the amazing work! subscribed and notified! 💜🤍💜🤍💜🤍

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Thanks! Yeah there are a fair few people doing cool stuff with voxels these days. I'm excited for the day we finally get something like VoxelQuest for realz :D

  • @-aaa-aaa
    @-aaa-aaa 2 місяці тому

    YES! Good stuff!

  • @the_speedy_dog6808
    @the_speedy_dog6808 2 місяці тому

    wow!

  • @energymass7944
    @energymass7944 2 місяці тому

    for a second I read it as "Bisexual voxel engine"

  • @darkener3210
    @darkener3210 2 місяці тому

    This looks really cool Ill be happy to follow this (But please fix the mic popping T-T)

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Yeah, the video editor I used introduced a lot of artifacts when I cut the audio up. If I can't find a way to get it to cooperate in the next one I'll have to find a different video editor.

  • @AllenMikhailov
    @AllenMikhailov 2 місяці тому

    This is so coool :)

  • @GameDevSkittles
    @GameDevSkittles 2 місяці тому

    Great video! Subscribed.

  • @gwentarinokripperinolkjdsf683
    @gwentarinokripperinolkjdsf683 2 місяці тому

    3:45 Man I almost did something like this myself, it's a shame that it's so difficult to do this

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Yeah, without the metaprogramming language I made it would be a giant pain in the ass.

  • @lockyaw
    @lockyaw 2 місяці тому

    I think you copied your previous description, because the link to the GitHub repo doesn't actually work.

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Thanks! I don't know why it's doing that; I had to shorten it to get it to display properly. Maybe it's cause the channel is small?

  • @keinname1135
    @keinname1135 2 місяці тому

    The GitHub Link to the latest version is cut off ^^

  • @anzhel3268
    @anzhel3268 2 місяці тому

    void* extravaganza

    • @scallyw4g
      @scallyw4g 2 місяці тому

      Hah, yeah. Those functions are callbacks, so it's not a huge problem, but it's also .. not my favorite.

  • @Finding_Fortune
    @Finding_Fortune 2 місяці тому

    The engine is looking great!

  • @LukeSchoen
    @LukeSchoen 3 місяці тому

    Dude too much fog! :D But really really cool engine!

    • @scallyw4g
      @scallyw4g 3 місяці тому

      Hahha, yeah I've turned it down since I made the video. And thanks :D

  • @Finding_Fortune
    @Finding_Fortune 3 місяці тому

    Very pretty, nice work!