PDA

View Full Version : Prometheus Video - Updates



code_glitch
14-12-2010, 05:10 PM
Here are posted all current dev info on the prometheus Video unit... Instead of creating new articles for each update I will add posts to this and add an article for each major release 8)

code_glitch
14-12-2010, 05:10 PM
So I thought I might keep people posted on where things are heading and continue the series by showing whats changed here:

First off this is brand new:



CoOrd = Packed Object
X,Y: Int64;

procedure SetValue(lX,lY: Int64);
procedure Empty();
end;
Primitive = Object
Filled: Boolean;
FillColour: Colour;

Points: Int64;
PointPosition: array [1..500] of CoOrd;

LineColour: Colour;

procedure SetPoints(Data: array of CoOrd);
procedure DrawFill(Val: Boolean);
procedure SetFillColour(R, G, B, Alpha: Int64);
procedure SetLineColour(R, G, B, Alpha: Int64);
procedure Draw(X,Y: Int64);
end;


and thats really it so far for the datatypes. I use packed records because I sympathize with the fact that you will most likely use CoOrds in your program - and lots of them... No actually, I wanted to try it out as a performance test. Might be better optimization soon. I just found managing 36,000 of them on 512mb of ram a bit tricky - that was my solution. A quad core CPU can handle the packed part... Dont ask about specs; I'm confused also.

In terms of new procs/funcs (procedures/functions for absolute newbies) theres:


function CoOrdinate(lX, lY: Int64): CoOrd;


and that sums it up so far... feel free to comment on this if you have any suggestions or problems. ;)

code_glitch
19-12-2010, 09:46 PM
Here we go for another update. Since keeping the development of Prometheus_Core, Prometheus_Audio, Prometheus_Vid (Sdl and Gl branches) is far too cumbersome and no-one has expressed an interest in helping out I have thus taken the decision that in the interest of performance there will be one branch of Prometheus_Vid. It will not be solely powered by either Sdl or Opengl but rather whichever is the fastest to implement. At this stage the most important thing is to get Prometheus out there - and thus it is a high-speed development of features I have decided to go with. It will not necessarily be for speed from now on or simplicity of code but rather however I know how to accomplish such a task. If I can do polygons and shading best in oGl it will be done in oGl. If I can do it best in Sdl then it will be done in Sdl...

Ps: Is it just me or is everyone lurking - again? I know you're out there: Look at the views counter. :}

Edit: Oh and I'm working on an easy implementation of gradients to fill primitive shapes... At this rate it's going to be your swiss army knife for video in no time flat. And since its mainly gl now - no performance drags and I'm trying to dump it all on those GPUs with the flick of PrometheusGPU(True/False)

code_glitch
29-01-2011, 04:15 AM
Another quick note from me: debugging was a pain, so the next update will be of the all new error management system. objective: to prevent any type of crash from prometheus no matter the circumstances ;) its a touch job but getting there now. All those try..except blocks SD

code_glitch
09-05-2011, 08:17 PM
Anyone wanting a no frills experience with Particle Effects and in a bit of a hurry, because most people that read this from time to time would have guessed it but I thought this one could use a little explaining and how this came about. This was POC code a few weeks back, and it was originally part of Luna (not yet public). This means its not finished and that is why it currently has one mode. Here is what one of the longest tut programs would look like if you commented almost every single line for a tutorial... But then again, its aimed for more advanced users.

If there are any questions/comments, please leave a comment or whatever. Just some insight on what I've been doing lately. :) So far I've tested it with 8000 particles and a 128x128 particle, cpu usage < 105MHZ and ~6mb ram Tested on (Windows XP 32 bit, Windows 7 x64, ubuntu 10.10 x64 and ubuntu 11.04 x64). Enjoy.

Code:



program ParticleFX;

uses
Prometheus_Vid,
crt; //we need the delay() from here only... i should make one in prometheus ;)

var
PE: ParticleEffect;

begin
//All our usual Prometheus Init code
PrometheusVid_Start();
CreateWindow(640, 480, 32);
UpdateWindow();
UpdateCanvas();

//Now lets set up this particle effect: (there are a lot of values to define)
PE.LoadParticleImageFromFile('Particle_Fire.png'); //We load our particle from the file Particle_Fire.png
PE.DurationRange[1] := 200; //Each particle will at least last for 200 Update Cycles
PE.DurationRange[2] := 570; // To a maximum of 570 update cycles
PE.ParticleEffectMode := ParticleFX_RadialFromCentre; //The particle effect mode/name of how to manage particles
PE.Particles := 3000; //How many particles we want on screen at a time
PE.SetParticleEffectArea(-1000, -1000, 1000, 1000); //Consider a particle 'dead' / invisible if it exceeds these screen co-odinates
PE.VelocityRange[1] := 1; //Each particle has a minimum velocity of 1 diagonal pixel per update cycle
PE.VelocityRange[2] := 4; // To a maximum speed of 4 diagonal pixels
PE.OrientationRange[1] := 0; //Each particle has a direction (bearing) of at least 000 (This is a bit buggy, fixing...)
PE.OrientationRange[2] := 360; //to a maximum bearing of 360 (basically any direction)
PE.EffectLength := 50000; //The particle effects itself stops entirely after 50,000 update cycles (a lot!)
PE.StartX := 320; //The starting point of the particle effect (x)
PE.StartY := 240; //The starting point of the particle effect (y)
PE.Respawn := True; //When a particle dies, make a new one from the centre with ne velocity, orientation, life & etc

PE.Activate; //Inits everything and starts the effect

repeat
ClearCanvas(); //Clear the screen

PE.Update(); //Let the particle effect stop if ended and etc...
PE.Draw(); //Draws the particles on the screen and controls them

UpdateCanvas(); //'Flip' data onto the screen

delay(50); //give the OS some time
until PE.Running = False; //When the particle effect is done PE.Update sets this to false for you
end.


I tried publishing it in articles, but I figured thanks to WILL that it's best be suited here. The way things are going I'm going to need to brush up my SF page to host all this. PGD would be in real danger of becoming PDS (prometheus demo show ;))

Some presets for effects:Explosion ring thing: fast velocity, no respawn, all equal velocity. gives ring of particles
Flying towards a star/through stuff: the example preset
Flame style thing: Narrow angle and enjoy.