Jump to content
IGNORED

New Intro released "Flat Shading Is Slower Than Gouraud"


Heaven/TQA

Recommended Posts

we have just released a small intro for the VBXE PAL... 

 

All is done in realtime, so 3d pipe incl. rotation, persptrans, flat shading and gouraud. Scanedge and Goruaud done with little blitter magic (thx to Axis and his Amiga experience :D). Code: Heaven POKEY Music: Miker in Music Pro Tracker (not RMT) Artwork: Havoc Released at the Nordlicht 2019 Party

 

it has some bugs (objects miss some faces and don't know why but it was a quick 24h putting together project so more fire and forget entry ;)) same with loading adress etc.

 

 

 

 

dsr_flat_shading_is_slower_than_gouraud_vbxe_party_version.xex

  • Like 9
Link to comment
Share on other sites

7 minutes ago, VladR said:

Nice !

 

Is it running in 320x240 ? I presume you use VBXE just to draw the scanlines, right ?

 

You do use tables for math, though - right :) ?

 

 

Almighty 6502 is taking the vertices/facelist/face normals and do prepare rotation mAtrix, rotate all shit and puts it into transformed tables (except normals), calcs average z per face, sort faces by Z, do culling by using 2d dot product, then passes that to the actual tenderer.

 

that does the poly scanedge but here 6502 leaves it to blitter. With some blitter operations i do the actual scanedge and fills the poly scanline by scanline.

 

now for Gouraud shading of course additional steps needed so global face gradient steps calculation and interpolating across the face (again with blitter).

 

the flat shading is different to my former z shaded approaches as it rotates the face normals and calculates dot product with light vector and does the face color by lookup into a cos table.

 

the display is 256x200 in 256 colors. Byte per pixel. (Vbxe).

 

now how can the 14mhz help in maths? Well... it has 12bit step values so I have a 64k “lookup table” which I copy with blitter source into edge tables left/right.

 

and with some blitter operations I calculate the length by doing logical operations and sub right from edge to get the length which is fed into another blitter liste actually doing the line blit.

 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Very very nice as always Heaven, I'm sure 'you know who' will have words about your coding skills :)

 

Always nice to see a Thalion logo...And of course a bit of love for the VBXE board..

 

Can't say I have the slightest clue about all that serious maths going on (well, no clue) but its a thing of beauty....

 

Paul.

  • Like 1
Link to comment
Share on other sites

1 hour ago, Mclaneinc said:

Very very nice as always Heaven, I'm sure 'you know who' will have words about your coding skills :)

 

Always nice to see a Thalion logo...And of course a bit of love for the VBXE board..

 

Can't say I have the slightest clue about all that serious maths going on (well, no clue) but its a thing of beauty....

 

Paul.

 

Thx. But I tried out the ignore list and it works out so ;)...

 

re: thalion into desire logo... well still on my list is the complete intro.... with rain drops etc...

  • Like 1
Link to comment
Share on other sites

1 minute ago, Rybags said:

Looks good - just need to check it out in emulation (real hw later) - the scrolling text looks a bit chunky in movement but I assume that's just YouTube screwing with it.

Yeah please let me know I was not sure if ok or not or I am loosing one pixel... ;)

 

since Youtube doesn’t like again video exports from Altirra (fucks up aspect ratio)... I recorded quickly with bandicam which doesn’t help either ;) in terms of smooth movements.

Link to comment
Share on other sites

The aspect ratio problem is because interlace is disabled - if you enable interlace it should look right.

 

But then the problem of frame blending emerges and it just doesn't look right.

Generally I just use an intermediate re-encode and double the vertical size to make it right.

 

The scrolling text looks to be going 2 hires pixels per frame by my estimation.  An advantage of VBXE is we get "proper" fine h-scroll.

Edited by Rybags
Link to comment
Share on other sites

3 hours ago, Heaven/TQA said:

 

 

Almighty 6502 is taking the vertices/facelist/face normals and do prepare rotation mAtrix, rotate all shit and puts it into transformed tables (except normals), calcs average z per face, sort faces by Z, do culling by using 2d dot product, then passes that to the actual tenderer.

 

that does the poly scanedge but here 6502 leaves it to blitter. With some blitter operations i do the actual scanedge and fills the poly scanline by scanline.

 

now for Gouraud shading of course additional steps needed so global face gradient steps calculation and interpolating across the face (again with blitter).

 

the flat shading is different to my former z shaded approaches as it rotates the face normals and calculates dot product with light vector and does the face color by lookup into a cos table.

 

the display is 256x200 in 256 colors. Byte per pixel. (Vbxe).

 

now how can the 14mhz help in maths? Well... it has 12bit step values so I have a 64k “lookup table” which I copy with blitter source into edge tables left/right.

 

and with some blitter operations I calculate the length by doing logical operations and sub right from edge to get the length which is fed into another blitter liste actually doing the line blit.

 

 

For Gourard, I haven't examined the frames in YT vid, but can VBXE's Blitter interpolate shades within a scanline (e.g. you would just provide start/end value) or is the color fixed across full scanline ?

 

For normals, you use 1 byte per x,y,z, I presume ?

 

Link to comment
Share on other sites

7 minutes ago, VladR said:

For Gourard, I haven't examined the frames in YT vid, but can VBXE's Blitter interpolate shades within a scanline (e.g. you would just provide start/end value) or is the color fixed across full scanline ?

 

For normals, you use 1 byte per x,y,z, I presume ?

 

 

Mir “interpolates” across span.

 

coords are 16bit 8.8 signed format.

 

how can blitter interpolate? Well I mentioned the 64k table... 

 

assume that array as 256x256 in 8.8?

 

so when blitter stepping though with say 0080 step value... it interpolates with 0.5

 

00,00,01,01,...

 

now set the start adress to your edge start color and voila...

 

now this is just another index picked which is copied into next blitter command etc

Edited by Heaven/TQA
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...