VoxelRifts
VoxelRifts
  • 11
  • 667 422
Why are if statements in shaders heavily discouraged?
This video was sponsored by Brilliant
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/VoxelRifts . The first 200 of you will get 20% off Brilliant’s annual premium subscription.
If you've done shader programming before, you might've heard people say that you shouldn't use if statements or any other conditional branching statements in shaders. However, it might not be obvious why exactly this is the case, especially because people don't say the same for regular CPU side programming. In this video, we go through why this is the case, along with covering why GPUs are so much faster than CPUs at certain tasks.
Discord: discord.gg/8rtYjQkqDF
#gpu #branching #lowlevel
Переглядів: 4 651

Відео

Restarting my game and finishing an MVP
Переглядів 1,7 тис.7 місяців тому
Remember those 2 terribly made devlogs I made last year? yeah me neither. But that game still bugged me, because I genuinely thought (and still think) it is a good idea for a game. So I gave myself 1 week to finish a dumbed-down mvp. (It obviously took a month lol) This video was sponsored by Brilliant To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/VoxelRi...
Making a calculator from scratch - #SoME3
Переглядів 29 тис.9 місяців тому
Disclaimer: This video is rather programming heavy at points. You are welcome to skip these parts, but do note you might miss some small detail somewhere. These sections have the "Code:" prefix in the timestamps. Evaluating math expressions is not an easy problem to solve, despite seeming extremely simple. This video is a step by step guide to doing so, taking you through the motivations behind...
Making a Chip-8 Emulator
Переглядів 10 тис.11 місяців тому
(New Discord server!) My Discord Server: discord.gg/8rtYjQkqDF I made a Chip-8 Emulator/Interpreter from scratch in C and this video showcases a few interesting tidbits from this project. Repository: github.com/PixelRifts/chip8-sim Chip-8 Technical Reference: devernay.free.fr/hacks/chip8/C8TECH10.HTM (You may have noticed the intro animation for "Byte Sized". This is technically the first video...
Compilation, Libraries and the pesky "unresolved external symbol" error
Переглядів 4,9 тис.Рік тому
Understanding the Compilation Process is very important for anybody trying to get into compiled languages like C, C , Rust, etc. This is a video highlighting how this process works. We start by going over the linker, symbols and object files, and using this as context for understanding different types of libraries: Static and Dynamic. Discord: discord.gg/8rtYjQkqDF Relevant Links: Just google i...
Arenas, strings and Scuffed Templates in C
Переглядів 72 тис.Рік тому
A video made to highlight some strategies and tips for making using C easier Discord: discord.gg/8rtYjQkqDF Relevant Links: Arenas: www.rfleury.com/p/untangling-lifetimes-the-arena-allocator www.gingerbill.org/article/2019/02/08/memory-allocation-strategies-002/ Base Layer Series: www.youtube.com/@Mr4thProgramming My Data Structure Implementations: (Completely standalone if you remove the stabl...
My 2 Year Journey of Learning C, in 9 minutes
Переглядів 533 тис.Рік тому
This is a short video about my journey from not understanding C in the least to being able to make a relatively large codebase. Discord: discord.gg/8rtYjQkqDF Links to Projects/Resources mentioned in the video: Crafting Interpreters craftinginterpreters.com/ My Custom Programming Language Transpiler (Rift) - V1 branch: github.com/PixelRifts/Rift/tree/v1 Tool Installer: github.com/Indie-Toolbox/...
A Quick, Easy and Extendable OpenGL Renderer in 250 LOC!
Переглядів 7 тис.Рік тому
A Video Guide to writing an easy to build, use and extend Rendering API in OpenGL. Pretty much perfect for small scale games! I'm using C, but there's pretty much 0 C-specific stuff here. You are welcome to follow along in any language. (You may need to pause at times. SORRY! I'm still new to youtube!) Discord: discord.gg/8rtYjQkqDF Links: For the Full Code written in this video, check src/rend...
A Basic Guide to Debugging OpenGL
Переглядів 3,4 тис.Рік тому
Debugging OpenGL is hard. This video outlines a few methods and tips for Debugging OpenGL. We start with The Debug Context, RenderDoc, and then some general tips for some common cases. Discord: discord.gg/8rtYjQkqDF Links: www.khronos.org/opengl/wiki/Debug_Output renderdoc.org/ Music: It Came Upon a Midnight Clear by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. cr...
Debug Rendering, Collisions and the Map --- Arena Battler / Roguelike Devlog 2
Переглядів 891Рік тому
Devlog 2 for the "Arena Battler / Roguelike Game based on Gems" I implement Debug Rendering, Collisions, and Entity system and a custom Map Generation algorithm #devlog #roguelike #mapgen
Planning, Rendering and Easing --- Arena Battler/ Roguelike Devlog 1
Переглядів 1,8 тис.Рік тому
Devlog 1 for an "Arena Battler / Roguelike Game based on Gems" I start planning out the ideas for this game, implement rendering and talk about easing functions #devlog #roguelike #easing

КОМЕНТАРІ

  • @xarcaz
    @xarcaz 3 години тому

    Any plans on re-recording this with a decent mic?

  • @ethanbuttazzi2602
    @ethanbuttazzi2602 27 днів тому

    in the end there the "how can i write the best possible thing" vs "how do i make this thing first then make it better" relly depends on the project, with c its relly easy to do the second since you dont have as much potential spagetthi to deal with, but this mindset in something like java or c# could relly make it far harder to maintein in the long run, which are what OOP languages do best, they are by far the best paradigm when it comes to scalability.

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

    Having studied both C (self-taught) and chemistry (at Uni) I totally approve of what I see here :)

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

    Can't you just iterate through the filename comparing to the ascii code for the . ?

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

      The problem isn't *finding* the dot, it's splitting the string at the dot. After finding the dot if you need a separate string representing just the filename, you'd have to replace the dot with a null terminator, which will break the string representing the entire filename with extension

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

    VOXEL IS THAT YOU FROM THREE'S DISC

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

    C is the best for any beginning developer.

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

    Now try (CUDA)Fortran and ANSI Common Lisp.

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

    hash tables again when you should use stdlib qsort and bsearch

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

    I love you! because I love low-level schtuff and so do you!

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

    Thank you for your video. Are you working as a C programmer now?

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

    Probably a weird question But do You guys consider worth it to become a good C Developer? With the current job market it seems we have over abundance of web devs and high level programmers So I thought it may be a good idea to switch to low level, because I always hear people's dislike of it. Maybe i'm ranting too much tho

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

      I'd say it is definitely worth it. Not for C specifically but because of the low level understanding you get as a result of learning C. In general any low level language and sufficient curiosity is good imho

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

    beautiful, not boring video. Thanks for sharing.

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

    Great video mate, videos like these keep my spark up, thanks for this ❤

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

    No matter what the language, this is a must to learn, it is said that the process control: sequence, cycle, selection, can solve all the problems in the world. Of course, only understanding the flow control can truly understand the program! 1. Sequence: Normal statement execution, from top to bottom. 2. select :if or select... 3. for while...

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

    You do know that you can call C code from Java and get the best of both languages

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

    I just saw PrimeTime's video where he reacts on this exact video And I got this on my yt feed now

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

    Shouldn't you be passing a size to the arena? Seems like a small string is gona take diffrent sizes tha. The full thing

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

    Your approch and projects are wonderful! I really enjoyed the video

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

    why no captions?

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

    9:35 `void type##_slice_subslice(...);\` "void"? Are you sure about that? [0] 9:50 `type##_slice_subslice(slice, idx)` Are you sure about that? [1]

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

      Yep, yep, that was a mistype

  • @69k_gold
    @69k_gold 3 місяці тому

    While watching videos like this, I feel like I was the only one in the whole undergrad world who got into CS without a massive headstart

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

    What library did you use for implementing graphics in your chemistry projects? BTW thanks for this video, very informative, very inspiring

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

      No library used there, I loaded opengl function pointers directly. Also, thanks :)

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

    Thx for sharing free resources and channels rather than promoting paid content

  • @user-dl2kk1cb8e
    @user-dl2kk1cb8e 3 місяці тому

    i like the colorscheme and font , names ?

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

      Font is inconsolata, the colorscheme is Ryan fleury's which is modified from the theme Casey uses for handmade hero. I don't think it has a name.

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

    That is so good 👍.

  • @truck.-kun.
    @truck.-kun. 3 місяці тому

    This is like intro to High Performance Computing! This video is so informative. loved it

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

    This is really cool! I usually dislike rotated pixel art but you've done a great job keeping it cohesive 🎉

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

    I want to do this in WarioWare D.I.Y.

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

    *

  • @Little-bird-told-me
    @Little-bird-told-me 3 місяці тому

    try zig

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

    Is a linear allocator… just a stack?

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

      Can be implemented as one easily yeah!

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

      @@voxelrifts wait i dont get it. is the normal rsp thing with a push instruction that most CPUs give you by default an arena allocator?

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

      @@gorenbk Well not exactly, an arena is an arena if you free the memory all at once. If you want to pop off memory it wouldn't be an arena, but instead it'd be a stack allocator. Also I wouldn't call push/pop instructions "allocator functions" at all.

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

    bro voice so soothing

  • @Little-bird-told-me
    @Little-bird-told-me 3 місяці тому

    I read K&R and I know little bit of C, now i hear about zig and odin and wonder if they are a better version C, or should I learn C and then move on to zig

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

    Much enjoyed and shared this with my students. I actually started out many years ago with C++ but I'm enjoying C more and more, especially teaching it. Cheers

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

    What IDE and tools do you use for programming and debugging C? I'd love to hear more about that.

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

      He is using Visual Studio 2022 with its built-in debugger and build system. And Microsoft Visual C++ (MSVC) compiler.

  • @CorpoWolf
    @CorpoWolf 4 місяці тому

    😢 I wanted you to say what you used for the visualization program. Was it C with GLFW / GLAD, was it SDL2, was it Raylib? What was it ;c

    • @voxelrifts
      @voxelrifts 4 місяці тому

      None of the above! It was C with my own base layer which was pretty rudimentary and bad at the time.

    • @CorpoWolf
      @CorpoWolf 4 місяці тому

      @@voxelrifts How did you make it display anything on the screen? OS libraries? I think this is the first time I've heard about writing your own base layer. Didn't know it was even possible.

  • @yash1152
    @yash1152 4 місяці тому

    9:09 "use preprocessor" oh no, sh** u* 🤦‍♀️🙄🤮🤬

  • @aligharaibeh3761
    @aligharaibeh3761 4 місяці тому

    Your videos are calm and nice💐

  • @agustinpizarro
    @agustinpizarro 4 місяці тому

    Try nim or zig ....

  • @romzeek
    @romzeek 4 місяці тому

    Hello, friend. Could you please add subtitles? I'm kind of deaf

  • @yaroslavpanych2067
    @yaroslavpanych2067 4 місяці тому

    All basic things that you ever need are included. If you think that something is not included, that is 99.999999999999% is not basic things. If you keep thinking that way - get out of my planet, humanity doesn't need such dead weight as you!

  • @noorhashem7
    @noorhashem7 4 місяці тому

    Thanks for the great video! What debuger are you using in that video, is it a VSCode extention?

  • @ItsCOMMANDer_
    @ItsCOMMANDer_ 4 місяці тому

    it didnt watch the whole video yet , but gotta agree with the relativly small library, especilay string.h. at this point i acully decided to write my own stdlib like library (but focusing on adding better string functions and advances data types like linked list)

  • @KangJangkrik
    @KangJangkrik 4 місяці тому

    Is arena aligned? If no, then it's definitely useful for implementing most communication protocols

  • @ShotgunLlama
    @ShotgunLlama 4 місяці тому

    Am I mistaken in that arenas still need a backing memory buffer, which you'd need to either have in static memory or still allocate on the heap, the latter requiring either using malloc anyway or using a system specific function?

    • @voxelrifts
      @voxelrifts 4 місяці тому

      You are correct, you need to allocate the backing buffer, either with malloc or with os specific calls like VirtualAlloc or mmap.

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

      You will call malloc, but it will be only once for all the small objects that you will use, so it can be faster than several separate calls to malloc. It also helps to reduce memory fragmentation, as you can allocate arenas of a fixed size, regardless of the size of your smaller objects. And finally, you also reduce the number of times you call free(), which can also be costly and problematic. This helps both with memory management and performance, as you free all the objects from that arena at once, at one place. It's not ideal for every case, but it's very useful for the use cases he mentioned in the video.

  • @luigidabro
    @luigidabro 4 місяці тому

    Is a ternary operator that just sets a value as bad as the other if statements?