English Amiga Board


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

 
 
Thread Tools
Old 19 January 2018, 12:29   #61
LaBodilsen
Registered User
 
Join Date: Dec 2017
Location: Denmark
Posts: 179
Quote:
Originally Posted by Toni Wilen View Post
addq.l #x,an is 8 cycles. (memory access + 4 idle cycles)
Ahh, ofcourse i had looked on the wrong column.
LaBodilsen is offline  
Old 22 January 2018, 09:56   #62
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Just dropping by here to say, that this is quite frankly amazing what you guys are doing here...
Keep up the great work..

Add/edit: Why do you think that collissions and game logic will hit the FPS so hard?

Last edited by Tigerskunk; 22 January 2018 at 10:11.
Tigerskunk is offline  
Old 22 January 2018, 10:49   #63
britelite
Registered User
 
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
Quote:
Originally Posted by Steril707 View Post
JAdd/edit: Why do you think that collissions and game logic will hit the FPS so hard?
It's the raycasting and sprite rendering that will take the hardest toll on the framerate, not the game logic.
britelite is offline  
Old 22 January 2018, 14:48   #64
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Quote:
Originally Posted by britelite View Post
It's the raycasting and sprite rendering that will take the hardest toll on the framerate, not the game logic.
Since I don't have any knowledge about this kind of stuff, could you or someone else give me a short round up what you need raycasting for in this kind of game engine?

At the moment it looks kind of amazing already, it's hard for me to imagine what's still missing except collisions and some "game" around it...
Tigerskunk is offline  
Old 22 January 2018, 16:33   #65
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Ray casting is for determining line of sight for collisions and sprites overlapping and underlapping walls and other sprites.
Samurai_Crow is offline  
Old 22 January 2018, 16:56   #66
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,153
Quote:
Originally Posted by Steril707 View Post
At the moment it looks kind of amazing already, it's hard for me to imagine what's still missing except collisions and some "game" around it...
As I understand it, at the moment "all" the engine is doing is scaling wall textures ("all" in quotes, because it's doing that very impressively!) - for each frame it's starting with a precalculated list of wall heights for each column on the screen rather than calculating the heights in realtime, so the engine can't yet do free movement within the world.

Raycasting is about figuring out which column of which wall has to be drawn at which height, for every column of pixels on the screen, which is why it's likely to be a bit of a framerate drag. It will be very interesting to see just how much!
robinsonb5 is online now  
Old 22 January 2018, 18:13   #67
ajk
Registered User
 
ajk's Avatar
 
Join Date: May 2010
Location: Helsinki, Finland
Posts: 1,341
I'm sure it's calculating them in real time, just the movement pattern is fixed instead of user controllable.
ajk is offline  
Old 22 January 2018, 18:21   #68
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,153
Quote:
Originally Posted by ajk View Post
I'm sure it's calculating them in real time, just the movement pattern is fixed instead of user controllable.
I don't think so - I think (though I'd love to proved wrong!) it uses the same binary blob of pre-raycasted binary data that Britelite included in the previews. In the first post he describes it:
Quote:
Originally Posted by britelite
I also included a binary blob of raycasted data (wolf.3d), if anyone wants to try out the wall rendering, without having to write a raycaster. The format is pretty simple, 1024 frames of 320 bytes each. Every frame consists of 2 bytes per slice (160 slices in total), first byte being the height of the wall (0-127) and second byte being the texture u-coordinate (0-63 for texture one, 64-127 for texture two, textures being 64x64 in size).
robinsonb5 is online now  
Old 22 January 2018, 18:22   #69
khph_re
Registered User
 
Join Date: Feb 2008
Location: Northampton/UK
Posts: 524
Quote:
Originally Posted by britelite View Post
It's the raycasting and sprite rendering that will take the hardest toll on the framerate, not the game logic.
Could you jusrt use pre scaled sprites, or would that be to much of a memory hog? You could at least do that for lightbulbs/barrels.
khph_re is offline  
Old 22 January 2018, 18:28   #70
ajk
Registered User
 
ajk's Avatar
 
