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
![Very Happy :D](./images/smilies/icon_biggrin.gif)
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: 2443
- 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 ![Wink ;)](./images/smilies/icon_wink.gif)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
![Wink ;)](./images/smilies/icon_wink.gif)
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
![Smile :)](./images/smilies/icon_smile.gif)
Special Edition:
raytest9h.bin
-
- Very interested
- Posts: 2443
- 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 ![Wink ;)](./images/smilies/icon_wink.gif)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
![Wink ;)](./images/smilies/icon_wink.gif)
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: 2443
- 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 ![Wink ;)](./images/smilies/icon_wink.gif)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
![Wink ;)](./images/smilies/icon_wink.gif)
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 nowTmEE co.(TM) wrote:So you cannot push the pixels closer together on Stef's code ?
![Smile :)](./images/smilies/icon_smile.gif)
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