A.D.A. Amiga Demoscene Archive

  Welcome guest! Please register a new account or log in

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Realtime 15bit lightwave engine source.

 

Author Message
sp_
Member
#1 - Posted: 14 Aug 2006 21:38
Reply Quote
Realtime lightwave engine source in 100% pure Mc680x0.

15 bit truecolour 1x1 / txture-gouraud ++
World routine, child objects, spline camera movements, z clipping
, bounding box etc.
made to run smooth on 50mhz Mc68030
I convert lwo objects and scenes, txtures etc to my own formats.

A lot of nice tricks in this code.

Never used in a demo...

Link to sourcecode
BalrogSoft
Member
#2 - Posted: 23 Oct 2006 14:34
Reply Quote
Can you put somewhere the source of include files? i don't have some files like accede.i, antisys+.i, ctzc2p++.i, plays3m.i.
sp_
Member
#3 - Posted: 25 Oct 2006 19:25 - Edited
Reply Quote
http://www.kvarteret.no/~sp/PLAYs3m.i
http://www.kvarteret.no/~sp/sp.i
http://www.kvarteret.no/~sp/antisys+.i
http://www.kvarteret.no/~sp/ctzc2p++.i

http://www.kvarteret.no/~sp/CTZ-C2POS.Lha

(include some documentation in norwegian about the chunky2planar includefile)


I don't have the accede.i on my computer now since my amiga harddrive has crashed. :( I'll ask around for it, because
it includes the keyboard control routines. I don't have the object converter source or the scene converter source (written in C)
I will ask my friends.

The c2pos includes 9 state of the art chunky to planar routines and a nice screenopen macro +++

* 1. Cpu3blit. 8bpl by Skjeggspir&Brekke Copyspeed 030 50mhz *
* 2. Cpu4 4bpl by Skjeggspir *
* 3. cpuSCR 8bpl Scrambled by Skjeggspir *
* 4. Ham8SCR 6bpl Scrambled by Skjeggspir *
* 5. C2p060 8bpl by Skjeggspir&Brekke Copyspeed 040 + *
* 6. Ham6SCR 4bpl Scrambled by Skjeggspir 1998 Copyspeed 030 50+ *
* 7. Ham7SCR 5bpl Scrambled by Skjeggspir 1998 Copyspeed 030 50+ *
* (If Hires/lores Fixed ham7SCR) *
* 8. Cpu4SCR 4bpl Scrambled by Skjeggspir 1998 Copyspeed 030 50+ *
* 9. Ham6 4bpl by Skjeggspir 1998 Copyspeed 060
winden
Member
#4 - Posted: 29 Oct 2006 11:46
Reply Quote
nonscrambled 8bpl copyspeed 030 have to check that one closely ;)
victim
Member
#5 - Posted: 3 Mar 2008 03:26
Reply Quote
sp_

Hi !

Can you send me a active LINK (http://www.kvarteret.no/~sp/CTZ-C2POS.Lha ) for download the lightwave assembler sources.

so long victim
sp_
Member
#6 - Posted: 3 Mar 2008 06:49
Reply Quote
Here is a link:

http://www.modermodemet.se/dalton/src/vector/lwsce ne.s

Some more sources here including the c2p system:

http://www.modermodemet.se/dalton/

I have the object converter sourcecode here, but the scene converter is gone.
sp_
Member
#7 - Posted: 3 Mar 2008 07:00
Reply Quote
The engine supports recursive matrix multiplication. The zclipper have bugs, and the inside out method should be rewritten.(from 2d to 3d)
I don't use zbuffer for speed reeasons. The txturemapper/gouraud is divieded into two passes. first I calculate all the lines. A triangle poligon is defined as 3 lines and not 3 points. This is to speedup divs calculations, but also make the routine more cache friendly on 020/030. First pass calculate line information. Deltas for polygon and U/V / gouraud coordinates. Second pass render the polygon by reading the line information.

I found new methods now that will improve speed more(divsfree). To be released in my Amiga 500 demo.
sp_
Member
#8 - Posted: 3 Mar 2008 07:02 - Edited
Reply Quote
Here is the innerloop for texture gouraud. The loop can be optimized more on 060...

.indre
move.w d0,d5
move.w a4,d2
move.b d1,d5
add.l a3,a4
move.b (a6,d5.l),d2
add.l d6,d0
move.w (a6,d2.w*2),(a1)+
addx.l d4,d1
bcs.b .indre

Note that the texture in a6 is a scrambled word pr pixel 15bit pixel. The scrambling swaps the bits to improve the speed of the chunky to planar.
_Jamie_
Member
#9 - Posted: 3 Mar 2008 15:55
Reply Quote
Hi Sp,

The new method with freedivs use a table?

Jamie
sp_
Member
#10 - Posted: 4 Mar 2008 06:17 - Edited
Reply Quote
Yes, In the 500 mapper i use table divses. I have invented a new formula to calculate interpolation-registers wich doesn't require the two highprecition divs. pr poligon I use in the old sourcecode provided.

On 060 its probobly faster to use muls instead.. Same algorithm can be applied with a muls only approach.
_Jamie_
Member
#11 - Posted: 4 Mar 2008 15:50
Reply Quote
Seems really cool, i have always this slow division ( by edge ) but i prefetch a lot during this time
winden
Member
#12 - Posted: 7 Mar 2008 23:05
Reply Quote
sp, is your method related to the one skal/bomb explained once on a hugi 14 article about pre proyecting the texture deltas into parallel and orthogonal spaces? That article was really hard on math! ;)
sp_
Member
#13 - Posted: 8 Mar 2008 12:09 - Edited
Reply Quote
I have read the article and analyzed the C code. I counted 5 mulses (without the lame fixedpoint mulses to achieve fixedpoint(!!!!)) and 2 divses pr scanline. This algorithm will be useless on amiga.(slow)
The outerloop of the polyfiller is important too. The divses and mulses in his outerloop can be interpolated away..

In my amiga 500 mapper I still have some divses per poligon, but all of them are low precition table divses. I read from a 64KB table. The size of the table depend on the poligon size. Bigger poligons need bigger tables. For 2x2 resolution 64KB will do...

The outer and innerloop of my new mapper is muls and divsfree. No table acces eighter. The polyloop fit the 020/030 256 byte cache and the innerloop use SMC (1 instruction pr pixel + a littlebit more)
_Jamie_
Member
#14 - Posted: 27 Mar 2008 14:47
Reply Quote
Finally i have no division for the gradient computation, but it's only for perpective corrected mapping, seems hard to find accurate solution without divs and muls and no table acces.
sp_
Member
#15 - Posted: 11 Apr 2008 00:48
Reply Quote
Good job!

In the divsfree mapper I use the longest distance in the polygon horisontally. This point can be calculated by 2 muls and 2 lookups.

Now Jamie, show me how can you do it muls and divs free :)


Somebody pissed me off, and I got a new project to code.
Remember your rights. Respect to all fellow sceners.
_Jamie_
Member
#16 - Posted: 11 Apr 2008 15:38
Reply Quote
With table it's not so hard, but i need really high precision so i need my slow muls:)

Btw fpu muls is only 3 cycles on 68060 and you have 2 parralelized cycle for integer operation, not so bad
sp_
Member
#17 - Posted: 24 Apr 2008 15:44
Reply Quote
Yes, you are right. On 060 muls will be faster than an uncached tablelookup.

 

  Please register a new account or log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0