03 August 2009, 16:53 | #81 |
Linux snob
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
|
Somehow you will have to take perspective correction into account. I was not aware of that. Hm, tricky...
EDIT: There is still the option of breaking the facets into tringles, and checking these for hidden points. But there ought to be a more elegant way... Last edited by gilgamesh; 03 August 2009 at 22:28. |
04 August 2009, 08:44 | #82 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
I've been playing around with tying my go at hidden lines with yours but all I'm doing is hacking at bits of code trying to squeeze a working hidden line cube out of it. That's ridiculous - even if I get it working it won't work for any other objects so it has to stop! Instead I googled hidden line removal and found a short wikipedia article that mentioned an algorithm by a fella called Arthur Appel: "The Notion of Quantitative Invisibility and the Machine Rendering of Solids". Time to investigate how to do it properly. |
|
05 August 2009, 10:52 | #83 | ||
Linux snob
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
|
that sounds fun
Quote:
Quote:
|
||
05 August 2009, 11:09 | #84 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Anyway, inform yourself about normal vectors and you shouldn't have much problems to implement proper HSR then. Normal vectors are useful for light sourcing too btw. |
|
05 August 2009, 11:32 | #85 |
Linux snob
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
|
|
05 August 2009, 11:41 | #86 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
05 August 2009, 12:59 | #87 | ||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Quote:
Unfortunately I think hidden lines has to be solved by alternate means but I read that Appel guy's paper on hidden lines and increased my knowledge of the subject by about 0.0001%, perhaps less - too complex for me - I need words of one syllable. I've kind of got this feeling hidden lines might defeat me for now... By the way Sting, not sure how far you read back in this thread but I posted an optimised version of my original 3D cube routine. Any chance you could run this through your speed tester program you used on my original source so I can compare how much quicker I made the routine by optimising? No worries if you're busy / too bored of my amateur routine to bother () I was just curious. |
||
05 August 2009, 13:26 | #88 | ||||||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
||||||
05 August 2009, 14:19 | #89 | |||||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||
05 August 2009, 15:35 | #90 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
|
|
05 August 2009, 15:48 | #91 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Thanks for the encouragement Leffman - don't worry, my journey will continue!
What I wanna know is when are we gonna see your latest production? |
05 August 2009, 16:04 | #92 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Oh I'm struggling with procrastination and a lack of focus you've never heard the likes of Here's my "latest" stuff though from mid 90's or so:
[ Show youtube player ] and I'll be sure to post any updates
|
05 August 2009, 17:17 | #93 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Coooool routines Leffman!
Man, this gets depressing - every other coder on here kicks my ass! |
05 August 2009, 19:50 | #94 | ||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
The result of the speedtest is attached. Quote:
I'd like to see some new stuff from you too. And I still like that infinite chesstunnel, chessboards are as awesome as cubes. \o/ Oh, and some of the comments (like the one from "Tdarkshadow") crack me up |
||
05 August 2009, 20:59 | #95 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Thanks for doing that speedtest again StingRay, really interesting - top man.
It does leave me with some questions though: I misread the results of the first speedtest - I read them as: you've taken 88 lines out of a max available of 91. I see now from this second test that it means something more like: it takes between 88 and 91 rasterlines to execute. So, first dumb question is: how many rasterlines max are there actually available for a vbl interrupt routine to run in? Second dumb question is: how comes taking away 68 or so muls from the first routine only saves 12 or so lines worth of execution time? I was thinking I'd probably have saved more. EDIT: I forgot to say, yeah Leffman - StingRay's right - that chessboard zoomer thing rules! It was definitely my favourite. Last edited by pmc; 05 August 2009 at 21:01. Reason: Forgot something... |
06 August 2009, 04:14 | #96 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Your VBL interrupt simply starts at line 0 and keeps running until you return from it regardless of how many lines and frames it needs to finish. In some cases you might want to take into account that your bitmap display starts at line $2c or whatever, but meassuring code in rasterlines is not really correct because ultimately it's about clock cycles and their contingency.
All devices (CPU, blitter, bitmaps, sprites, copper, audio, disk) share the chip memory but only one can access it at any given time. The CPU has after the blitter the lowest priority, and a piece of code that needs 10 lines to complete during your VBL period (or any other part of the frame where there's equal amount of DMA going on, the VBL period and running code in interrupt mode is no different in these regards) might need 100 lines when run during a time when other devices with higher priority might need to access the memory a lot, f.ex in the middle of a 6 bitplane display. One good thing is that the CPU often spends more cycles working internally than accessing the memory (at least in an A500 chip mem only context) and so other devices can get access to the memory and work in parallel. With lengthy instructions, such as MULS and DIVS that might need 1 cycle to read the memory and another 50 or more cycles to do internal processing, you could "earn" many clock cycles by f.ex letting the blitter work in parallel during this time. This is probably why your 68 less MULS don't make a bigger difference. |
06 August 2009, 09:29 | #97 | |||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Quote:
Quote:
And how do you want to show the used cycles on screen? The more clock cycles the code needs the more raster lines are used so it's a good approximation to get an idea of how fast the code is! 100% accurate speed measuring is impossible anyway. |
|||
06 August 2009, 11:23 | #98 | ||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Quote:
@ Leffman - nice explanation. Basically it seems to come down that code execution speed is a pretty inexact science due to there being so many factors that can effect the execution time of the same bit of code. Bearing this in mind, the rasterline timing approach seems to me to be the best way of getting some kind of tangible idea of a routine's execution time. As the rasterline timing is measuring across a routine's complete execution time you're at least getting a better idea of delays introduced by competing DMA access during execution etc. than you'd have if you just added up the cycle times of all the 68k opcodes in the routine. |
||
06 August 2009, 12:32 | #99 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Yeah I actually agree with both of you, it's a good visual indicator which in the end it tells you what you want to know: will this run in 1 frame or not? I just think it's important to know the inner workings of things because it allows you do adapt your code to become more efficient.
|
06 August 2009, 12:46 | #100 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Semi-offtopic:
You can use latest winuae betas 'v' debugger command to see exactly how DMA and CPU use bus cycles. (undocumented feature: use 'V' to see current frame, 'v' always shows complete previous frame) It should be very very accurate now (major rewrite few weeks ago). Pre-1.6.2 cycle exact was only approximately cycle-exact, now it is real, proper cycle-exact emulation. Believe it or not |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Learning AMOS - Beginners Guide Disks | Peter | Retrogaming General Discussion | 15 | 28 October 2015 17:17 |
DiskImage: When learning to read proves futile. | XDelusion | support.Apps | 19 | 20 October 2012 23:57 |
Wanting to start learning to code amiga in asm | fishyfish | Coders. Asm / Hardware | 5 | 03 March 2012 06:11 |
Playpower - 8 bit learning games for the developing world | girv | Retrogaming General Discussion | 5 | 24 March 2009 22:00 |
Learning assembler | bLAZER | Coders. General | 1 | 12 May 2007 05:00 |
|
|