Genny and 3D

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Feb 27, 2013 8:37 pm

Great! I'll check if it fixes the problem in the init for the demo.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Feb 27, 2013 9:21 pm

And it works fine now! No need for the kludges to get it running on real hardware. It's even a whole FPS faster now! :D

raytest8-joe2.7z

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Feb 28, 2013 12:16 am

Glad to hear the bug has been fixed and it's a very little bit faster ^^

peekpoke
Interested
Posts: 37
Joined: Fri Feb 01, 2013 1:11 am

Post by peekpoke » Thu Feb 28, 2013 6:53 pm

Great work, Chilly Willy and Stef!

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Feb 28, 2013 7:37 pm

You can get just a little bit more speed by replacing the sqrt in the raycaster. For peekpoke's code, that's like this:

Code: Select all

//        s16 dd = (iSqrt( dx*dx + dy*dy ) * (costab[offsetAngle & 511]))>>7;
        s16 dd = (distance_approx( dx, dy ) * (costab[offsetAngle & 511]))>>7;
For my SCD demo, it's like this:

Code: Select all

//        uint32_t dd = ( ( iSqrt( ( F2I(dx) * F2I(dx) ) + ( F2I(dy) * F2I(dy) ) ) ) * ( FIX_COS( offsetAngle ) >> 8 ) ) >> 8;
        uint32_t dd = ( approxDist( F2I(dx), F2I(dy) ) * ( FIX_COS( offsetAngle ) >> 8 ) ) >> 8;
where approxDist() is the same function put into wolfdemo.h since the SCD demo doesn't use sgdk.

Given the resolution and "quality" of textures here, you can't really tell the approximate distance from the real thing.

peekpoke
Interested
Posts: 37
Joined: Fri Feb 01, 2013 1:11 am

Post by peekpoke » Fri Mar 01, 2013 4:04 pm

New version (more cosmetic changes):
raytest9.bin

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Fri Mar 01, 2013 4:39 pm

This is cool stuff !

Would it be possible to make the walls higher to compensate for the wideness ? In one raycaster I did long ago it was matter of changing a constant
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

peekpoke
Interested
Posts: 37
Joined: Fri Feb 01, 2013 1:11 am

Post by peekpoke » Fri Mar 01, 2013 5:34 pm

Thank you!

Exactly - just a matter of changing one variable :) But, higher walls, more pixels to draw - it eats valuable fps xD

Special Edition:
raytest9h.bin

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Fri Mar 01, 2013 6:06 pm

Yeah, that cuts well into the framerate.
What about making the window smaller horizontally, so that there are no black lines ?
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Mar 01, 2013 6:18 pm

That's why I doubled the pixels vertically on my SCD demo - just a bit faster than actually drawing the slice at twice the height because you only do half the texture fetches.

I like the new textures - actually looks somewhat like the start level. :D

peekpoke
Interested
Posts: 37
Joined: Fri Feb 01, 2013 1:11 am

Post by peekpoke » Fri Mar 01, 2013 6:53 pm

TmEE co.(TM) wrote:Yeah, that cuts well into the framerate.
What about making the window smaller horizontally, so that there are no black lines ?
Here is version using my bitmap routines (1:1 pixel formatt) - slower than Stef's bitmap routines. This exact version uses old sgdk, so have vdp bug - will not work on real hw:
raytest9bmp.bin

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Fri Mar 01, 2013 7:05 pm

So you cannot push the pixels closer together on Stef's code ?
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

peekpoke
Interested
Posts: 37
Joined: Fri Feb 01, 2013 1:11 am

Post by peekpoke » Fri Mar 01, 2013 7:14 pm

TmEE co.(TM) wrote:So you cannot push the pixels closer together on Stef's code ?
Cant give u definitely answer right now :) As i understand, Stef's bitmaps routines are fast, because they treat pixels as bytes instead of nibble (8 bit, instead of 4 bit) - so because of this bitmap is "vertically interlaced" on screen. But to be true i didnt looked into his routines very closely... I may be completely wrong! But even if i right, probably, here is some way to switch it to 4bit mode... If Stef read this, and its not difficult for him, he may comment on this issue.

TapamN
Interested
Posts: 15
Joined: Mon Apr 25, 2011 1:05 am

Post by TapamN » Fri Mar 01, 2013 11:17 pm

If the lines in-between visible columns are transparent, you could display the framebuffer on both layers, with one layer shifted to the left one pixel. That would fill up the space between columns and make it just look like it was stretched horizontally.

http://imgur.com/gNXZpe5

peekpoke
Interested
Posts: 37
Joined: Fri Feb 01, 2013 1:11 am

Post by peekpoke » Sat Mar 02, 2013 9:28 am

Thank you, TapamN! Your idea looks very cool - ill try to implement it.

Post Reply