17 April 2021, 23:48 | #1 |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 181
|
[C, RTG] My raycaster funtime - sharing code and progress..
Source codes. Executables for Amiga and Windows.
https://github.com/mateusz83/msRay --- UPDATE - 26.08.2022 --- msDevPack v0.33 features: - wall/floor/ceiling textures - new, faster floor/ceiling render algorithm (based on screen projection and clipping) - mipmaps (256x256 --> 32x32) - baked lightmaps - distance shading - glowing pixels video: [ Show youtube player ] --- UPDATE - 05.07.2022 --- msDevPack v0.32 features: - wall/floor.ceiling textures - mipmaps (256x256 --> 4x4) - baked lightmaps - distance shading - glowing pixels Test video (includes V1200 test): [ Show youtube player ] Source code. Check out if you are interested in RTG coding, Amiga framework, ReAction etc.: https://github.com/mateusz83/msRay/t..._devpack_v0.32 Executables for testing: http://mstanisz.website.pl/tmp/amiga/msRay-32.zip --- UPDATE - 15.01.2022 --- Hello again, I send some time optimizing the engine and adding features. Right now I have on V1200: - 320x200x32 - average 50 fps, near the walls its 70-80 - generally its fast and smooth. - 640x400x32 - average 16-18 fps (slowly but playable) Check out demo level (this video is from WinUae) [ Show youtube player ] Also check out how its working on Emu68 in INSANE resolutions [ Show youtube player ] Checkout the exec yourself (needs RTG) https://mstanisz.website.pl/tmp/amig...v0.31-exec.zip The whole "devpack" with all sources (PC and Amiga, editor etc) https://mstanisz.website.pl/tmp/amig...pack_v0.31.zip The simplify "devpack" with Amiga sources only: https://mstanisz.website.pl/tmp/amig...31--SIMPLE.zip --- 17 April 2021, 23:48 --- Hi, Recently I spent some time to develop my Racycaster thinking mostly about Vampire accelerators. But the main point was to test the RTG possibilities and render something at 24 or 32 bits. Right now, I get to this point (with 1:1 pixels) - 320x240x32 - about 15-18 fps - 640x480x32 - about 4-5 fps on Vampires, the Warp 1260 at now is about 2-3x slower, but as far as I know the RTG is noy yest fully optimized but please note that these are my coding limits not Vampire or Warp limits VIDEO OF MY RECENT PROGRESS: [ Show youtube player ] I was coding in C, I don't know assembler so I don't think I can optimize the speed any further by now. But the engine like this should problably works on Vampire like at least 40-50 fps in 320x240x32 and maybe at least 20 in 640x480x32.. it was my first RTG and System Amiga coding attempt, I am glad of the results so far. I hope I will back soon to this project and optimize it much better. The textured walls itselfs with shading was very fast even in 640x480x32, but adding floors and ceiling slow donwn everything. They can't be so much optimized as walls. I also wrote a Launcher that scans thru available display modes (in fullscreen or window) that can be filtered and formated by user. NOTE! I would like to share my code to encourage users and coders to use more RTG modes and higher resolutions or color depths. I would like also to hear your opinion and maybe ideas to optimize the performance Probably the floor/ceiling is the major problem right now.. DOWNLOADS: 1. exec from the VIDEO: http://mstanisz.website.pl/tmp/amiga/ray8.zip (works only on 32bit - fullscreen or window) 2. all C sources including Launcher application: http://mstanisz.website.pl/tmp/amiga/ray8-source.zip 3. C source with only main render loop to look up: http://mstanisz.website.pl/tmp/amiga...ender-loop.zip KNOWLEDGE SOURCES For people interested in Raycasting and graphisc programming I am sharing some links: 1. probably the best Raycaster approach and tutorial: https://lodev.org/cgtutor/index.html 2. different Raycasting approach: https://permadi.com/1996/05/ray-cast...e-of-contents/ 3. Watch 3 minutes of this clip first to get the idea: [ Show youtube player ] 4. wolf3d algorithm expalined: [ Show youtube player ] 5. javidx9 (aka One Lone Coder) - yout tube channel - lots of inspirations and knowledge: https://www.youtube.com/channel/UC-y...UJZvieEligKBkA 6. Graphic Gems book series (I-V) lots of graphics algorithms 7. Pikuma Raycasting course - trigonometric approach: https://courses.pikuma.com/courses/raycasting-c 8. another channel with cg aspects coding: [ Show youtube player ] 9. and another yt channel: https://www.youtube.com/user/Bisqwit Last edited by mateusz_s; 19 April 2023 at 00:23. |
21 April 2021, 19:40 | #2 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,652
|
In rendering, a Profiling method is gold for optimizing Fillrate. Some portions can get close to memory bus bandwidth (staring into a wall), per-pixel operations scale quadratically with resolution (big room with few walls).
I'm sure you know some culprits already, I'm stressing this because the more you know about the slowest rendering code, the more frame time you can remove. Measure frame times accurately, and improve low FPS outliers as first priority; ignore average FPS until you've addressed the major time sinks, removing as many per-pixel operations as you can. Profiling gives insight into relative performance. Regarding absolute FPS expectations: A 486DX2-66 MHz "struggles a bit" [ Show youtube player ] (usually means ~30 FPS) @ ~256x140x8bpp (with enemies, shots, score, damage, etc). An 060 is faster per MHz if utilized properly. More information about the systems you run your code on is required to draw conclusions about code performance vs ideal (or close-to-ideal) hardware performance. |
22 April 2021, 13:55 | #3 |
Moderator
Join Date: Jan 2002
Location: Chicago, IL
Posts: 3,389
|
@mateusz_s
Thanx, looks like cool stuff and sounds like fun. |
22 April 2021, 14:44 | #4 |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,408
|
Very cool stuff like I said to you before, well done.....must have been a huge coding effort.
High color RTG graphics on a real classic Amiga will never be that fast I'm afraid to say, even discounting the fact the the CyberGFX API probably isn't very well optimized for high color the Zorro bus throughput is very limited so it will have trouble just drawing a screen quickly. Obviously FPGA computers like the Vampire won't have this limitation. Profiling C (or even C++) would be very helpful for the classic Amiga but as far as I know this isn't possible using gcc? Last edited by NovaCoder; 22 April 2021 at 14:55. |
23 April 2021, 23:06 | #5 | |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 181
|
Quote:
Hello NovaCoder, thanks you for reply.. Well yes, I am aiming for "modernish" accelerators like Vampires with combined RTG.. This because, there are a lots of 8 bit fps and other games, I just wanted to step level up, and see the new possibilities. This code can be much more optimised, and almost for sure could run 40-50 fps in 320x240x32.. which is more than enough. ~20fps in 640x400 could also be possible which is playable. You can use profiler on GCC.. it generates the output file.. but in my case I couln'd find it much useful.. Another possibility is to use cycle counter and cache misses counter, but on Vampire only. But 32 bit color is not only for 3d games that need lots of calculations. For example for a nice Tower Defense game we don't need 32bit, 8 would be enogh, but in higher resolution etc. Anyway I am still trying to make more optimalisations, working in C, optimizing loops, trying different rendering algorithms etc.. no pressure just fun.. |
|
15 January 2022, 16:54 | #6 |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 181
|
(THE FIRST POST HAS BEEN UPDATED)
Hello again, I spend some time optimizing the engine and adding features. Right now I have on V1200: - 320x200x32 - average 50 fps, near the walls its 70-80 - generally its fast and smooth. - 640x400x32 - average 16-18 fps (slowly but playable) Check out demo level (this video is from WinUae) [ Show youtube player ] Also check out how its working on Emu68 in INSANE resolutions [ Show youtube player ] Checkout the exec yourself (needs RTG) https://mstanisz.website.pl/tmp/amig...v0.31-exec.zip The whole "devpack" with all sources (PC and Amiga, editor etc) https://mstanisz.website.pl/tmp/amig...pack_v0.31.zip The simplify "devpack" with Amiga sources only: https://mstanisz.website.pl/tmp/amig...31--SIMPLE.zip Last edited by mateusz_s; 15 January 2022 at 23:46. |
15 January 2022, 21:38 | #7 |
Registered User
Join Date: Jan 2019
Location: Finland
Posts: 653
|
Tested this on TF1260 100mhz+Radeon
[ Show youtube player ] No idea whats up with the colors.
|
15 January 2022, 21:48 | #8 |
Junior Member
Join Date: Sep 2001
Location: No(R)Way
Age: 42
Posts: 3,222
|
Really impressing speed!!
|
15 January 2022, 23:18 | #9 |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 181
|
Hi thanks for testing.. nice speed and interesting config. I am glad its fast on TF1260. I don't know right know why some colors are wrong, I run on BGR mode on winuae but it was ok..
|
02 February 2022, 18:54 | #10 |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 181
|
All shading variants, with lightmaps:
[ Show youtube player ] |
05 July 2022, 22:10 | #11 |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 181
|
Hello, check out the latest update..
--- UPDATE - 05.07.2022 --- msDevPack 3.2 features: - wall/floor.ceiling textures - mipmaps (256x256 --> 4x4) - baked lightmaps - distance shading - glowing pixels Test video (includes V1200 test): [ Show youtube player ] Source code. Check out if you are interested in RTG coding, Amiga framework, ReAction etc.: https://github.com/mateusz83/msRay/t..._devpack_v0.32 Executables for testing: http://mstanisz.website.pl/tmp/amiga/msRay-32.zip |
26 August 2022, 22:40 | #12 |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 181
|
--- UPDATE - 26.08.2022 ---
msDevPack v0.33 features: - wall/floor/ceiling textures - new, faster floor/ceiling render algorithm (based on screen projection and clipping) - mipmaps (256x256 --> 32x32) - baked lightmaps - distance shading - glowing pixels Source codes. Executables for Amiga and Windows. https://github.com/mateusz83/msRay video: [ Show youtube player ] This is probalby the fastest results I have ever made. - on V1200 35-45 fps - on Warp1260 19-21 fps switching off the lightmaps would gain the performance much more |
27 August 2022, 14:29 | #13 |
Registered User
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 2,078
|
oh cool! I did something like that in BASIC!
[ Show youtube player ] Excuse poor recording software, it was some years ago now. |
28 August 2022, 11:26 | #14 | |
old bearded fool
Join Date: Jan 2010
Location: Bangkok
Age: 56
Posts: 779
|
Quote:
What BASIC is that and what hardware is it running on? Looks pretty fast. Last edited by modrobert; 28 August 2022 at 11:34. Reason: Extended question. |
|
19 April 2023, 00:19 | #15 |
Registered User
Join Date: Jan 2020
Location: Poland
Posts: 181
|
--- Probably the last update ---
msRay 036 features: - regular / non regular walls, oblique / different height - doors - regular, non regular, oblique, open up or to sides. - wall/door collisions - status bar (autoscaled to width) - lightmaps - glowing pixels (not affected by shadows) - RTG or HAM8 modes min config: 040/060 AGA recommend config: fast 060 RTG source codes avaialb on git hub: https://github.com/mateusz83/msRay Link to EXE: http://mstanisz.website.pl/tmp/amiga/msRay_036.zip [ Show youtube player ] [ Show youtube player ] [ Show youtube player ] [ Show youtube player ] |
19 April 2023, 10:35 | #16 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,413
|
That's a good looking raycaster.
I was going to ask if the lightmaps get prebaked, then I saw the door open while the apparent lightmap remained in the same place (as you would expect for an object moving through a shadow volume). Excellent stuff. |
19 April 2023, 12:00 | #17 |
Registered User
Join Date: May 2020
Location: Figueira da Foz
Posts: 408
|
I could see Alien Breed on this engine! ^^
|
19 April 2023, 12:06 | #18 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,413
|
I'm not sure. Raycasting comes with some limitations that restrict level design.
|
19 April 2023, 12:11 | #19 |
Alien Breeder
Join Date: Dec 2007
Location: Szigetszentmiklos / Hungary
Age: 46
Posts: 1,112
|
This is cool. Keep up the great work!
|
19 April 2023, 12:19 | #20 |
Registered User
Join Date: May 2020
Location: Figueira da Foz
Posts: 408
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blitz Raycaster Demo | Master484 | Coders. Blitz Basic | 3 | 16 February 2018 14:47 |
Sharing files over ntwork | AliasXZ | support.Other | 7 | 03 May 2008 22:54 |
Sharing software? | Yesideez | Amiga scene | 11 | 25 March 2007 19:52 |
Sharing CD32 | Djay | Amiga scene | 12 | 01 April 2002 00:51 |
Sharing ADF's | P-J | Amiga scene | 3 | 03 December 2001 10:08 |
|
|