English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 10 February 2023, 12:44   #61
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,354
I think he's talking about this one?

https://eab.abime.net/showthread.php?t=34481
alexh is offline  
Old 10 February 2023, 13:20   #62
Rst7
Registered User
 
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
Quote:
Originally Posted by alexh View Post
I think he's talking about this one?

https://eab.abime.net/showthread.php?t=34481
No, this is another issues, I take into account this kind of behavior.
Rst7 is offline  
Old 18 February 2023, 23:06   #63
Rst7
Registered User
 
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
Another gfx mode now possible - 32 colors with palette. Still reasonable performance, but for fastram configuration it can be optimized more.

Attached Thumbnails
Click image for larger version

Name:	32color_mode.png
Views:	641
Size:	60.2 KB
ID:	78164  
Rst7 is offline  
Old 19 February 2023, 00:08   #64
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
That's awesome. You know, 32 colours is fine. Consider an art direction, e.g. greyscale or sepia, something that naturally lends itself to a basic gradient that is representable that way.
Karlos is offline  
Old 26 February 2023, 21:15   #65
boemann
Camilla, AmigaOS Dev.
 
Join Date: Mar 2020
Location: Frederiksberg
Posts: 328
Huge respect, and very interested in the coding side of things as well.
boemann is offline  
Old 26 February 2023, 21:19   #66
Rst7
Registered User
 
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
Quote:
Originally Posted by boemann View Post
Huge respect, and very interested in the coding side of things as well.
You can ask any questions And look at source code on github
Rst7 is offline  
Old 26 February 2023, 21:30   #67
boemann
Camilla, AmigaOS Dev.
 
Join Date: Mar 2020
Location: Frederiksberg
Posts: 328
Quote:
Originally Posted by Rst7 View Post
You can ask any questions And look at source code on github
So can the camera rotate in all directions ?
boemann is offline  
Old 26 February 2023, 21:40   #68
Rst7
Registered User
 
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
Quote:
Originally Posted by boemann View Post
So can the camera rotate in all directions ?
Yes. Only yaw/pitch control (by mouse) now implemented in target code, but roll control processed too (by simple PID controller for zero roll angle).
Rst7 is offline  
Old 26 February 2023, 21:48   #69
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Quote:
Originally Posted by Rst7 View Post
You can ask any questions And look at source code on github
I know it's absolutely not the intent here but have you considered how this might work on an accelerated machine with RTG? All the 3D transformation, affine texturing and tesselation, on a faster CPU with no actual C2P to care about. You could have the beginnings of a killer FPS engine.
Karlos is offline  
Old 26 February 2023, 21:51   #70
boemann
Camilla, AmigaOS Dev.
 
Join Date: Mar 2020
Location: Frederiksberg
Posts: 328
So how do you handle the rendering - I imagine you don't do z buffer, but is it a (reverse) painters algorithm with sorted polygons. basically tell me a bit about these things. Thanks in advance.
boemann is offline  
Old 26 February 2023, 22:05   #71
Rst7
Registered User
 
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
Quote:
Originally Posted by Karlos View Post
I know it's absolutely not the intent here but have you considered how this might work on an accelerated machine with RTG? All the 3D transformation, affine texturing and tesselation, on a faster CPU with no actual C2P to care about. You could have the beginnings of a killer FPS engine.
C2P stage now is not performance limiter. All other computations eat most time (C2P take about 10-15% on complex scenes) . Some improvements for accelerated machines can be done, but if you want 50FPS with 1280*1024 screen resolution without about-GHz CPU - it's impossible.
Rst7 is offline  
Old 26 February 2023, 22:08   #72
boemann
Camilla, AmigaOS Dev.
 
Join Date: Mar 2020
Location: Frederiksberg
Posts: 328
I have looked at the code but find it hard to orient myself in the code.

The reason I ask is that I would like to make a flight simulator with a curvy landscape
boemann is offline  
Old 26 February 2023, 22:30   #73
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Quote:
Originally Posted by Rst7 View Post
C2P stage now is not performance limiter. All other computations eat most time (C2P take about 10-15% on complex scenes) . Some improvements for accelerated machines can be done, but if you want 50FPS with 1280*1024 screen resolution without about-GHz CPU - it's impossible.
C2P is a limit, in the sense that you are using 32 colours. I do have realistic expectations though, I was thinking 320*240, 256 colours on a faster CPU, but making use of the same 3D techniques.
Karlos is offline  
Old 26 February 2023, 22:33   #74
Rst7
Registered User
 
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
Quote:
Originally Posted by boemann View Post
So how do you handle the rendering - I imagine you don't do z buffer, but is it a (reverse) painters algorithm with sorted polygons. basically tell me a bit about these things. Thanks in advance.
Yes, there is no z-buffer.

