How I Implemented Shadows in my Game Engine

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ก.ย. 2024

ความคิดเห็น • 310

  • @CodingDragon04
    @CodingDragon04 2 ปีที่แล้ว +564

    I have actually missed this more technical content a bit. Concise yet excellent explanation!

    • @pivotal-ai
      @pivotal-ai 2 ปีที่แล้ว +4

      Yes these are wonderful and I learn so much. They're the most inspiring for me to work on games of my own. Since it feels much more tangible.
      Love to see more!

  • @landru27
    @landru27 2 ปีที่แล้ว +452

    I, for one, feel that this video was much more than just "a little bit interesting"! I gain a lot from you diving in on the technical details. It's particularly interesting when you cover how your approach to a certain graphical problem has become more sophisticated over the course of time and your projects.
    ... Don't get me wrong, though : it's also always great to see the dishes you cook, your balcony garden, and the landscape around where you live, like in a regular dev log! 🙂

    • @mr.norris3840
      @mr.norris3840 2 ปีที่แล้ว +2

      I agree

    • @UserUser-sh6wi
      @UserUser-sh6wi 2 ปีที่แล้ว +5

      Agree on the first half, but must disagree on the second. I find devlogs to be much more enjoyable when the irrelevant parts are cut out and all the focus is on the project.

    • @ceyhunuysal9509
      @ceyhunuysal9509 2 ปีที่แล้ว +3

      Im literally watching for the cooking!

    • @Danuxsy
      @Danuxsy 2 ปีที่แล้ว

      With path tracing you don't have to deal with trying to fake all of this, it just works.

    • @mr.norris3840
      @mr.norris3840 2 ปีที่แล้ว

      @@Danuxsy But it still isn’t 100% accurate, and a lot of restricting assumptions have to be made

  • @jdh
    @jdh 2 ปีที่แล้ว +65

    Another fix you could try for the shadow shimmering on movement is to add a small offset to the projection matrix for the shadow map that ensures that all world coordinates will always “snap” to the same shadow map texels, IIRC done by taking a fixed world space point (the origin) and transforming it into shadow space and then finding its offset from the center of a texel in shadow map space (where the texture sample round to) and using that, transformed back into shadow projection from shadow texture space, to offset the projection matrix.
    maybe a little complicated though when you already have a good enough solution :) the graphics are looking great!

    • @jessex8535
      @jessex8535 2 ปีที่แล้ว +5

      I love your content so much

    • @Assassin_Droid
      @Assassin_Droid 2 ปีที่แล้ว +1

      Helo there

    • @ThinMatrix
      @ThinMatrix  2 ปีที่แล้ว +12

      Thanks for the idea, that makes a lot of sense! I'll have to give that a go next time when I work on the shadows :)

    • @Dannnneh
      @Dannnneh ปีที่แล้ว

      Always nice to see your insightful comments.

    • @mrdiabeatis9943
      @mrdiabeatis9943 7 วันที่ผ่านมา

      didn't see you there vro...

  • @cineblazer
    @cineblazer 2 ปีที่แล้ว +64

    I really really love technical content like this. Maybe it's not the most popular amongst other subscribers but I'll always watch it! Super fascinating to someone like me who doesn't have any graphics programming experience but wants to learn.

    • @Krahfty
      @Krahfty 2 ปีที่แล้ว +2

      From my experience, a lot of this kind of stuff is just the trial and error from normal development, get your hands on an engine and just start making something, you'll soon encounter these kinds of problems and you'll learn directly from trying to fix those types of problems 1st hand

  • @massimogalliano8337
    @massimogalliano8337 2 ปีที่แล้ว +43

    Seeing your project and this game take shape is heart-whelming!

  • @henryford8433
    @henryford8433 ปีที่แล้ว +1

    Ok, I am a botanist, a retired plant population biologist, and I and a botanical artist wondered why people are plant blind, and discussed the potentiality of games based on plants, and Albert Durer’s turf, and the immersive Van Gogh exhibition in Bristol. Your ideas are interesting and I might come back for a chat some time. Henry F

    • @dekira3545
      @dekira3545 2 หลายเดือนก่อน

      can i know how the game project is going?

  • @enotirab
    @enotirab 2 ปีที่แล้ว +8

    Loving the series. For what it is worth some of us love "technical and boring."

  • @erikbrendel3217
    @erikbrendel3217 2 ปีที่แล้ว +3

    Have you heard of "Variance Shadow Mapping"? This is a simple mathematical way of achieving very smooth shadows without the need of introducing many samples, and it also solves the shadow-acne problem. Maybe this would be worth exploring for the game... :)

    • @MrAchterbahnfahrer
      @MrAchterbahnfahrer 2 ปีที่แล้ว

      Just an additional note to anyone reading the comment above: If you're considering variance shadow mapping, you should also take a look at moment shadow mapping. While variance shadow mapping only takes the first two moments of the distribution of depth values (i.e. their mean and variance) into consideration when calculating the shadow density, moment shadow mapping uses the first four moments, thus reducing the issues of light leaking caused by variance shadow mapping.

  • @SomeNussi
    @SomeNussi 2 ปีที่แล้ว +43

    Here's what i can recommend for moving/resizing the shadowmap: keep it a bit bigger than the view area AND re-calculate it every frame (if the camera didnt move, you keep the current "target")
    instead of fully applying the "new" dimensions immediately, interpolate between the old and the new one in a ratio of about 85 to 15 with the new one being 85% responsible for the new image. This way you're getting rid of the sudden shifting and you're able to keep the shadow maps size much smaller than previously, improving the shadows quality

    • @ThinMatrix
      @ThinMatrix  2 ปีที่แล้ว +16

      Thanks for the idea, I'll give that a try!

    • @cribalik
      @cribalik 2 ปีที่แล้ว

      I recommend 'jdh's answer instead, it's the fastest and arguably simpler than any other method.
      The idea is: only move the shadowmap in increments of its pixel size (in world space)
      docs.microsoft.com/en-us/windows/win32/dxtecharts/common-techniques-to-improve-shadow-depth-maps?redirectedfrom=MSDN
      Something like:
      bounds = CalcShadowMapBox(); // in worldspace
      float texel_size_in_world_space = bounds.width / shadowmap_resolution; // assuming shadowmap is square
      // snap to grid
      bounds.x0 = floor(bounds.x0 / texel_size_in_world_space) * texel_size_in_world_space;
      bounds.y0 = floor(bounds.y0 / texel_size_in_world_space) * texel_size_in_world_space;
      bounds.x1 = bounds.x0 + texel_size_in_world_space * shadowmap_resolution;
      bounds.y1 = bounds.y0 + texel_size_in_world_space * shadowmap_resolution;
      projection = ortho(bounds.x0, bounds.x1, bounds.y1, bounds.y0, bounds.z0, bounds.z1);

  • @_miyu
    @_miyu 2 ปีที่แล้ว +4

    I really like your work on the shadows, especially reducing the calculations with an over sized box. I have a suggestion about how watering the crops gets rendered. Instead of the full square turning dark immediately, think of how rain, or the watering can would drop random droplets until it all gets filled in. It could be a quick animation that just darkens randomly sized circles until its all watered. Hope that helps, thanks for the great dev videos.

    • @ThinMatrix
      @ThinMatrix  2 ปีที่แล้ว +1

      Thanks for the suggestion, that does sound nice!

  • @SpikeStudio
    @SpikeStudio 2 ปีที่แล้ว +1

    The solutions you come up with are always incredible

    • @recyclebinladen5903
      @recyclebinladen5903 ปีที่แล้ว

      Lol what? What do you think AAA games are made of then, and since decades?

  • @Grimille
    @Grimille 2 ปีที่แล้ว +1

    One thing that was noticable in Equilinox and is curently noticable in Homegrown is the shadow movement not going along with the windy shader. Good video, I prefer by far when there is also technical involved in the video ! 😊

    • @ThinMatrix
      @ThinMatrix  2 ปีที่แล้ว

      I've updated the Homegrown shadows so that they now sway in the wind too :)

    • @Grimille
      @Grimille 2 ปีที่แล้ว

      @@ThinMatrix great work ! 👊🏻

  • @Seff2
    @Seff2 2 ปีที่แล้ว +2

    Wow I never have seen such a high level explanation on how shadows work in 3d games. Thanks for this vid!

  • @AjAce19
    @AjAce19 2 ปีที่แล้ว +41

    I really enjoy this kind of video! I know you can't always do technical stuff but its really interesting and cool to see stuff more in depth!

  • @Mystixor
    @Mystixor 2 ปีที่แล้ว +2

    Been using the basics of your old Shadow mapping tutorial in my own engine ever since. Some of these ideas you shared today are definitely worth looking into!

  • @MrA6060
    @MrA6060 2 ปีที่แล้ว +1

    it was looking great with the last graphics but now? holy smokey this is amazing. keep it up

  • @otoS97
    @otoS97 2 ปีที่แล้ว +5

    Game looks amazing, I'm so happy after the graphical upgrade

  • @CodeParticles
    @CodeParticles 2 ปีที่แล้ว +2

    I remember getting into shadow mapping, and then later omnidirectional shadow mapping! I've been avoiding those concepts lately but it's only a matter of time before it's needed again, thank you for reminding me!! 👍👍

  • @Skeffles
    @Skeffles ปีที่แล้ว

    Fascinating to see how you approach shadows!

  • @asherhaun
    @asherhaun 2 ปีที่แล้ว

    This is the kind of devlog I subscribed for in the past. :D

  • @GingerBeker
    @GingerBeker 2 ปีที่แล้ว +3

    Amazing. Really few people can really know how difficult this stuff are. You rock!

  • @elingranath
    @elingranath 2 ปีที่แล้ว +1

    As someone working on my own engine, videos like these are super interesting and I even prefer them a lot over the regular game dev videos since I already have a lot of experience with game programming. I'm just about to get started with shadows myself so this was a nice surprise to see in my recommendations!

  • @Arkogelul
    @Arkogelul 2 ปีที่แล้ว

    Even if this one not the regular format, I really enjoyed that video. Thanks!!

  • @hernestpoissin6964
    @hernestpoissin6964 2 ปีที่แล้ว

    Hello ThinMatrix,
    I have started game dev with your OpenGL series and have learned a lot with you. Thank you! You do great work.
    For your shadow shimmering, what you need to do is to move the shadow camera by fixed increments, which correspond to the projection of the shadow texels on a horizontal plane. This completely removes the issue. Don't hesitate if I can help you back.

  • @kiki-drawer2669
    @kiki-drawer2669 2 ปีที่แล้ว

    I don't code or create games at all but the way you talk about your work and explain simply means your videos are never boring no matter what element you focus on! I enjoyed this video just as much as all your others! Ty for working so hard!

  • @bertrodgers2420
    @bertrodgers2420 2 ปีที่แล้ว +1

    really enjoy the more technical videos as well as your normal ones. Would love to see more about what frameworks/libs you've used too

  • @DEPHi3
    @DEPHi3 2 ปีที่แล้ว

    I really like this kind of more technical videos. Good work.

  • @bigmistqke
    @bigmistqke 2 ปีที่แล้ว

    Waw the steps u made in the last videos really added a lot of life to the scene!

  • @KamranWali
    @KamranWali 2 ปีที่แล้ว

    Awesome video! The shadow rendering already looks awesome. Really like how you go in detail to explain how each of the problem was tackled. Learnt something new today :) Looking forward to your next devlog. Keep it up! :)

    • @ThinMatrix
      @ThinMatrix  2 ปีที่แล้ว +1

      Thanks, glad you liked it :)

  • @VegetableJuiceFTW
    @VegetableJuiceFTW 2 ปีที่แล้ว

    I have always wondered how shadows are done. Neat!

  • @gnramires
    @gnramires 2 ปีที่แล้ว

    Here's an idea: sample (say 7 or 9) lightmaps with a slight angle offset. The sun rays are approximately parallel at Earth, but the Sun does have a small apparent diameter, of approximately 1/2 degree (10 milliradians). By sampling the shadowmap in a "hexagon" of radius 1/4 degree (you can exaggerate this effect a few times for dramatic effect), plus maybe a point in the center, you get very nice soft shadows that also have a distance effect (they're softer when far from blocking objects). You can also achieve this by computing one shadow at a time (for a total of 7) like you're doing but averaging out the 7 results. Very interesting video, thanks :)

  • @sydryan9589
    @sydryan9589 2 ปีที่แล้ว

    This is so fascinating, love your videos my man.

  • @JackTraynor14
    @JackTraynor14 2 ปีที่แล้ว

    Great video. I hope you can do more technical devlogs like this in the future.

  • @Dannnneh
    @Dannnneh ปีที่แล้ว

    I very much appreciate the technical insight.

  • @MichiGombocz
    @MichiGombocz 2 ปีที่แล้ว

    This might be the best video by far done by yourself.
    Thank you for all the effort you put it every time, it pays off for the viewer and hopefully yourself as well!

  • @Zharkan16
    @Zharkan16 2 ปีที่แล้ว +11

    Thats awesome, I just drag in a directional light in Unity and call it a day 😄

    • @ThinMatrix
      @ThinMatrix  2 ปีที่แล้ว +8

      I'm kind of jealous XD

    • @AjAce19
      @AjAce19 2 ปีที่แล้ว +4

      Ahh mines a bit different, I just drag a directional light in Unreal and call it a day 😂

    • @ieller71791
      @ieller71791 2 ปีที่แล้ว

      @@ThinMatrix I'd love to see and hear you talk about the tools you've created to help your game development along. Did you set up your engine with a GUI to manage things in a way like Unreal/Unity, or did you make separate tools to handle things like level design?

  • @hopperpl
    @hopperpl 2 ปีที่แล้ว

    We use an additional approach with 2 shadow maps... the first is the wider scene which creates the pixely shadow map (the one you use), and a second is a narrower map which only contains a small part of the scene using a distance field around the camera (not the light source). Both maps are generated during the same rendering pass, the shaders just use 2 rendering targets. The 2nd map has a much higher resolution, you can think of it like a 2nd zoomed shadow map. During the final render, the shadow is then, based on distance again, sampled from the narrower or the wider map. This generates nice sharp shadows around the "camera" while having only blurry shadows far away, which you wont notice in the distance anyway. As a disclaimer, this will only work with 3rd person or 1st person rendering. For this game with a wide/far camera, the distance value for the narrow shadow map will be too large and the difference in shadow map resolution too small.

  • @Draconicrose
    @Draconicrose 2 ปีที่แล้ว

    They look pretty good and I learned something more about development from this video.

  • @FloWritesCode
    @FloWritesCode 2 ปีที่แล้ว

    Great video! Shaders in general have always been my weakness, so this was very interesting to watch :)

  • @AxisCoords
    @AxisCoords 2 ปีที่แล้ว +1

    Love your devlogs so much

  • @zachj1196
    @zachj1196 2 ปีที่แล้ว +1

    The shadows look so good! Even if it was a more technical devlog I love to see the progress on the game!

  • @weinsim3856
    @weinsim3856 2 ปีที่แล้ว +2

    Wow, the graphics are starting to look really good

  • @madao7865
    @madao7865 2 ปีที่แล้ว

    Looking good. Also, the technical side is quite interesting.

  • @MrOmega-cz9yo
    @MrOmega-cz9yo 2 ปีที่แล้ว

    As others have mentioned, I too like these types of videos! Thanks!

  • @Zyhorn
    @Zyhorn 2 ปีที่แล้ว

    Very fun and interesting. I love the technical explanation and wouldnt mind ever more 😀 thank you

  • @OCPyrit
    @OCPyrit 2 ปีที่แล้ว

    The game looks great, I like the style.

  • @blubloos
    @blubloos 2 ปีที่แล้ว

    Amazing dev log as always

  • @Joern290
    @Joern290 2 ปีที่แล้ว

    Great video! Love the art style and the shadows! 😊

  • @dzima-create
    @dzima-create 2 ปีที่แล้ว

    Karl this video was SUPER interesting! Very nice! The game now looks much better. As I heard some time in the past "Lighting is the sound of graphics". And indeed shadows add so much natural feel to the scene!!
    Actually I also have a video on my channel about shadow programming, but never mind!
    Good job!

    • @ThinMatrix
      @ThinMatrix  2 ปีที่แล้ว

      Glad you liked it!

  • @sparklydavid
    @sparklydavid 2 ปีที่แล้ว

    This give me Sebastian vibe, both channel make me realized how dumb I am, 10/10 would hit that like button.

  • @igz
    @igz 2 ปีที่แล้ว

    Fascinating, and the game is looking great!

  • @Xbookdetemprano
    @Xbookdetemprano 2 ปีที่แล้ว

    Seeeee, me encantó! Sos un genio. amo aunque sea estos videos cortitos que son muy interesantes para aprender y motivarse! Muchísimas Gracias por el esfuerzo y la buena onda!

  • @NeilRoy
    @NeilRoy 2 ปีที่แล้ว

    Fascinating insights on how to do shadows. This was a good, general description of the problem, I like it.

  • @Simon-ik1kb
    @Simon-ik1kb 2 ปีที่แล้ว

    loved this one. Really like those a little more technical videos. I understand basically... nothing. But still very interesting.

  • @leoingson
    @leoingson 2 ปีที่แล้ว

    One of your best videos of late! Tech content rules :)

  • @peterhickman386
    @peterhickman386 2 ปีที่แล้ว

    Along with the graphical upgrade it is looking much better now. Also nice technical content even if it is on a small detail

  • @realbrickbread
    @realbrickbread 2 ปีที่แล้ว

    You got a really nice workplace!

  • @NICK....
    @NICK.... 2 ปีที่แล้ว

    I wonder how a game like this would look like with uber photorealistic rendering, like all the bells and whistles: Raytracing, volumetrics, PBR, 4k textures, models so detailed you can zoom in and see the individual bugs crawling around on the plants

  • @chadzulu4328
    @chadzulu4328 2 ปีที่แล้ว

    This was very interesting and educational too! Thanks

  • @Stevenpwalsh
    @Stevenpwalsh 2 ปีที่แล้ว

    I like this quick little video

  • @dennismakesgames
    @dennismakesgames 2 ปีที่แล้ว

    Lovely, I do feel like shadows that are softer would really fit the art style, like Tunic, and the clouds that casts shadows would also be lovely :) Great work as always.

  • @Botondar
    @Botondar 2 ปีที่แล้ว

    For PCF filtering:
    It looks like you're strictly checking whether each sample passes the shadow test or not, which means that A) you can only ever get a handful discrete values which depends on the number of samples you take and B) all the world-space fragments that land on the same texel in the shadow map will have a uniform shadow value which results in the blockiness.
    What you really want is to also weight the contribution of each shadow sample by how far it is from the actual location you're shading.
    In the case of 2x2 PCF filter for example where you have:
    |a, b|
    |c, d|
    you want to compute the shadowing factor with a proper bilinear filter, i.e. mix(mix(a, b, u), mix(c, d, u), v) where u and v are the bilinear weights from the bottom-left texel center, and a, b, c, d are 0.0 or 1.0 depending on whether that particular texel passes the shadow test or not.
    If - as you mentioned - you decide to use the built-in shadow texture functions in OpenGL then this is how it will actually compute the shadow weight, which should automatically give you nicer looking shadows. You might not even need to jitter the samples.

  • @tunAliUTube
    @tunAliUTube 2 ปีที่แล้ว

    Nice approach

  • @feuerherz007
    @feuerherz007 2 ปีที่แล้ว

    That one channel where you always like first and then watch the video ..

  • @nkusters
    @nkusters 2 ปีที่แล้ว

    The bigger box will also result in a lot better performance 😊 smart change.

  • @realdlps
    @realdlps 2 ปีที่แล้ว +1

    I'm a game developer myself, not as good as you but I still enjoy making games and releasing them.
    In my opinion the more technical videos are interesting and I will watch the video asap

  • @StephenLebed
    @StephenLebed 2 ปีที่แล้ว

    This was a really great video. I always enjoy your vids and would like to see more technical discussions as you go forward.

  • @OriginalJetForMe
    @OriginalJetForMe 2 ปีที่แล้ว

    I love the technical content!

  • @0.lennart
    @0.lennart 2 ปีที่แล้ว

    I always enjoyed watching your tutorial videos a few years ago. It's impressive how you improved. I would love to see a few new tutorials when you have some time. Keep up the great work :)

  • @dbweb.creative
    @dbweb.creative 2 ปีที่แล้ว

    I think the shimmering is because your PCF averaging square is asymmetrical. Try using Gaussian distribution for sampling. If you don't want to do Gaussian, then you could go with some sort of radial distribution and see what sort of decay you like towards the edges. But yeah.. don't go with a square. You go with a square - you get a square. It's similar to BOKEH in photography, how you can make different out of focus figures by changing the shape of an aperture.

  • @samuilxd
    @samuilxd 2 ปีที่แล้ว

    Hello. First of all, you are making your video in a great and instructive way, I wish you success in your new game (I wish I could solve the logic) :)

  • @Phvli
    @Phvli 2 ปีที่แล้ว

    Good, concise explanations for the basic concepts! You'll probably want to look into Cascaded Shadow Mapping if your single map resolution is not enough.

  • @kamathonxander1
    @kamathonxander1 2 ปีที่แล้ว

    This was super interesting, thank you. Please do more of these technical in-depth videos in the future! 😊

  • @chillyvanilly6352
    @chillyvanilly6352 2 ปีที่แล้ว

    If only professors at universities would explain GFX concepts as well as you do...uff...it would be just a pure joy learning.
    NOTE: not that there aren't excellent profs out there, just my experience hasn't been all that great so....
    Amazing vid, thank you!

  • @VetorDigital
    @VetorDigital 2 ปีที่แล้ว

    This is beginning to look nice, you are on the right track.

  • @GeryTeague
    @GeryTeague 2 ปีที่แล้ว

    Love your videos man!

  • @thehambone1454
    @thehambone1454 2 ปีที่แล้ว

    Great video, glad you made one on this topic, I am going to to do some similar techniques for shadows after watching this! I like the art style a lot btw!

  • @wyattrichardson6609
    @wyattrichardson6609 2 ปีที่แล้ว

    Very cool video, indeed interesting and helpful.

  • @SwordFishTheFish
    @SwordFishTheFish 2 ปีที่แล้ว

    Love this kind of video!

  • @vast634
    @vast634 2 ปีที่แล้ว

    Making the shadows and ambient light darker, and the lid areas brighter would make the game visually pop more. It would appear more sunny in the scene. Currently it looks like on a hazy day.

  • @himselfe
    @himselfe 2 ปีที่แล้ว

    No sheep were affected by shadow in the making of this video.

  • @FugaceFugite
    @FugaceFugite 2 ปีที่แล้ว +7

    I would recommend using a bias offset when checking the shadow map to remove the shadow acne, instead of backfaces, but both have pros and cons : the bias offset would solve the intersection light bleeds, but might introduce some through thin objects.
    A technique that's used sometimes to fix he light bleeds you have is called contact shadows, not exactly sure how it works but it's a screenspace effect, based on the depth buffer and maybe the normal buffer in some implementations, it creates some proximity shadows that usually cover all those tiny bleeds, but introduce some shadows in spots where they shouldn't be there.
    Since you already use blender to do test renders, you can try the contact shadows there, with a light selected, in the light properties panel there's an option to enable them.

  • @ludi_64
    @ludi_64 2 ปีที่แล้ว

    Great video! really well explained in an interesting way. I feel like I learnt a lot about how shadows work in video games

  • @SSouper
    @SSouper 2 ปีที่แล้ว +1

    you can also use variance shadow mapping, where hardware effects like linear filtering work out of the box so you can get them for free and you can do a quick blur of your shadowmap using a render to texture pass. Also a quick and lazy fix for 5:52 in case everyone needs it: cast your shadowmap camera's position to an int :)

    • @MrAchterbahnfahrer
      @MrAchterbahnfahrer 2 ปีที่แล้ว +1

      Just an additional note to anyone reading the comment above: If you're considering variance shadow mapping, you should also take a look at moment shadow mapping. While variance shadow mapping only takes the first two moments of the distributions of depth (i.e. the mean and the variance) into consideration when calculating the shadow density, moment shadow mapping uses the first four moments, thus reducing the issues of light leaking caused by variance shadow mapping.

  • @guillaumequittet9418
    @guillaumequittet9418 2 ปีที่แล้ว

    Awesome job as usual! 💪
    And crystal clear explanations 👌

  • @ownhaus
    @ownhaus 2 ปีที่แล้ว

    Very interesting. I loved your tutorials and wish you had time to continue them.

  • @0VexRoblox
    @0VexRoblox 2 ปีที่แล้ว +1

    I love the progress. I think textures would be a good addition though, the idea you scrapped in the previous episode.

  • @VictorGordan
    @VictorGordan 2 ปีที่แล้ว

    Great idea with the bigger area of the shadow map! Also, didn't know about the only rendering back faces trick, always just used an offset :)

  • @AlexTuduran
    @AlexTuduran 11 หลายเดือนก่อน

    You can try shadow cascades to avoid computing the shadow coverage. 4 cascades that blend nicely could work fine.

  • @willoguns3226
    @willoguns3226 2 ปีที่แล้ว

    I recommend checking out “cascaded shadow mapping” if you get the chance!
    It should allow you to have even higher quality shadows, as well as reduce or completely eliminate the jittery nature of the shadows when moving out of the shadow bound.

    • @ThinMatrix
      @ThinMatrix  2 ปีที่แล้ว

      I did actually check them out last week but I didn't think it was really applicable to my situation. If I understand correctly, it allows you to have high quality shadows near the camera while still having (lower quality) shadows on objects far away from the camera. But in this game because of the camera angle, there's not really a huge difference between the near and far objects (at any given time). At any point, the visible objects are all at a relatively similar distance away from the camera.
      When the camera is close to an object the distance objects are out of view, so the shadow map scales to only contain the local area which makes the shadows much higher resolution. When the camera is far away from the scene then the shadows automatically become lower resolution as the shadow map scales to contain all the objects in the scene. So it's kind of already doing the job of cascaded shadow mapping anyway.
      Completely getting rid of the shimmering edges would be nice, but a few other people have mentioned some ways of doing it with the current system so I'll give them a go first. But thanks for the suggestion!

  • @LandBeyond
    @LandBeyond 2 ปีที่แล้ว

    I would love to see more like these, missed the technical videos you use to do.

  • @punchster289
    @punchster289 2 ปีที่แล้ว

    you can use shadowmap distortion to increase the resolution closer to the camera, and decrease it further away. That way going up close to a shadow looks great, and shadows from far away aren't being resolved with unnecessary detail. in my experience this works quite well. I think when combined with the frustum alignment it may almost entirely eliminate the need for sampling. Alternatively you can keep the sampling and downscale the shadowmap a bit if its a significant factor to performance as it is.

  • @maurice8205
    @maurice8205 2 ปีที่แล้ว

    Ah that last point on how to stop the shimmering was something I struggled with as well! What I ended up doing was made the camera frustum move by exact pixel increments (as my game is pixel based) which got rid of the shimmer

  • @LifeOfMohammed
    @LifeOfMohammed 2 ปีที่แล้ว

    Awesome work! Love the shadows!

  • @cvspvr
    @cvspvr ปีที่แล้ว

    i've implemented hybrid frustum traced shadows in my game engine, and they work great. you could also try shadows volumes to get rid of a lot of the visual artifacts

  • @jmscshipp
    @jmscshipp 2 ปีที่แล้ว

    Awesome vid!!

  • @scewps
    @scewps ปีที่แล้ว

    Late comment, but I can definitely recommend using shadow samplers, they make shadows look noticably smoother without needing more samples. Also I've made good experiences with using a 16 sample poisson disk (I just hardcoded the sampling offsets in the shader and looped through them), and the result looks quite nice

  • @jjfattz
    @jjfattz 2 ปีที่แล้ว

    Pretty neat!

  • @bitwise4996
    @bitwise4996 7 หลายเดือนก่อน

    You should really create an editor for your engine. It looks amazing.

  • @DevelopAnEngine
    @DevelopAnEngine 2 ปีที่แล้ว

    Hello everyone ! Perfect day with this new video :D