Join Date: May 2010
Location: Helsinki, Finland
Posts: 1,341
Ah, okay - I interpreted that as data output from his raycaster so others don't have to code one to try improving the wall rendering portion. But I won't speculate further
ajk is offline  
Old 22 January 2018, 19:14   #71
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Okay, thanks for the clarification, guys...
Tigerskunk is offline  
Old 23 January 2018, 07:33   #72
britelite
Registered User
 
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
Quote:
Originally Posted by ajk View Post
Ah, okay - I interpreted that as data output from his raycaster so others don't have to code one to try improving the wall rendering portion. But I won't speculate further
The raycasting is precalculated in the demo, as that way anyone else using the binary blob would be able to directly compare their implementation to mine (and it's easier to optimize the rendering part in general if everything else has constant cpu-usage).
britelite is offline  
Old 23 January 2018, 14:39   #73
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,856
Just having a little walk here with the help of the "Today's post" option.
Men ! The thread is really interesting and the engine done so far is red-hot for the A500 ...
malko is offline  
Old 24 January 2018, 09:41   #74
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
It's really amazing. Cannot believe what I am seeing running on my A500, even without the raycasting active at the moment...

Would really love to see this getting finished..
Tigerskunk is offline  
Old 24 January 2018, 11:23   #75
zero
Registered User
 
Join Date: Jun 2016
Location: UK
Posts: 428
I was wondering if you could use fake scaling, like the scroll register hack method for horizontal scaling but with the CPU.

Rather than doing precise scaling you can just scale every N pixels, with a number of pre-scaled textures. That way you can use longer read/writes and save a few cycles on instruction fetch/decode.

Back in the day I wanted to try doing a blitter vertical fill for the walls. That would use 1 bitplane that acted as a kind of mask. The other bitplanes would be a repeating 1 pixel high "brightness map" that made the walls fade into darkness as they got further from the player. Could even be dithered with the scroll register.
zero is offline  
Old 24 January 2018, 15:22   #76
LaBodilsen
Registered User
 
Join Date: Dec 2017
Location: Denmark
Posts: 179
Quote:
Originally Posted by zero View Post
I was wondering if you could use fake scaling, like the scroll register hack method for horizontal scaling but with the CPU.

Rather than doing precise scaling you can just scale every N pixels, with a number of pre-scaled textures. That way you can use longer read/writes and save a few cycles on instruction fetch/decode..
Yes and No.. You will always have to do precise scaling when using the CPU, as you can't "blit" 8-16 pixel at a time anyway. But the scalar code could maybe be arranged to better take advantage of longword writes, without it taking to much off of the visual quality.

But then again, to take full advantage of it, you would need several copies of the same texture in memory, which would take up to much memory at least for a game like Wolfenstein.
LaBodilsen is offline  
Old 25 January 2018, 17:01   #77
zero
Registered User
 
Join Date: Jun 2016
Location: UK
Posts: 428
Quote:
Originally Posted by LaBodilsen View Post
Yes and No.. You will always have to do precise scaling when using the CPU, as you can't "blit" 8-16 pixel at a time anyway.
Can't you? Doing it a blitplane at a time with the CPU... Especially on the A1200 where the 020 makes longer shifts take as many cycles as single bit ones.

If you want to port Wolfenstien then yeah, you can't use these tricks. But this is just Wolf-style rendering so it doesn't have to look exactly the same. You could, for example, use a 1 bitplane pre-scaled texture and then a static "noise" texture under it that wouldn't need re-rendering each frame.

I'm just thinking from a demo effect perspective, how could you get as close as possible to 60 fps at high resolution (320x256). How far can you get with an A500 and things like screen mirroring and blitter fill?
zero is offline  
Old 25 January 2018, 19:29   #78
britelite
Registered User
 
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
Quote:
Originally Posted by zero View Post
If you want to port Wolfenstien then yeah, you can't use these tricks. But this is just Wolf-style rendering so it doesn't have to look exactly the same.
Well, my intention with this topic was to discuss rendering that could actually be used in a Wolf3D-port (or Wolf3D-style game). Which is why usual demo techniques are out the window.

Quote:
I'm just thinking from a demo effect perspective, how could you get as close as possible to 60 fps at high resolution (320x256).
You're not going to get close to 60fps, as PAL is only 50hz

Quote:
How far can you get with an A500 and things like screen mirroring and blitter fill?
Why don't you try it out? But please open your own thread for that.
britelite is offline  
Old 28 January 2018, 18:25   #79
LaBodilsen
Registered User
 
Join Date: Dec 2017
Location: Denmark
Posts: 179
Quote:
Originally Posted by britelite View Post
There's still room for improvement in the wall rendering (for example, the code slices could be modified to draw longwords where possible).
I took a stab at doing that manually (disassembling the generated scalarcode, and changing 822 MOVE.W to 411 MOVE.L by hand)

and the result was an average of 9 rasterlines gained. best case from the stream gained 7 rasterline, and worst case gained 11 raster lines.

Also tried this out:
Quote:
Just an idea to take advantage of this:
for walls between 63 - 48 use downscaling of 64px texture with longwords where possible, and for 47-33 use mipmap upscaling of 32px texture with longwords where possible.
And it did result in better visual quality (see attached picture) without having and impact on performence.

So by using these two improvements the demo is now a tiny bit faster, with overall better visual quality.
Attached Thumbnails
Click image for larger version

Name:	wolf3d-new.png
Views:	442
Size:	27.7 KB
ID:	56485  

Last edited by LaBodilsen; 28 January 2018 at 18:32.
LaBodilsen is offline  
Old 28 January 2018, 22:12   #80
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Quote:
Originally Posted by LaBodilsen View Post
I took a stab at doing that manually (disassembling the generated scalarcode, and changing 822 MOVE.W to 411 MOVE.L by hand)

and the result was an average of 9 rasterlines gained. best case from the stream gained 7 rasterline, and worst case gained 11 raster lines.

Also tried this out:


And it did result in better visual quality (see attached picture) without having and impact on performence.

So by using these two improvements the demo is now a tiny bit faster, with overall better visual quality.
According to the pictures, you're testing on an emulated A1200 instead of an A500 so the longwords might represent an unfair advantage on AGA.
Samurai_Crow 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
Wolf3D on stock A500 gururise Retrogaming General Discussion 9 08 November 2017 14:03
Wolf3d: more ideas. AndNN Coders. Asm / Hardware 7 17 October 2017 13:03
Optimizing HAM8 renderer. Thorham Coders. Asm / Hardware 5 22 June 2017 18:29
NetSurf AGA optimizing arti Coders. Asm / Hardware 199 10 November 2013 14:36
rendering under wb 1.3 _ThEcRoW request.Apps 2 02 October 2005 17:23

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 13:41.

Top

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