Light Detection in Godot 4.0

Поділитися
Вставка
  • Опубліковано 5 лют 2025

КОМЕНТАРІ • 37

  • @CodingKaiju
    @CodingKaiju Рік тому +8

    I'm definitely going to use this for a project. Thank you so much!

  • @MirceaKitsune
    @MirceaKitsune Рік тому +1

    Very beautiful, thanks for making and sharing this tutorial! Made me smile seeing Godot and TheDarkMod compared so closely: Love them both and TDM never ceases to amaze me with how much it got right and still does with each update.

  • @virtuallemon4224
    @virtuallemon4224 29 днів тому

    life saver! super underrated video

  • @FOXTROT_3D
    @FOXTROT_3D 4 дні тому

    Wow! Thank you!

  • @latetoworkpanda
    @latetoworkpanda 2 місяці тому +1

    YO for anyone who is watching this and cant get the color unless the colorrect is on screen, make sure to go into the Render Target tab in the colorrect and switch update mode to always!

  • @Sp1cyP3pp3r
    @Sp1cyP3pp3r Рік тому

    Thanks! This is very helpful tutorial, hope to see more from you!

  • @duftcola
    @duftcola Рік тому

    Great video. I am glad you are keeping on with your channel!

  • @fdmazlum
    @fdmazlum Рік тому +1

    Thanks for the tutorial, very excited for Godot 4 videos coming from you :D Hope you're doing well

  • @Setter153
    @Setter153 Рік тому

    Great tutorial, Thank you so much!

  • @Averr1
    @Averr1 Рік тому

    Perfect explanation, thank you!

  • @aneckdope
    @aneckdope Рік тому

    your channel is a treasure trove, thank you for your hard work!

  • @bossanova3494
    @bossanova3494 9 місяців тому +1

    THANK GOD FOR THIS VIDEO

  • @sweetyoungpure
    @sweetyoungpure Рік тому

    Nice - really smart idea for light detection, will give it a try :) Thank you for the informative video

  • @ThunderPlayStudios
    @ThunderPlayStudios Рік тому

    Kudos friend. This was awesome

  • @ReversedFootage
    @ReversedFootage Рік тому

    Very well done, thank you for the great tutorial!

  • @herorobb
    @herorobb Рік тому

    Just found this channel. Very good stuff.

  • @NonUnknownDev
    @NonUnknownDev Рік тому

    WOW, Huge content here dude!!!

  • @99JasonKim
    @99JasonKim Рік тому

    amazing~keep going

  • @TheRealBlackNet
    @TheRealBlackNet 11 місяців тому

    I love Thief and want to do something thieflike. Thanks.

  • @semaph0re
    @semaph0re Рік тому

    Thanks 🙂

  • @emergencyrussell
    @emergencyrussell 9 місяців тому +3

    Is the light detection supposed to break if you hide the texture/color rectangles or am I doing something wrong? I would have thought they were downstream, not middlemen, of the textures and color values.
    In other words, how do I declutter the HUD so it's just the progress bar and still have light detection work as intended?
    Anyway, fantastic tutorial, man. I love the insight into one of my favorite games of all time. 💪💪

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

      Yooo, having the same issue, did you ever figure out a solution? It really feels like the visibility of the color rect and texture rect shouldn't matter for the way it's written in the code, but it does...

    • @evandroijanques5524
      @evandroijanques5524 4 місяці тому +4

      @@simbalion3694 I had the same problem, i solved it by going into the inspector sheet of the subviewport and setting the "update mode" of the "render target" to "always". I was 2 hours deep in this problem hahahaha. I hope it solves your problem too.

    • @simbalion3694
      @simbalion3694 4 місяці тому +1

      @@evandroijanques5524 Thanks for the possible solution! I actually ended up switching to a simpler way to detect light for my game because this method seemed overkill for my purposes, but if I end up switching back I'll definitely try this out!

  • @CrushingJosch
    @CrushingJosch Рік тому

    Brilliant approach and explanation.
    I would clean up the code a bit more to have a dedicated node for the light detection and not everything in the player script, but otherwise super easy to follow.
    I also love stealth games, unfortunately I am currently not working on any. But nevertheless good to know!

  • @deathsyrup
    @deathsyrup Рік тому

    very good

  • @Zerling2500
    @Zerling2500 6 місяців тому

    To make this work in 2D, one should make some tweaks:
    1. Set up the main viewport's culling mask:
    var cull_mask: int = 20
    get_tree().root.get_viewport().canvas_cull_mask &= ~(1 void:
    world_2d = get_tree().root.world_2d

  • @burrick2245
    @burrick2245 6 днів тому

    Really wish I was skilled enough right now to recreate this in Unity, all the shadow detection systems I find for that engine are the raycast style. Swear I found this style once but for the life of me I can't track it down again

  • @mōellctie
    @mōellctie Рік тому

    i like your video.

  • @BinaryBolias
    @BinaryBolias Рік тому

    I think it would be preferable for there to exist a built-in _light probe_ type of object, which could detect the light received at a point - _or perhaps a full 3D space_ - in the same way as the light would be received by a mesh surface to be rendered.
    This would skip the usage of a camera and interpretation of luminance from the camera's view.
    Anyhow, for this video's method, could the downscaling step be effectively skipped by using a 1x1 pixel camera resolution to capture the image?

    • @Lycam
      @Lycam 9 місяців тому

      light probes are just 'cameras', at least godot's implementation.

  • @skaruts
    @skaruts Рік тому

    Do you think you could make some Material Maker tutorials? Your materials look pretty good. I'm not at all happy about some materials I've been trying out from _ambientcg._ They're overly realistic, and bland as well, with very low contrasts (e.g. light bricks with also light crevices). But I'm completely clueless about apps like Material Maker. So many nodes, and so little clue how to use them. :)
    Thanks for this video, btw. I've tried implementing this kind of thing once, but I couldn't make it work that well.

    • @Lycam
      @Lycam 9 місяців тому

      There a entire library you can access inside the program, it downloads other's people materials on from the site.

  • @Toskyval
    @Toskyval Рік тому +1

    Would be correct to assume that the Thief arrays cast method regarding the lightmap brightness could be used to trigger different SFX on different horizontal surfaces f.e. muffled steps when walking on models/textures named as carpets?

  • @Heulerado
    @Heulerado 6 місяців тому

    I tried to implement this in 2D, but something must work differently, because the light outside the SubViewport aren't affecting the objects inside the light detector. Or am I doing something stupid?

  • @stealthdev
    @stealthdev 8 місяців тому

    Can we use this method in 3rd person games??

  • @GameDevBryant
    @GameDevBryant 6 місяців тому

    This was super helpful and awesome, thank you!