Genny and 3D
Moderator: BigEvilCorporation
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 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!
raytest8-joe2.7z
raytest8-joe2.7z
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 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:
For my SCD demo, it's like this:
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.
Code: Select all
// s16 dd = (iSqrt( dx*dx + dy*dy ) * (costab[offsetAngle & 511]))>>7;
s16 dd = (distance_approx( dx, dy ) * (costab[offsetAngle & 511]))>>7;
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;
Given the resolution and "quality" of textures here, you can't really tell the approximate distance from the real thing.
New version (more cosmetic changes):
raytest9.bin
raytest9.bin
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
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
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
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
Exactly - just a matter of changing one variable But, higher walls, more pixels to draw - it eats valuable fps xD
Special Edition:
raytest9h.bin
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Yeah, that cuts well into the framerate.
What about making the window smaller horizontally, so that there are no black lines ?
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
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: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 ?
raytest9bmp.bin
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
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.TmEE co.(TM) wrote:So you cannot push the pixels closer together on Stef's code ?
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
http://imgur.com/gNXZpe5