Rasterizer Algorithm Explanation

Поделиться
HTML-код
  • Опубликовано: 30 окт 2019
  • Our apprentice Cédric Girardin made a great video about the rasterizing algorithm with the MANIM animation library.
    Music Resonance by Vincent Rubinetti:
    vincerubinetti.bandcamp.com/a...
    Source Code:
    github.com/cpvrlab/SLProject/...
    Manim:
    github.com/3b1b/manim
  • НаукаНаука

Комментарии • 112

  • @pyxelr
    @pyxelr 4 года назад +100

    Great to see more works being done with Manim. It's a pure pleasure watching all the animations.

    • @tomasbernardo5972
      @tomasbernardo5972 8 месяцев назад

      Came here to say that exact thing. I've been trying to setup manim, could you point me in the right direction?

  • @lambichlambrovski9956
    @lambichlambrovski9956 3 года назад +29

    This is very well done. I've seen many articles that were too technical to understand and too excessive with all of the details. The visuals helped a lot with understanding the algorithm.

  • @aevideos5883
    @aevideos5883 4 года назад +65

    Wow this guy has a really nice voice! I wish I was that cool!

  • @anthonypace5354
    @anthonypace5354 Год назад +3

    Great explanation. I did something like this in high-school, but had to code this just recently. It’s very close to what I was thinking of doing, but watching your vid helped clarify things in my mind to a point I was able to make further optimizations. It is an excellent starting point, and The animation was exactly what I needed. More of these please.

  • @prathmeshrautkar6683
    @prathmeshrautkar6683 3 года назад +7

    most simple and understandable explanation. Thank you !!!

  • @user-tr2hc2xx3b
    @user-tr2hc2xx3b 3 года назад +3

    Wow, one of the best explanation I've heard, thank you!

  • @swamihuman9395
    @swamihuman9395 5 месяцев назад +1

    - Well done. Thx.
    - Clear, concise, engaging.

  • @schmarcel4238
    @schmarcel4238 4 года назад +8

    Such a great explanation and what a nice voice! Perfect 5/7

  • @LogicEu
    @LogicEu Год назад +3

    Beautiful and simple, thank you for this very helpful and easy explanation.

  • @karen-7057
    @karen-7057 2 года назад +1

    Beautifully done. Masterfully explained thanks so much for sharing

  • @Alex-op2kc
    @Alex-op2kc 3 года назад +3

    THANK YOU!!! Great teaching!

  • @beadx6
    @beadx6 7 месяцев назад +1

    Best explanation video.

  • @hmz121fast
    @hmz121fast 3 года назад +1

    Simplest explanation ever, Big like

  • @EffectEcho
    @EffectEcho 2 года назад +2

    this made it so clear. thank you so much

  • @lancemarchetti8673
    @lancemarchetti8673 11 месяцев назад +2

    This is so interesting! Thanks for making this video. It helps me approach image binary representation without feeling intimidated we I'm trying to code out an idea.

  • @samarthtandale9121
    @samarthtandale9121 Год назад +2

    Beautiful video ❣️ truly amazing 💯🔥

  • @SkyenNovaA
    @SkyenNovaA Год назад +3

    Wow, this makes me want to write my own implementation of this. Very interesting stuff.

  • @jwfundsd
    @jwfundsd 4 года назад

    Excellent!!! Congratulations!!!

  • @RenormalizedAdvait
    @RenormalizedAdvait 2 года назад +1

    Beautiful, thank you and keep it up.

  • @SirusStarTV
    @SirusStarTV Год назад +1

    Great! manim revolutionazed visual explanation videos.

  • @luckylukeskywalker
    @luckylukeskywalker 3 года назад +6

    thank you very much
    your explanation is almost perfect
    and the graphics were very helpul
    unfortunately this is another example of „what can be explained in 8 minutes, what my professor can't explain within around a total of 20 hours“
    i‘m glad there are videos like this

  • @yaofengwang4509
    @yaofengwang4509 4 года назад +1

    Nice explanation with great animation thx

  • @ricky12105
    @ricky12105 3 года назад +8

    Amazing video! Reminds me of 3b1b. keep it up!

    • @katech6020
      @katech6020 3 года назад

      it is because he is using Manim which is made by 3b1b

  • @smit17xp
    @smit17xp Год назад +1

    Thanks you so much. This very easy to understand!!

  • @VitoxCzechia
    @VitoxCzechia 2 года назад +1

    Very nice video! Good job.

  • @TheShinx317
    @TheShinx317 4 года назад +1

    Very good animation, well done

  • @ARBB1
    @ARBB1 2 года назад +2

    Great work

  • @YOOOOOOOOOOOOOOOOOOOOOOOOOOOO
    @YOOOOOOOOOOOOOOOOOOOOOOOOOOOO 2 года назад +2

    This video was awesome

  • @clucie
    @clucie Год назад +1

    awesome!

  • @yasamanasgari2017
    @yasamanasgari2017 Год назад +2

    Thanks very much, understandable

  • @Brahvim
    @Brahvim 3 года назад +1

    Basically, lerp colors between each vertex on a line, then fill lerped colors between each pixel!
    I hope I am right and this helped anyone who wanted a quick explanation ":D!

  • @anlmaral1762
    @anlmaral1762 Год назад +2

    Such an in depth and clear explanation!

  • @user-cp6rt7rw2l
    @user-cp6rt7rw2l 5 месяцев назад +2

    Shouldn't the first linear equation with given point be y=x+2?

  • @HongLab
    @HongLab Год назад +1

    Thank you.

  • @djukicdev
    @djukicdev Год назад +1

    Great explanation

  • @muhammedyasinhanyasar539
    @muhammedyasinhanyasar539 2 года назад +1

    an awesome video.

  • @Jespertheend2
    @Jespertheend2 3 года назад +1

    Thanks! This helped me.

  • @jhoanmartinezsilva2609
    @jhoanmartinezsilva2609 3 года назад +2

    Awesomeeee

  • @karim-gb5nx
    @karim-gb5nx 2 года назад +1

    Well done.

  • @pulatpulet7202
    @pulatpulet7202 4 года назад +2

    nice video dude!

  • @jonathanmoore5619
    @jonathanmoore5619 3 года назад +2

    Perfect expo

  • @mingsumsze6026
    @mingsumsze6026 2 года назад +1

    Just to add to the discussions. Some textbook uses the DDA-based approach and maintain an active edge list which stores all of the edges that crosses the current scanline (I am not able to describe the algorithm in full here bu t just to give you an idea).
    By exploiting the coherence properties of scanline (such that all pixels bounded by the same 2 edges in a scanline must have the same "insideness"), one can efficiently compute all of the "insideness values" of all pixels along the scanline. I am pretty sure that this approach can easily generalise to support color interpolation across scanline as well.
    A distinct advantage of what seemingly to be an inefficient and counter-intuitive approach is that it can handle overlapping polygons. By maintaining also a polygon identifier inside the active edge list, we can effectively perform visibility-testing right at the rasterisation stage (without needing z-buffer) and writes directly to frame buffer.
    I might be wrong here. Please correct me if I am.

    • @mingsumsze6026
      @mingsumsze6026 2 года назад

      After I think about it more I realise the DDA-based approach should turns out to be more space-efficient since the exact pixel coordinates of the lines do not have to be stored. Also, running Bresenham's upfront before the actual scanlining would induce an overhead.
      Given that the primitive is given by the form of an edge list, the DDA-based approach should be a better choice.

  • @francescorizzi2601
    @francescorizzi2601 2 года назад +6

    Very nice video, i'm just wondering what is exactly the formula for linear interpolation.. How did you use it in order to interpolate colors between vertices? Thanks

    • @gabrielbap1
      @gabrielbap1 2 года назад +2

      I'm guessing the bresennam algorithm will give you a sorted array of points to represent the line between each two vertices of the triangle. For each position i in this size n array, the color will be (i/n)*color1 + (n-i/n)*color2. Does it make sense?

  • @Ne1gh_
    @Ne1gh_ 6 месяцев назад

    Nice! It would be great to see Bresenham algorithm on the circle.

  • @yuanperry3443
    @yuanperry3443 Год назад +2

    nice! .

  • @user-dy2on3uu4e
    @user-dy2on3uu4e 4 года назад

    great!

  • @vinniciusrosa8284
    @vinniciusrosa8284 4 месяца назад

    Great

  • @cory99998
    @cory99998 2 года назад +1

    ty

  • @diamondbackdtb
    @diamondbackdtb 4 года назад

    how did you get manim to render this?

  • @perfectionbox
    @perfectionbox 11 месяцев назад

    For texturemapped triangles however you need to use perspective divide instead of interpolation

    • @npip99
      @npip99 7 месяцев назад +1

      Perspective divide doesn't have anything to do with interpolation. In 3D graphics pipelines, that occurs in the vertex shader, before the fragment shader ever runs on the interpolated values.

    • @perfectionbox
      @perfectionbox 7 месяцев назад

      @@npip99 What I meant is, you need to yeah perspective divide when processing vertices and then interpolate the w component to get the correct texture coord. On PS1 they didn't and just lerped the texture coords xy components instead. Probably too slow to transform vertices into normalized space.

  • @therayvenn3482
    @therayvenn3482 2 года назад +2

    Why'd you delete the source code??? Can you reupload it please?

    • @korigamik
      @korigamik 4 месяца назад

      Yes! Did you hear any response?

  • @user-cp6rt7rw2l
    @user-cp6rt7rw2l 5 месяцев назад +1

    Shoouldn't the first linear equation with given point be y=x+2?

  • @Mauricetz
    @Mauricetz 3 года назад +1

    Thanks, I'm building a small graphic motor to be implemented in a ESP32 :)

  • @papercolor8259
    @papercolor8259 Год назад +2

    how to make this animation, PPT?

  • @chrischoir3594
    @chrischoir3594 3 года назад +3

    y3 = [1,1,2,9] why 1 twice?

  • @bluetran1
    @bluetran1 3 года назад

    Nice video! How did you make the animation?

    • @tuna3977
      @tuna3977 3 года назад +1

      Manim. It's a mathematical animation engine. You can find it on GitHub

    • @bluetran1
      @bluetran1 3 года назад

      @@tuna3977 thank you so much

  • @florianleuenberger989
    @florianleuenberger989 4 года назад

    Nice backgroundmusic

  • @vornamenachname8001
    @vornamenachname8001 2 года назад +2

    nice video, but why isnt the triangle after being projected from worldspace to screen space converted to its parametric form there and then for each pixel it is checked if both parameters are within the 0-1range? im no programmer but solving the same equasion for every pixel seems faster than storing so many things in lists and sorting values.

    • @karen-7057
      @karen-7057 2 года назад +2

      Well... If you propose to check every pixel you are proposing a brute force quadratic solution (O(n^2)) while sorting algos are way more efficient (O(n logn)).
      Space in a computer is cheap. What you optimize is operations made. check up on dynamic programming to see more examples of the space-operations trade off

    • @saschakehrli2496
      @saschakehrli2496 2 года назад +1

      yeah his explanation kinds suckzzz

  • @GabrielPiveta
    @GabrielPiveta 4 года назад +30

    This resembles me 3blue1brown.

    • @AarvAanD
      @AarvAanD 3 года назад +1

      somebody got inspired

    • @henryzt
      @henryzt 3 года назад +9

      He did mention It’s made using Manim, an open source animation engine made by 3b1b himself

    • @yuxuanxue4365
      @yuxuanxue4365 3 года назад +1

      @@henryzt Great open source engine

  • @samarthtandale9121
    @samarthtandale9121 Год назад +2

    Hey, you have outstanding explanation skills (just in case you don't know) ... You should keep uploading new videos, rather start a playlist on some topic 🔥

  • @tomasbernardo5972
    @tomasbernardo5972 8 месяцев назад

    Would bresenham's algorithm work for vertical lines?

  • @niks660097
    @niks660097 8 месяцев назад

    All of this is done by dedicated hardware(ROPs) in sub-milliseconds time, modern GPUs are amazing, if you want to know your GPU's raster speed, check its number of ROPs(and memory bandwidth too)..

  • @socdfx
    @socdfx 4 года назад

    Hi. Not clear @3:30 onwards why y[3] repeats the 1 and similar for the y[1] repeats the 9

    • @girardincedric6865
      @girardincedric6865 4 года назад +1

      same reason as @4:10 the corners have the postion stored twice (also while calculating the linear equation the corners overlap)

  • @kkadir
    @kkadir 2 года назад

    Thank you for the video. The link to the source code is broken. Can you fix it? I would like to see the code.

  • @dobostristan6244
    @dobostristan6244 Год назад +1

    Hi, the Github link does not work any more

  • @miccallwang3164
    @miccallwang3164 3 года назад

    github link can not found ?

  • @int16_t
    @int16_t 3 года назад +1

    I believe the image coordinate is wrong in this.
    0, 0 is in the top left corner.

    • @TheBuilder06
      @TheBuilder06 3 года назад +1

      There is no standard for NDC coordinates. Both are correct.

    • @int16_t
      @int16_t 3 года назад

      Ok, I get it. I admit defeat. No further comment.

  • @slingshot7602
    @slingshot7602 11 месяцев назад

    In 3:28 why in y3 why there is two 1??

  • @creativecraft_mc
    @creativecraft_mc 3 года назад +1

    this is the new 3blue1brown

  • @otesunki
    @otesunki 3 года назад +2

    3blue1brown fan?

  • @rahulshah6119
    @rahulshah6119 Год назад

    why is y_3=[1 1 2 9] and not [1 2 9]
    same with 7899 not being 789 for y_1
    and 88 not being just 8 for y_10 (although this can kinda make sense?)

    • @girardincedric6865
      @girardincedric6865 Год назад

      exactly for the reason we have that y_10 is [8,8], when we implement this algorithm we can always guarantee that a y_set has 2 points so we don't have to check every time in the drawLine for an edgecase.
      the reason for y_3 = [1,1, 2, 9] and y_1 = [7,8,9,9] is the overlap of the lines at there endpoints. we leave the overlap intentionally exactly for this case.

  • @erikthegodeatingpenguin2335
    @erikthegodeatingpenguin2335 4 года назад +1

    lol are you using 3blue1brown's rendering library?

    • @int16_t
      @int16_t 3 года назад

      Why did you use the word "LOL"? Is it funny? I find it COOL!!

    • @erikthegodeatingpenguin2335
      @erikthegodeatingpenguin2335 3 года назад

      @@int16_t Yeah, I am mildly amused at the observation that he is using 3blue1brown's rendering library. It's pretty cool too

  • @marcjukil300
    @marcjukil300 3 года назад +3

    Okay let's go, I am going to develop the killer of VulkanAPI ! 👹👹😈😈

  • @jimmoriarty6964
    @jimmoriarty6964 4 года назад +3

    3b1b?

  • @tunit6458
    @tunit6458 2 года назад +1

    Jurgen Klopp EROTIC VOICE
    YOU???
    🤔

  • @whickervision742
    @whickervision742 2 года назад

    Pretty video but this algorithm would be extremely slow.

  • @SirusStarTV
    @SirusStarTV Год назад

    Imagine if gpus used *flood fill* algorithm instead lmao

  • @alexanderthorbrugge6489
    @alexanderthorbrugge6489 4 года назад +1

    Way to few subscribers :(

  • @vapourmile
    @vapourmile 4 года назад +4

    The best thing about this was the graphics. This was otherwise terrible.
    First off, he doesn't show how to implement Bresenham's algorithm. You don't solve the linear equation. That's the whole point of the algorithm. Second, when you do use it, you only use it for wire-frame graphics. For polygon graphics you only need to generate the pixel pairs for each raster, the start and finish. As you can see, this linear equation doesn't achieve that.

    • @girardincedric6865
      @girardincedric6865 4 года назад +3

      Thx you very much for the feedback!
      Sorry that I didn’t explain the Bresenham's algorithm. The Video was made with the intent that it will serve as an additional explanation for the understanding for our Computer graphics script, in which the Bresenham’s Algorithm is explained in detail. For the point, that i didn't solve the linear equation, I already assume that people who watches this video can solve a linear equation.
      Unfortunately, I don't quite understand what you mean/try to explain in your second point. I applied the scanline algorithm for my own 3D renderer, and it did solve that just fine.
      If you want to see my own 3D renderer, where I use the scanline algorithm for polygons, you can clone my “3D CPU renderer project” on github (C#):
      github.com/cedi-code/VertexProject

  • @blocksrey
    @blocksrey 2 года назад

    Wow this is slow lmao

  • @z304
    @z304 2 года назад +1

    Your first equation is wrong