English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Tutorials (https://eab.abime.net/forumdisplay.php?f=73)
-   -   Plasma (https://eab.abime.net/showthread.php?t=29570)

pmc 04 May 2007 13:22

Plasma
 
Since finishing the sine scroll routine I've hacked the code for that one around into the embryo of a plasma routine. I've posted it to the zone, if anyone wants to check it out...

At the moment it's static - all it does is setup a two bitplane display and draw in the copper effect. What I haven't really thought much about yet is what else I need to add to the routine so that it's a proper plasma effect - moving and changing colours etc. so I'll be trying to puzzle that out over the next few days.

In the meantime, as usual, any suggestions from the more experienced coders about what I should be looking to try and achieve would be welcome...

korruptor 04 May 2007 14:40

Sum of sine plasmas would be pretty easy to do but they don't look anywhere near as good as the sorts of RGB plasmas I remember on the Amiga. Can't help with the latter (not 100% sure how they're done) but I've got some examples for sine plasmas somewhere.

pmc 04 May 2007 15:17

@korruptor - nice one mate, any ideas are appreciated, I'd be keen to check out any sources you've got - even if I do something different for this effect than what they show they'd always come in handy at some point.

Asman 06 May 2007 18:44

Hi

In the Zone you can find examples of plasma from different places. But I don't test this sources. There also exist exe files and some doc file about plasma. I think that this package will help you.

Gretz

AGN 06 May 2007 20:07

Quote:

Originally Posted by pmc
I've posted it to the zone, if anyone wants to check it out...

No files from pmc in da zone.

korruptor 06 May 2007 22:33

Asman: thanks for the sources, some awesome stuff in there. :D

pmc: I've found my old C/Python sources, can upload them if you want them but the 68k stuff in the zone is a lot better.

pmc 07 May 2007 13:43

@Asman - I've just donwloaded the stuff you put in the zone - I'll check it out. Thanks Asman, you're a diamond! :great

@korruptor - thanks for the offer but they won't be of any use to me for the simple reason that I don't understand either C or Python. I don't even understand BASIC! - I've only ever programmed anything in 68k assembler and sometimes I barely understand that!

@AGN - hello mate, yeah sorry - I took the source out of the zone again. All it did was put a colourful copper effect on the screen - there's just a big copper list with loads of waits and moves to the colour regs. After second thoughts I wanted to have a bigger stab at getting it to be a proper plasma effect before I start asking for help - I think I'll learn more that way. It'd be great if you could have a look when I post the next version though?

pmc 10 January 2008 13:15

It's been a loooong time since my thoughts turned to this subject since I was first posting about it in May last year (man, where do the months go...?!) but now I think I'd like to try and get back into this and see what I can do.

My ideal would be to get something close to what can be seen in the Celtic's Plasmatronic demo which, I think, is the best plasma effect I ever saw from the Amiga's heydey. I've posted an .adf that boots to that demo into the zone if you've never seen it...

What are they actually doing there? At a basic level I think it's done with simple bitplane patterns and then using the copper to change the colour registers for the colours that make up the patterns...? What I don't understand is how the copper is used to interact with the patterns and how the patterns are altered (if they're altered?) to get the plasma effect.

So, as always, I need some help to get started cos I'm not really sure I understand the underlying things I need to try to do to achieve the effect. Its more than likely it's beyond my coding abilities but I won't know until I try...

AGN 13 January 2008 04:40

Quote:

Originally Posted by pmc (Post 386230)
What are they actually doing there? At a basic level I think it's done with simple bitplane patterns and then using the copper to change the colour registers for the colours that make up the patterns...? What I don't understand is how the copper is used to interact with the patterns and how the patterns are altered (if they're altered?) to get the plasma effect.

Background:
Due to limit in dma/whatever in amigas You can change color (by copperlist) at every 8 pixels in lores.

Many plasmas uses following copperlist:
wait, move, wait, move, wait, move....

This works fine when Your plasma area is a static block of copper "pixels" (8x1).

If You try to move horizontally whole plasma-area (or just one line of it) by 1 pixel left/right We hit another problem.

Wait instruction from coper have low horizontal resolution - 4 pixels in lores. So scroll won't be smooth enough.

Solution in this intro is to align plasma by using bitplanes.

One bitplane is "FF FF FF FF ...." and second "00 FF 00 FF 00 FF ...." so we got only 2 colors (02 and 03).
Look at copperlist from this intro. There is one wait at beginning of plasma line and then:
move clolor02, move color03, move color02.....

You can move bitplanes by 1px by hardware so whole plasma will move smooth.

Why 2 bitplanes instead of one?
One bitplane (filled with 00 FF 00 FF) means color00 and color01.
Color00 is background, so You will get garbage at right and left borders of plasma area.

pmc 14 January 2008 09:49

Hello AGN, good to hear from you - I hope you're well.

Thanks very much for taking the time to give me that explanation, much appreciated. You are the guru. :great

I'll try to get my head around the information and have a first go at a routine.

pmc 15 January 2008 15:26

Right then, first things first, I've been thinking about various aspects of getting a plasma routine working and I've decided to start at the beginning and make a single bitplane plasma and then (hopefully) build from there fingers crossed learning something as I go.

So far I reckon that I'll get something half decent if I setup a copper list with a bunch of waits and moves to a colour register and then use the processor to push colour values listed in a table into those moves in the copper list. Hopefully if I do this using some kind of offset into the table so that a different starting colour is used each iteration I should get some kind of moving plasma result.

Well, that's the idea anyway... Perhaps it'll work, perhaps it won't; perhaps it'll look OK, perhaps it won't!

Whatever I get working, as usual, I'll post the sources and welcome any comments or constructive criticism...

AGN 19 January 2008 12:31

Here is task for You

Code:

number_of_plasma_columns        equ    8
number_of_plasma_lines          equ    64
plasma_start_x                  equ    100
plasma_start_y                  equ    71      ; must be odd and +4


        section code_pmc,code

pmc_start:
        move.l  #plasma_area_01,a0
        move.w  #$0f0,d0
        bsr    fill_plasma_area
        move.l  #plasma_area_02,a0
        move.w  #$00f,d0
        bsr    fill_plasma_area
        rts

fill_plasma_area:
        ; !!!
        rts

        section customchips,data,chip


copperlist_01:
plasma_area_01:
        blk.w  (number_of_plasma_columns+1)*number_of_plasma_lines*2,$1234
        dc.w    $ffff,$fffe

copperlist_02:
plasma_area_02:
        blk.w  (number_of_plasma_columns+1)*number_of_plasma_lines*2,$1234
        dc.w    $ffff,$fffe

Write "fill_plasma_area" function.

AGN 19 January 2008 21:35

Quote:

Originally Posted by AGN (Post 388770)
Write "fill_plasma_area" function.

... and find bug I made

musashi5150 19 January 2008 22:10

Glad to see you are keeping youself busy pmc :) My favourite plasma is the 'orplasm' in Coma's Hot Dots.

http://aminet.net/demo/ecs/HotDots.lha

I think it rocks :great

pmc 22 January 2008 11:50

@ AGN: Thanks (I think...!) for giving me that as a task. I'll take it away and have a think (and probably a bit of a cry...) and try to come back with a hopefully not too embarassingly bad try! I'm a bit busy at the moment at home and at work so bear with me. :great

@ musashi5150: Cheers man, truth be told it's mainly those couple of nudges you gave me to get off my lazy behind and get back to challenging myself that got me back to thinking about this. I checked out that demo you linked - personally I prefer the dot routines to the plasma in that one but it was cool all the same. :great

Hmmm, another one to think about, dot routines... by the looks of them though, they'd involve some heavy mathematics so that about rules me out cos I am absolutely terrible at maths! I read a book (still own a copy in fact) called Amiga Realtime 3D Graphics - the mathematical principles of 3D graphics made not one shred of sense to me at all so no spinning red cubes in my demo routines future! :(

AGN 22 January 2008 15:53

Quote:

Originally Posted by pmc (Post 389705)
Hmmm, another one to think about, dot routines... by the looks of them though, they'd involve some heavy mathematics so that about rules me out cos I am absolutely terrible at maths!

We'll do dot-flag with scroll on it.
No math involved.

pmc 26 June 2008 12:11

@AGN - I must apologise for it being such a long (very long) time in replying but at last I've had enough time to be visiting here again and I've had a go with that code task you set me.

I'm not sure if I've completely missed the point with what you were asking but I've chopped the code around as follows:

Quote:

number_of_plasma_columns equ 8
number_of_plasma_lines equ 64
plasma_start_x equ 100
plasma_start_y equ 71 ; must be odd and +4

section code_pmc,code

pmc_start:
move.l #plasma_area_01,a0
move.w #$0f0,d0
move.w #area1_size-1,d1
bsr .fill_plasma_area
move.l #plasma_area_02,a0
move.w #$00f,d0
move.w #area2_size-1,d1
bsr .fill_plasma_area
rts

.fill_plasma_area:
move.w d0,(a0)+
dbra d1,.fill_plasma_area
rts

section customchips,data_c

plasma_area_01:
ds.w (number_of_plasma_columns+1)*number_of_plasma_lines*2
plasma_area_01_end:

area1_size equ plasma_area_01_end-plasma_area_01

copperlist_01:
* reg setups, followed by waits & multiple colour moves
dc.w $ffff,$fffe

plasma_area_02:
ds.w (number_of_plasma_columns+1)*number_of_plasma_lines*2
plasma_area_02_end:

area2_size equ plasma_area_02_end-plasma_area_02

copperlist_02:
* reg setups, followed by waits & multiple colour moves
dc.w $ffff,$fffe
I chopped it round to how I thought it should look, not sure if that fixes the bug you made...? I also made it Devpac friendly (cos that's what I use), hope that's OK.

If I'm totally wrong or being completely stupid with the above then at least I'll learn something from the exaplantions why!

Herpes 11 February 2009 23:11

Very nice thread, I really enjoyed it. :great I am sorry that I joined the board too late to get actively involved in this :crying I also coded some 68K assembly for some intros but that was about 18 years ago - so maybe I start again ... it's great fun compared to my Java coding work in telecommunications.

@pmc: I wonder how far you got by now with your coding but maybe I'll read it in some other thread in this section.

Adio!

gimbal 11 February 2009 23:55

Quote:

it's great fun compared to my Java coding work in telecommunications.
Java is great fun friend, you just have been using it for the wrong purposes ;)

btw, nice nickname!

Herpes 15 February 2009 03:43

Quote:

Originally Posted by gimbal (Post 510338)
Java is great fun friend, you just have been using it for the wrong purposes ;)

Yep, you're right.
But actually I love Java only my work I have to do is not such a pleasure and for the purpose of retro computing with my Amigas, 68K assembly fits better.

Quote:

btw, nice nickname!
thx.


All times are GMT +2. The time now is 01:27.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05610 seconds with 11 queries