All mesh splitted by kd-tree by boxes with faces. All boxes contains list of their faces. For all boxes there is potentially visible set of other boxes. PVS packed as compressed bitmap (something like a Quake's PVS).

At first engine find kd-tree node (box) with camera and take packed PVS for this box.

While PVS is depacking, engine test all potentially visible boxes by viewing frustum. This is done by tricky way with only 9 addition + 3 compare. This test is not ideal, but very fast. (You can check algorithms in functions DecrunchPVS and DecrunchPVSleaf in Map/render.cpp (PC-prototype, but written closelly with target code or vise versa)).

Face's lists of all visible boxes merging in one work list for 3D rotation.

After that all vertexes of all faces in work list rotated and projected (if applicable) in view space. All invisible faces (backface or out from view space) droping as early as possible (function RotateAllFaces in Map/render.cpp)

Next stage is radix sort by distance for face (function SortFacesAndDraw in Map/render.cpp)

After sort we can render all far faces as filled rectange (function RenderF in Map/render.cpp). This is simple (if you don't want have a fast render )

All mid-distance faces are rendered with simple affine texture mapping.

All near-distance faces split by horisontal lines with 20px step (in reality this is 4 divide planes) for tesselation. There is no face splits by vertical lines coz simple adding vertexes in split place to existing face is enough.

After this splits all faces are rendered with simple texture mapping again.

And the last stage is C2P.
Rst7 is offline  
Old 26 February 2023, 22:40   #75
boemann
Camilla, AmigaOS Dev.
 
Join Date: Mar 2020
Location: Frederiksberg
Posts: 328
Thanks a lot for that description that was really useful !

Now another question about the c2p: Why a HAM screen. Does it make the c2p more efficient somehow
boemann is offline  
Old 26 February 2023, 22:51   #76
Rst7
Registered User
 
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
Quote:
Originally Posted by Karlos View Post
C2P is a limit, in the sense that you are using 32 colours. I do have realistic expectations though, I was thinking 320*240, 256 colours on a faster CPU, but making use of the same 3D techniques.
320*240*8bpl C2P is copy-speed on 030 50MHz. About 40000 color clocks, less than one frame.

More problems may be with math precision. I made a lot of simplifications due to resolution only 160*100. I'm not sure that this will be good in 320*240.
Rst7 is offline  
Old 26 February 2023, 22:55   #77
Rst7
Registered User
 
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
Quote:
Originally Posted by boemann View Post
Now another question about the c2p: Why a HAM screen. Does it make the c2p more efficient somehow
Yes. But only for strange color mode 160px with 2 bits per R/G/B. But not very efficient as tested later, only a little.
Rst7 is offline  
Old 27 February 2023, 00:51   #78
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Quote:
Originally Posted by Rst7 View Post
320*240*8bpl C2P is copy-speed on 030 50MHz. About 40000 color clocks, less than one frame.

More problems may be with math precision. I made a lot of simplifications due to resolution only 160*100. I'm not sure that this will be good in 320*240.
You have 4x the area to draw too.
Karlos is offline  
Old 27 February 2023, 01:07   #79
Rst7
Registered User
 
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
Quote:
Originally Posted by Karlos View Post
You have 4x the area to draw too.
Yes, this is a problem too. For example, test start scene now take 574 scanlines for texture mapping (all innerloops time). But it is rendered from chip ram (texture) to chip ram (chunky screen), if engine can use fast ram, speedup will be about 1.3 times. So with fast ram 020 14MHz engine will render scene about 441 scanline (again only tmap innerloops time). With 030 50MHz this will be about 4x speedup, but if we want 4x draw area, all CPU frequency grow will be spent on 4x draw. So start scene will be rendered in 320*240 with fast CPU not too fast as we want

For my opinion, better have 25FPS (or more!) on fast CPU with current resolution.
Rst7 is offline  
Old 27 February 2023, 02:16   #80
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Don you make use of any mip mapping with the textures? I recall that, at least when textures are in cacheable memory (which only matters if you have a CPU with datacache) that smaller versions of textures result in better cache access. Certainly this is noticeable in games like quake, where disabling the mip mapping really cripples the performance of the software renderer (as well as looking worse due to aliasing).
Karlos is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tech demo of my game remz Coders. Asm / Hardware 199 18 February 2024 03:16
Menace - HD Tech Demo - Vampire Remake invent Amiga scene 45 01 August 2022 18:22
Writing a simple physics engine Ernst Blofeld Coders. General 1 02 February 2021 18:44
Simple AGA first person engine [Prototype only] earok project.Amiga Game Factory 8 01 May 2017 22:38
LN2 tech demo gimbal project.Amiga Game Factory 63 02 October 2008 20:22

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:26.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.44464 seconds with 14 queries