Пропустить навигацию
** Sega Genesis 3D engine Day 2 **
0:00 / 0:26

** Sega Genesis 3D engine Day 2 **

Shannon Birt

@birt_shannon2,7 тыс. подписчиков

Открыть в X
453 отметки «Нравится»СкачатьОригинальный пост

17 754 просмотра

** Sega Genesis 3D engine Day 2 ** Added solid filled triangles. Added colors ( full 15 color buffer ) . All code in C so far apart form the buffer clear and DMA buffer sending so should be some good speedups to come yet once line / triangle routines are ported to 68k Assembly. I've done basic filling optimisations in C such as where we can write longs eg fill 8 pixels at once for interior parts of the triangle the function will utilise that. Still using 3 divisions per triangle setup , I think i will see if I can use a cheaper reciprical multiplication instead. All rotations vertices are calculated live , in 2d space at present. #SGDK #SegaGenesis #SegaMegadrive

30 комментариев

Комментарии из оригинального поста в X (Twitter)

  • Фото профиля DANMAKUMAN

    @DanmakumanG

    I had this question in my mind for some time now. I remember reading a post by one of the programmers that Thunder Force V was originally for the MD with a mix or pre-rendered and actual polygons. A MD version of TFV could be actually possible?

    4 отметки «Нравится»

  • Фото профиля Space ☆ Bruce

    @spacebruce

    didn't solve the division problem here, but it's partly what led me to preferring Quads as at least you're only doing 4 instead of 6 to fill the same shape!

    2 отметки «Нравится»

  • Фото профиля Shannon Birt

    @birt_shannon

    I can use reciprical multiplication rather than division so that will cheapen them a bit , although i dislike the cost of the divisions its a the minor part of the cpu load when drawing the triangle in reality, it just hurts seeing 100s of cycles per instruction, thats interesting what you say about quads though . I'm writing the triangle routine in assembly now , hoping for good gains .

    4 отметки «Нравится»

  • Фото профиля Oleg Endo

    @EndoOleg

    @spacebruce Newton-Raphson approximation for 1/x may come in handy 🤓

    2 отметки «Нравится»

  • Фото профиля Shannon Birt

    @birt_shannon

    @spacebruce Yes ! I've used it before and it could net some gains but the hot path is more in the line drawing part of the triangle filling , so focusing energy there at present. If only i could make a workable row layout buffer rather than column.

    1 отметка «Нравится»

  • Фото профиля Oleg Endo

    @EndoOleg

    @spacebruce My guess is, you'd need to generate a "jumpable" code map for various cases of span offset (within 8-pixel tile) and span length, then do optimized unrolled line drawing. MOVEM looks like it can come in handy, I would expect it to avoid the instruction fetch bus access.

    2 отметки «Нравится»

  • Фото профиля Space ☆ Bruce

    @spacebruce

    @birt_shannon This seems the way, I'm doing figure out number of tile spans, move.l, decrement 1, branch, which should be easy to adapt to a table.

    1 отметка «Нравится»

  • Фото профиля Shannon Birt

    @birt_shannon

    Pretty much doing that now , it has to slow down near the edges though . Got to watch the overhead too as if you spend too long figuring out how many spans etc then its slow for everything thats a small span. Unless you have a code segment for every span length which is getting into python script territority to write the asm for you .. the edges eg alignment , do muck up the simplicity of that though . I think movem here is of limited use as it can't stride well .

    1 отметка «Нравится»

  • Фото профиля Space ☆ Bruce

    @spacebruce

    @EndoOleg Yeah, it's easy to cook up schemes that will load the perfect optimised routine for every occasion, but at some point the detection/entry mechanism drags down all the other cases.

    1 отметка «Нравится»

  • Фото профиля Gustavo Araújo

    @gustavoYaraujo

    What if you use smaller forms? If so can you increase the number of them?

    1 отметка «Нравится»

  • Фото профиля Shannon Birt

    @birt_shannon

    Yes, if they are smaller you can have a lot more of them . Its still been optimised though so should be ablemton get more yet .

    2 отметки «Нравится»

  • Фото профиля Some Random Bloke

    @mmyyffaauulltt

    I hate to just geek out but OMG, so cool!! A great start

    1 отметка «Нравится»

  • Фото профиля Shannon Birt

    @birt_shannon

    Thanks 😀 Its been a lot of fun so far !

    1 отметка «Нравится»

  • Фото профиля Lara Frost

    @LaraOnRockets

    Literally incredible! Getting solid 3D at 60fps on Genesis hardware? Respect. 🤩

    1 отметка «Нравится»

  • Фото профиля Зoлoтий Кoзak™🇺🇦🇪🇺

    @zolotoykozak

    👍

    1 отметка «Нравится»

  • Фото профиля Guillaume NUNES

    @Fafadou13

    THX attack chopper 2 is coming !

    1 отметка «Нравится»

  • Фото профиля Shannon Birt

    @birt_shannon

    Haha , maybe just the tail rotor .

    1 отметка «Нравится»

  • Фото профиля Dr. Pashayan

    @DrMomjian

    @pikuma You need two 68k chips which Genesis lacks

    1 отметка «Нравится»

  • Фото профиля Shannon Birt

    @birt_shannon

    @pikuma A 68020 would be nice !!

    4 отметки «Нравится»

  • Фото профиля Dr. Pashayan

    @DrMomjian

    @pikuma Konami used dual chips . Wec Le Mans 24 is a good example of 3d w those 32bit older cisc chips

    1 отметка «Нравится»