Modern Foliage Rendering

Поділитися
Вставка
  • Опубліковано 30 жов 2024

КОМЕНТАРІ • 266

  • @maaz4354
    @maaz4354 2 роки тому +464

    Can we just appreciate how the real life world just instantiates infinite grass every frame

    • @cvspvr
      @cvspvr Рік тому +22

      touch grass

    • @lih3391
      @lih3391 Рік тому +21

      It runs all of quantum mechanics and relativity too!

    • @tonyhakston536
      @tonyhakston536 Рік тому +21

      @@lih3391relativity is just lag, come on now.

    • @samuunn
      @samuunn 11 місяців тому +5

      ​@@cvspvr it would have to calculate the physics and my hand collision (100% accurate) so idk it's too much power

    • @abdou.the.heretic
      @abdou.the.heretic 11 місяців тому +4

      ​@@samuunnTianhe-2A can calculate the collision data of three of your next generation using its 33.86 PETAFLOPS. This is today's tech, I'm sure the gman simulating life got a beefier rig lmao

  • @swizzler
    @swizzler 2 роки тому +830

    The grass in Zelda is actually only 2 tris, also it turns into even simpler 1 sided billboards at a distance around the edge of the camera

    • @bbuskabuske
      @bbuskabuske 2 роки тому +50

      wait then how does each grass bend tho if they don't have any vertice to manipulate in between

    • @srqubit9480
      @srqubit9480 2 роки тому +103

      @@bbuskabuske
      I guess they use shaders similar to gta, moves the bushes Using a 2d fisheye filter

    • @KingBobXVI
      @KingBobXVI 2 роки тому +41

      @@srqubit9480 - That, or the grass on the billboard is actually procedurally animated within its "texture"?

    • @srqubit9480
      @srqubit9480 2 роки тому +29

      @@KingBobXVI I was talking about 3d grass
      For 2d grass if it can be animated for 3d it requires too many polygons which lags and a lot

    • @Person5385-w4s
      @Person5385-w4s 2 роки тому +9

      May I ask where you got this information? I would really move to read about how Breath of the Wild’s grass works!

  • @zachcarter1116
    @zachcarter1116 2 роки тому +277

    I have been watching your grass series and never realized you had less than 1,000 subscribers. You are totally underated! Great stuff!

    • @shebahammy
      @shebahammy 2 роки тому

      Damn

    • @KYL3R64
      @KYL3R64 2 роки тому +5

      watching this 2 months after your comment, acerola now has 35.400 subscribers! :)

    • @TU7OV
      @TU7OV Рік тому +3

      @@KYL3R64 only a year after sitting at 110k lmao

    • @perelium-x
      @perelium-x 11 місяців тому +1

      136k @@TU7OV

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

      @@perelium-x 137!

  • @jbird4478
    @jbird4478 2 роки тому +53

    That looks really good, and I like that you explain the reasoning instead of just telling people what to do. And on top of that we get a fun presentation style. You deserve way more views with this talent.

  • @spore124
    @spore124 2 роки тому +108

    Very well explained video. However, regarding the performance penalty, a 300x300 field has ~100 times the area of a 32x32 field so if that's what you had to do to get equivalent performance then it means this new method had a performance drop of 99%, not 90%. This just further pushes the importance of the culling method in the later section.

  • @jacobusburger
    @jacobusburger 2 роки тому +33

    Glad to find a fellow grass enjoyer. Excited to see more grass related content soon!

  • @alecmackintosh2734
    @alecmackintosh2734 2 роки тому +27

    I imagine using the billboard technique for far away grass would help get grass to appear far away since you won't notice it being a square.

  • @BRiemann313
    @BRiemann313 2 роки тому +103

    Very nice explanation and overall video👌🏻
    Only thing I would like to throw in, is that you should always at least consider using two noises/ sinewaves for the animation of the grass. One for the bigger movement and one that is the kind of detail layer. (With different scroll speeds obviously 😄) This way you don’t have this „on off“ feeling that it does have with only one and gives a way nicer feeling when looking longer at it

    • @Acerola_t
      @Acerola_t  2 роки тому +31

      That's a great tip, I'll be sure to do that next time i redo the grass animation

  • @carl14602
    @carl14602 2 роки тому +27

    This looks really good! and I'm super excited to see more optimization techniques.

    • @Acerola_t
      @Acerola_t  2 роки тому +8

      Thanks! Going to be testing several solutions in the next week to get proper area coverage without performance loss.

  • @jonilo8792
    @jonilo8792 2 роки тому +24

    I'm surprised this channel doesn't have more subscribers. Great content!

  • @rockhunterguy
    @rockhunterguy 2 роки тому +17

    A trick you can do to render the same amount of grass as the 300x300 plane is to replace the high quality grass with the lower quality grass at a distance. Because one of the most notable downsides of using png grass is when you look down, only rendering that grass at a distance makes that impossible to do. :)

  • @msqrt
    @msqrt Рік тому +3

    An idea that's simpler and typically more performant than the vote+scan thing is to do an arena allocator using atomics. You initialize a global counter to zero, and for every thread that wants to put a grass in you say index = atomicAdd(counter, 1) -- and that's the output index. It does the same operation (well, not exactly since it doesn't preserve thread order). You can optimize this further by using ballot/subgroup-wide scan and only doing one global atomic add per warp/subgroup, and even further by also doing it for multiple elements at a time (so each thread loads and computes the culling for, say, 4 blades, then the subgroup does a scan, local indices are added to the global ones and out comes an index for each blade that wanted one). After all of this it's not really any simpler but it's pretty zoom zoom fast.

  • @BlackMantisRed
    @BlackMantisRed 2 роки тому +58

    I cannot remember if you did this but to improve performance you could use lower LODs on grass which is further away

    • @Acerola_t
      @Acerola_t  2 роки тому +53

      I do that in the next vid yeah, it doesnt actually give much of a performance boost surprisingly.

    • @kgaming7599
      @kgaming7599 2 роки тому +6

      @@Acerola_t yes it does

    • @Acerola_t
      @Acerola_t  2 роки тому +57

      @@kgaming7599 I literally made it so I know how much of a performance boost it gave

    • @kgaming7599
      @kgaming7599 2 роки тому +37

      @@Acerola_t skill issue

    • @toao_rainys
      @toao_rainys 2 роки тому +15

      @@kgaming7599 ratio + lack of female companions + didn't ask + no one cares

  • @radivarig
    @radivarig 2 роки тому +3

    There's a thing called "Perspective Correction" that I've only seen so far in a Unity asset called "Stylized Grass". It stretches/rotates the grass mesh by some amount relative to the camera angle which camouflages the grass mesh quite well, up to a certain point when it's near perpendicular.

    • @Acerola_t
      @Acerola_t  2 роки тому +3

      That's called parallax

  • @ucankushincorporations1318
    @ucankushincorporations1318 2 роки тому +2

    I knew a youtuber about video game grass was what I needed.
    And now I finally found them.

  • @Kimeters
    @Kimeters 2 роки тому +10

    After seeing this I watched a GDC on ghosts of tsushima wind and grass. It would use bezier curves rather than a defined mesh. I believe this has the fault of the arc length being hard to constrain so the grass would shrink and grow as it swayed in the wind, but subtle enough movements make this hard to notice.

  • @Ricky_Lauw
    @Ricky_Lauw 2 роки тому +12

    There is a great GDC talk on rendering grass in Ghost of Tsushima. That might provide you with some great insights. Also, I think you can get away with optimizing that blade of grass a bit more without losing visual fidelity too much.

  • @Gameslinx
    @Gameslinx 2 роки тому +4

    Instead of using the scan and compact algorithm to copy the culled grass into a new buffer, it might be easier to just use an Append buffer to append the grass that survives the culling to an empty output buffer each frame. This means no scan or compact, however you do need a buffer the size of the worst case scenario which does have a larger memory impact

    • @Acerola_t
      @Acerola_t  2 роки тому +1

      Someone else also brought up the append buffer, I'm not sure how I did a month of research and never read about it anywhere. I'm unsure how different the performance would be with an append buffer instead.

    • @Gameslinx
      @Gameslinx 2 роки тому +1

      @@Acerola_t Same thing happened to me, and I just discovered this short video series after I almost finished my implementation lol. Using an append buffer should improve performance slightly, since you won't need the SAC algorithm to manage culling - just append to your output buffer and pass that to your shader (or however you manage instancing).
      Append buffers require a fixed size, but use a counter to determine how many indices in that buffer are occupied. So, each frame, you set the counter to 0 and let it fill up again. If you had all the grass in view, then zoomed in so the amount of grass that survives culling is smaller than the last frame, there will be data still in that buffer since it was not overwritten (the buffer's counter is smaller). This is fine, and those extra items are not rendered because the instancing shader will only instance objects up to the counter.
      So overall, marginally greater performance, and depending on how you implemented the SAC algorithm, slightly higher memory usage

    • @Gameslinx
      @Gameslinx 2 роки тому +3

      Secondly, by "chunking" and using separate compute buffers for each chunk, you are increasing the amount of draw calls. On a large terrain with lots of chunks, you start to negate the benefits of instancing.
      Instead of using an append buffer for each chunk, I have a global buffer which holds every object. You can run the culling compute shader on every chunk and append the result into one buffer and send that buffer over to the shader which results in... One draw call :)
      Of course, with a LOT of objects you can fill the buffer, so it's probably more effective to create a list of buffers depending on how many objects can be rendered. For every X amount of chunks, create a new buffer and every subsequent chunk outputs into that one instead. That should minimize draw calls. Of course, more complex, and I don't know how far you're going with this project lol, but if anyone else is reading this it might help :)

  • @lucakassab4745
    @lucakassab4745 2 роки тому +10

    hey dude great video!, i discovered your channel recently with the grass series, even though i'm a unreal engine developer i find all this stuff pretty intresting! cheers from Brasil!

  • @alyssafaden9443
    @alyssafaden9443 2 роки тому +2

    This approach is so kookee ... no one else does it like this (the video, not the programming). At first I was all WHAT THE ACTUAL??? BUT IT IS AWESOME. I love it. so incredibly unique

  • @jordonwaters9778
    @jordonwaters9778 2 роки тому +4

    You are phenomenal. I would love some more in depth code explanations

  • @srqubit9480
    @srqubit9480 2 роки тому +9

    I have an idea
    if you take the grass and create a version that is a single triangle
    This would be activated from a certain distance depending on the resolution There would be no way for you to realize that it is of worse quality
    Essentially a LOD system

  • @Gilesone1989
    @Gilesone1989 2 роки тому +1

    Ok now I have to see the complete serie about grass rendering.

  • @CausticCatastrophe
    @CausticCatastrophe 2 роки тому

    i love that you not only present great info more generically, but also point out how youtube style game dev tutorials completely forget to talk about how its not optimal or even how to even approach optimizing.

  • @rodrigo.rebelatto
    @rodrigo.rebelatto Рік тому +1

    Man... I'm fighting this whole week to make a descent grass in my project. It's funny how something like "oh, all the heavy work is done, let's just put grass here" became a quest through gpu buffers and pipeline shaders... (come on I'm just a programmer...). But your video helped me a lot to understand the dimension of the problem that I'm gettin into :') thanks !

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

      foliage is probably top 3 hardest problems in graphics lol

  • @chimichuflis
    @chimichuflis 2 роки тому +2

    You definetly need more subs, thank you for the work you made!

  • @ComfieDev
    @ComfieDev 2 роки тому +7

    ok you are so underrated

  • @JohnTTA
    @JohnTTA 2 роки тому +5

    Learning grass programming in games with some John Lennon looking modafoca. Nice 👌

  • @mil0s251
    @mil0s251 2 роки тому

    bro, don't know how did i find your channel, but it's great and it will blow up

  • @noahharden5894
    @noahharden5894 2 роки тому

    I would’ve never expected to see slime in a video about 3d modeling grass but here we are

  • @kh_y
    @kh_y 2 роки тому +12

    The frustum culling is really satisfying to look at in the scene view. Have you tried mesh LODs and fog? Looks like you can incur a ton of overlapping triangles at the sheer angles farther away. Anyway, cool video!

    • @Acerola_t
      @Acerola_t  2 роки тому +2

      mesh LOD is going to be necessary for sure, just not sure how I want to implement it since I'll need to have an extra buffer for LOD grass positions. I'll be doing fog inevitably but I wanted it to be its own video.
      Thank you!

    • @EpicTonyBoi
      @EpicTonyBoi 2 роки тому

      What if you use the last video's method as a "LOD" type thing since it will look better at further distances and will not have a large performance cost

  • @maribelmenese4845
    @maribelmenese4845 2 роки тому +1

    Dude your seriously underrated
    Keep posting videos I love it a lot

  • @fr3ddyfr3sh
    @fr3ddyfr3sh 2 роки тому

    Excellent job sir. Unbelievable how complicated these 3d optimisations are

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

    First time I saw your video I thought "WHO IS THIS CLOWN?", but actually it turns out being a video with a funny/oiginal/intentionally cringe format, with very good content. Very nice.

  • @Povilaz
    @Povilaz 2 роки тому +1

    Now that looks sick. Awesome job, nice grass.

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

    I didn't think I'd be watching John Lennon teach me about video game grass rendering techniques today, but I'm not mad.

  • @WinterAodh
    @WinterAodh 2 роки тому

    Had a project where grass had a centerpiece. Gave up on it so fast because it was just not worth the effort. I'm happy to see that this video just confirms my suspicions back then 🥴

  • @gustavosantos106
    @gustavosantos106 2 роки тому +1

    Next step would be, instead of grass growing homogenously through the ground, make it so every 5 or so grasses share its position and extends in diferent directions forming a bush.
    And then add a static perlin texture to determine parts of the ground with more or less vegetation.

  • @_zurr
    @_zurr 2 роки тому +1

    Absolutely rockin those shades man

  • @SkeleTonHammer
    @SkeleTonHammer 2 роки тому

    Since you're looking at the grass at about eye height in-game, the further out you go, the more you're looking at the distance at grazing angles (and taking up less overall proportion of the screen space).
    Because of this, grass becomes increasingly obscured by other grass as it becomes more distant, and therefore in all likelihood you could get away with reducing the density of the grass gradually as it becomes further from the camera with very little noticeable difference but potentially a huge performance boost.

    • @Acerola_t
      @Acerola_t  2 роки тому

      It's hard to do that since the grass positions are pre-computed and not generated in real time.

    • @SkeleTonHammer
      @SkeleTonHammer 2 роки тому

      @@Acerola_t I will say as a 36 year-old 15+ year game dev Old Person, there are a few ways to accomplish this. I believe in you. ;)

  • @ro-ce8vg
    @ro-ce8vg 2 роки тому

    i really cant get enough of the grass ive watched this video like 5 times trying to implement my own

  • @timpani112
    @timpani112 2 роки тому

    After looking at a few of your videos about grass in video games, I have to say that I'm deeply impressed by your videos. The delivery and overall presentation works really well, and it makes your videos a really unique watching experience. I'm not surprised to see that this channel is seemingly starting to take off for real, because all it really needs at this point is some luck; the quality of the content is already here.

  • @nickdevprod3667
    @nickdevprod3667 2 роки тому +1

    underrated as hell

  • @WKerrick
    @WKerrick 2 роки тому

    goddamn, that reveal at 6:00 is sick af

  • @DemonDogAW
    @DemonDogAW 2 роки тому

    The best tradeoff between performance/fidelity would probably be a blend of basic billboard grass with a small radius of the per-blade rendering.

  • @ethanevans8909
    @ethanevans8909 2 роки тому +2

    Monogatari references follow me everywhere, no matter the subject. What a delight

    • @HilbertXVI
      @HilbertXVI 2 роки тому +1

      Where

    • @ethanevans8909
      @ethanevans8909 2 роки тому

      @@HilbertXVI 8:15. Also im pretty sure the channel name (and maybe the intro at 1:07 but that might be stretching)

  • @limo_was_here
    @limo_was_here 2 роки тому

    hey man, i really love that you did this and shared your code to boot. I'm currently busy trying to implement a similar thing within unreal (cause for some reason unreal engine cuts off density of grass using the in-engine available tools at 1000 per 10 m^2. which is not enough to get a similar effect going.) Learning C++ it is. Your code is a really good starting point though, and i'm glad it is there as a reference.

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

    those wind sound effects you use give me big naustalgia hits from dark cloud

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

    you could also propagate the index of the visible ones and the total number of visible Blades.Then you could renderer only the visible blades with drawindirect

  • @stuwustudio
    @stuwustudio 2 роки тому +2

    "If you look down on it from above, it's clearly just some squares."
    -> Finds a new way to render the grass
    -> Doesn't show the new result
    Nah I'm just joking, I know it looks ok-ish from the top because that's exaclty what I've done for my game lol.
    Btw let me know if you ever figure out how to make this grass run even faster. I'm planning to quadruple my map size in my new version, and I don't think It'll hold if I put anymore grass blades on the scene. I'm also starting to hit the memory limit with all these blades.

    • @Acerola_t
      @Acerola_t  2 роки тому

      Haha when I was editing I realized I never showed the top down result, I can assure you it looks like the game Flower now since the base terrain blends with the AO color of the grass.
      My current plan to get it to run as fast as possible while covering an arbitrary area of terrain is with chunking and LOD, there is going to be a major memory cost to it but I calculated it out and the grass in this project only uses a few megabytes of data, this could also be optimized heavily with bitpacking and moving some calculations over to the shader. The scan buffers can be reused so each individual chunk of grass doesn't need its own scan buffers I think. Either way I'll figure it out by the time the next video comes out a week and a half from now.
      Thanks for watching!

    • @stuwustudio
      @stuwustudio 2 роки тому +1

      @@Acerola_t That's cool, I might be able to implement what you did in my own game if you succeed!

  • @TheMaykids
    @TheMaykids 2 роки тому

    Acerola is so Brazilian nickname. Love it.

  • @AndreInfanteInc
    @AndreInfanteInc 2 роки тому +1

    I would think the next step is to set up an LOD switch after a few meters where you switch back to rendering the cheaper non-modelled grass.

  • @lens3973
    @lens3973 2 роки тому +1

    This content is very high quality.

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

    why is john lennon teaching me about graphics processing

  • @luizfernandonoschang8298
    @luizfernandonoschang8298 2 роки тому +4

    Nice video man!
    I know I'm a year late but, what about combining both techiques, this one and the one from the previous video?
    You could define a distance/radius of view, and everything inside this radius (near the camera) is rendered using the complex grass mesh, while everything outside the radius (far from camera) is rendered using the billboard textures.
    Then, as your player/camera moves the billboard textures get replaced by the meshes. It would work like some kind of custom LOD.

  • @nguyenhoangminhtrung2779
    @nguyenhoangminhtrung2779 2 роки тому

    I can't get enough of your videos!

  • @duke.
    @duke. 2 роки тому +4

    why is he john lennon

  • @ElusivePandaMan
    @ElusivePandaMan 2 роки тому

    you know this guy is sempai when he continually uses persona OST

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

    Never thought I'd be lectured on grass by Adrien Brody but here we are

  • @mariovelez578
    @mariovelez578 2 роки тому +1

    Thanks, I learned a lot in this vid, keep up the good work!

  • @NoxiusVI
    @NoxiusVI 2 роки тому +1

    "maybe i could eat blades of grass"
    -bill wurtz

  • @remke5137
    @remke5137 2 роки тому +1

    Persona 3 music. Very nice

  • @fangliu125
    @fangliu125 Рік тому +3

    Thank you for an awesome video! But I found a bug about scan prefix calculation. At 8:56s, the scan array should be 0,0,1,2,2. This troubled me for a long time before I realized it was a small mistake in your video.

    • @Acerola_t
      @Acerola_t  Рік тому +4

      oops! Yeah these older vids i edited in one or two nights so some errors have slipped in.

  • @CSPciccionsstibilepippons
    @CSPciccionsstibilepippons 2 роки тому +1

    you could use the grass from this video near the player and the grass from the last video as lod.

  • @KingBobXVI
    @KingBobXVI 2 роки тому

    Looking at the source for the scan/compact method, I really like the elegance of the solution, but not sure if I completely understand it, so let me explain it and tell me if I'm wrong, lol:
    First pass is simple, just create the true/false buffer with 1's and 0's using the GPU, one value for each grass position.
    Second pass, I think your visual is incorrect. The value of each position should be the sum of the values in the first pass up to that index in the buffer, so with a T/F buffer of:
    [0, 1, 1, 0, 1] the scan buffer should be:
    [0, 0, 1, 2, 2] rather than [0, 0, 1, 1, 2], which I think you just took from the notes (for a different input). Each index counts the number of T values in the T/F buffer before the current index.
    Third pass uses the first and second buffers to determine what values to copy and where, with logic that can be run in parallel thanks to that data, simply:
    if (tf_buffer[i] == 0) return; else { compact_index = scan_buffer[i]; compact_positions[compact_index] = position[i]; }
    What I don't quite get still is in step two, is the scan done on the CPU or the GPU? Because it seems like the most efficient way to do it would be to iterate through the T/F array and do something like "scan_buffer[i] = counter; if (tf_buffer[i]) ++counter;" but it _sounds_ like it's trying to do everything on the GPU in parallel, but that would mean that for each calculation in the scan_buffer it would have to iterate from [0 -> n) on the tf_buffer, which would be incredibly slow for later elements, especially with millions of grass blades. But to do the scan on the CPU it would first have to copy the TF buffer into CPU memory, and then the resulting scan buffer back into GPU memory, which maybe isn't really much of a problem? I supposed I could actually look at your code but that would be effort.

    • @Acerola_t
      @Acerola_t  2 роки тому +1

      You are correct my example output for the scan was wrong.
      This is all done on the gpu, the vote/scan/compact is all done in parallel with optimal thread groups to distribute up the work accordingly. In order to do the scan on the cpu it would require copying all the memory back to the cpu as you said, which would defeat the point of the compute shader culling. Parallel prefix scan is a tough problem and a lot of work has gone into optimizing it which is funny cause it's extremely trivial to do on the cpu.

    • @KingBobXVI
      @KingBobXVI 2 роки тому

      @@Acerola_t - where in your code is the prefix scan actually happening? I did end up taking a look but can't find anything that looks like the scan/compact logic in the compute shader code. I'd like to see how it's actually being done because I still don't really see how it's getting calculated in parallel, haha.

    • @Acerola_t
      @Acerola_t  2 роки тому +1

      @@KingBobXVI github.com/GarrettGunnell/Grass/blob/main/Assets/Resources/CullGrass.compute

    • @KingBobXVI
      @KingBobXVI 2 роки тому

      @@Acerola_t - Oh, the first file in the directory - I'll maintain that it didn't exist and you snuck it in there, editing git's history :P
      Thanks for the link!
      e: wow, this makes very little sense, lol - looks like I'll be taking a look at GPU Gems.

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

    I'm surprised frustum culling every single blade of grass on the CPU every frame in one big linear scan didn't actually make it more expensive.

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

      on the GPU not on the CPU lol if I was processing millions of objects on the cpu each frame there would be less than zero frames a second

  • @radicant7283
    @radicant7283 2 роки тому +1

    Subscribe'd. This is the good shit. Actually good, pro level info with no flashy logos or click bait or algo pandering garbage. It's like if Dimitri Martin went into 3d graphics.

  • @vaibhavjaiswal799
    @vaibhavjaiswal799 2 роки тому +1

    Bro literally i just found your channel and i literally learned more in last 30 mins than past few months. I am a developer mainly work on gameplay elements and AI, still completely noob when gomes to graphic programming. I really like the way you teach everythingand i really wanna learn all these things. Is there any chance that you planned for tutorial series completely from scratch for graphic programming.

    • @Acerola_t
      @Acerola_t  2 роки тому +1

      Probably won't do a tutorial series like that, if you're interested in a good "from scratch" tutorial series for Unity shaders then I really recommend Jasper's tutorial series on rendering which goes over recreating Unity's standard built-in uber shader.
      catlikecoding.com/unity/tutorials/rendering/

    • @vaibhavjaiswal799
      @vaibhavjaiswal799 2 роки тому

      @@Acerola_t Thanks for this.
      Can you suggest more resources which teach graphic programming from scratch

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

    I actually like the billboard grass better stylistically. The only problem would be figuring out how to get it to work when you face down.

  • @untitledisdead
    @untitledisdead 7 місяців тому

    could do a series of lower LOD blades using lower vertices dependent on distance to camera. The reason I say a series of rather than just having the lowest model at a further distance i think it would save comp cost by transitioning to lower details sooner yet more subtly like a gradient if that makes sense.

  • @zoa011
    @zoa011 2 роки тому +1

    i know nothing about most of what your saying but the video was still dope :)

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

    The Huniepop soundtrack RULES

  • @Fabio-zc7bs
    @Fabio-zc7bs 2 роки тому

    Wouldn't this be more useful if we combined both techniques? I mean, you can still use billboards at distance as an LOD to save performance. Generally, I prefer to use only billboards but it comes with a cost. Overdraw
    I use unreal so the engine does part of the job like the culling by itself. What I generally do is to use a more dense billboard when the camera is close (like 4 to 5 planes with 2 or 3 loopcuts on it so it can bend with the wind) but as it goes further away I reduce the number of planes and loopcuts on the mesh. This way, you can bend the mesh by default on your 3d modelling tool so it doesn't look too straight when looking from above. The only thing that kinda remains a problem in this case is the overdraw as I said. But you can solve it by making a texture that covers most part of the mesh (or the oposite).

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

    That vote-totalling culling method clicked like 0.5s after the end of the video, makes me feel like maybe I'm not a total fraud lol

  • @joachim4660
    @joachim4660 2 роки тому

    really nice grass

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

    "How do we fix this, well, with doctor thesis level algorithms of course" sent me 🤣🤣🤣😂😂😂🤣

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

    I would love to see a video where you do Fortnite style grass. Theirs is REALLY fast and all the animation is done in the texture itself based on wind speed. Cool stuff

  • @joziermaster3269
    @joziermaster3269 2 роки тому +1

    I love these vids. Super informative and the whole stand-up and talk thing is legit lit.....but honestly I think like halfway through you should cut out more of the "you" and show more of the task doing.....just constructive criticism but you straight up lit bro...def got my sub ftw.

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

    this might be a waste of time, but since the grass is so uniform (it's pretty much just a grid), you might be able to use the gpu to sort the individual blades in a way to reduce overdraw, and if that's too slow, you could instead rotate each tile of grass (by multiples of 90 degrees) so that the first triangles are always closer to the camera, then pull the actual blade positions from a texture. also, octagedral billboards are cool as fuck. they're like the flat billboards, but 3d

  • @dimensional7915
    @dimensional7915 2 роки тому +1

    Guess I'm gonna go learn like 6 more levels of math then come back here later

  • @psuw
    @psuw 2 роки тому

    awesome stuff

  • @JG-nm9zk
    @JG-nm9zk 2 роки тому +3

    Why use Maya when you can use blender?
    You could have shown the grass from above to show how it compares with the bilboarded grass. Anyways great!

  • @Paledomain
    @Paledomain 2 роки тому +1

    what if you introduced distance based detail culling like you mentioned in the previous grass video, make the closer grass bits these new 3d ones, and the ones beyond the culling range billboard grass?

  • @Benjo69420lelol
    @Benjo69420lelol 7 місяців тому +1

    my brother in Christ looks like AJ Jackson, the band leader of Saint Motel

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

    I would totally appreciate for you telling me how those 'marble' like textures at around 5:15 were formed by adding noise to those sin waves.
    Imho, The swirls are not possible with just the basic random hash function, yes? So something like perlin noise was used by you?
    Thanks and I love your content, man!!

  • @abulak3477
    @abulak3477 2 роки тому +1

    9:25 what is the difference between yours and *occlusion culling* ? does it perform better??

    • @Acerola_t
      @Acerola_t  2 роки тому

      This implementation doesn't support occlusion culling, that's another thing that would have to be implemented manually with compute shaders. As far as I'm aware, in order to support occlusion culling you would also have to sort the position buffers each frame and that might be too costly.
      As for what the difference is, occlusion culling is when you don't render objects that are obscured by other objects in view. Frustum culling is when you don't render objects that are outside the camera view. Ideally you would have both.

  • @JoeEnderman
    @JoeEnderman 2 роки тому +2

    Is there a way to decrease the amount of grass the further from the camera it is? Is there a way to render simpler grass when it is only a few pixels tall?

    • @Acerola_t
      @Acerola_t  2 роки тому +1

      Yeah you could do that

    • @JoeEnderman
      @JoeEnderman 2 роки тому +1

      @@Acerola_t It would be tricky to implement, but could save on system resources in some scenarios.

  • @idkidk9204
    @idkidk9204 2 роки тому +1

    Peak nerd programmer right there, good content

  • @bdenix1997
    @bdenix1997 2 роки тому

    Hey acerola. i dont want everywhere to be grassy. i want some paths etc. using a heightmap, lets say if the grayscale of the pixel is more than .5 .
    in that case i can just alter the height or the whole position for that id, of the buffer right? that moves that grass outta way right? yeah.
    but it still renders it on that position. i made like if its not gonna be spawned, i set the position to 0,0,0.
    doing this ended up, every unwanted grass to pile up on 1 coordinate, and if you look at it, it lags. like fps goes down to 0.
    so i kind of tried to make a uint buffer that is the last id of the last ok position, then i would just increment that id if its a successful spawn, then i would use that lastID, instead of doing id.y * radius + id.x you know. was a nice idea at first. set the buffer 0 from the start, incremented it every kernel execution, then i did getdata on C# . when i output the id thing, it is always different by a little bit.
    i dont know what causes this. and i'm searching for an exact number of the successful tries. so that maybe i can manage to not render those unwanted grass.

    • @bdenix1997
      @bdenix1997 2 роки тому

      and if i use that id as an index to the buffer, i get incredibly low amound of grass. definetely something is not right there. the output number is very low too.

    • @Acerola_t
      @Acerola_t  2 роки тому

      You can make a texture that acts as a mask during position generation. Sample the mask texture and if it's white or whatever then keep the position otherwise discard it.
      It's not a very simple problem though and you'll end up with a lot of wasted memory if you aren't careful about it.

    • @bdenix1997
      @bdenix1997 2 роки тому

      @@Acerola_t just learned that there was an append type of compute buffer which you can append to the buffer. its just what i wanted.

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

    >So how do we fix this?
    By using the expensive method up close and the cheap one farther away?

  • @jublubsstudios8650
    @jublubsstudios8650 10 місяців тому

    I didnt expect fucking Jhon Lenon to teach me how to render gras real time,

  • @chilli1472
    @chilli1472 2 роки тому +1

    yo what kind of glasses are that? they're super badass

    • @Acerola_t
      @Acerola_t  2 роки тому

      lmao they're random circular glasses off amazon for like $15

    • @chilli1472
      @chilli1472 2 роки тому +2

      @@Acerola_t smart, don't fall for the designer scams

  • @gustavosantos106
    @gustavosantos106 2 роки тому

    Acerola, why are you so genius being so young?

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

    You should take a loot at ghost of tsushima's grass

  • @maxximumb
    @maxximumb 2 роки тому +2

    I was just wondering why you chose Maya instead of Blender that doesn't require you to fib a little?

    • @Acerola_t
      @Acerola_t  2 роки тому +1

      Cause Maya is industry standard there's really no other reason. I use blender too when I feel like it.

  • @renatocesar9972
    @renatocesar9972 2 роки тому +1

    Nice video, i wish he had more content in shaders and stuff like this. A hint for you, try to not cut your head out of the frame.

    • @Acerola_t
      @Acerola_t  2 роки тому

      Yeah I didnt have the chance to re record so i just went with it lol

  • @OctagonalSquare
    @OctagonalSquare 2 роки тому

    Yeah gonna have to cull based on distance probably. That way you’re only rendering up to like 30 units away

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

    pro tip: turn on the closed captioning

  • @RuuyG
    @RuuyG 2 роки тому

    Please, send this to Game Freak.
    Joke aside, SV seem to use mesh grass.

  • @JoJoboiWav
    @JoJoboiWav 2 роки тому +1

    Acerola Orion Heart Underblade

    • @Acerola_t
      @Acerola_t  2 роки тому

      That is where the name comes from ye

    • @JoJoboiWav
      @JoJoboiWav 2 роки тому

      @@Acerola_t W