[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
RabidHaMsTeR.Org • View topic - Render Rec Tweak

Render Rec Tweak

How to create a custom scene, and custom scenes people have created.

Moderators: rabidhamster, Rovastar

Render Rec Tweak

Postby Rovastar » Wed Nov 05, 2003 12:20 pm

Just change a very simple selement to this scene by adding sound reactive movement to the scrolling renders in this scene.

It appears that sounda and soundb are values below and above zero so I have regualted this so you only get possitive values I did this in a very crude way of mysound variable.

if((sounda+soundb)<0) mysound=0; else mysound = sounda+soundb;

simpily if teh left and right channels (I presume a and b are these) are below 0 then make it 0 else add them together.

soundtotal is the movement speed of the top bank of reapeated medusas.

I made it always movement to theright and on biig sound boosts move quicker in the same direction.

soundtotal = soundtotal + 0.025*(1+mysound*mysound);

The bottom set of medusas only moves when there is some sound. This is variable soundtotal

soundtotal2 = soundtotal2 + 0.01*((1+mysound)*(1+mysound)*mysound);

Using multiples of mytest (in a expernational or powers way) to simultae more intense values.

Not much has chnaged but subtle improvements(?). But hopefully displaying the thought process behind tweaking the scenes for other authors.

Feel free to bundle with R4 not really good/changed enough for a sepearate scene.


scene (
"name" = "Render RECT Example (Remix)";
"author" = "John Baker & Gordon Williams";
SOLID black();
TEXTURE pic();

MEDUSA med(black,pic);
INVERT inv(med);
RENDER r(inv,med);
)

int x;
float o;
float soundtotal;
float soundtotal2;
float mysound;
void init () {
black.col = 0;
strncpy(pic.filename,"envmap_sky.jpg",256);
strncpy(r.type,"RECTS_XY",256);
strncpy(r.shader,"T0;B10;",256);
soundtotal =0;
soundtotal2 =0;
}

void render() {

if((sounda+soundb)<0) mysound=0; else mysound = sounda+soundb;
soundtotal = soundtotal + 0.025*(1+mysound*mysound);
r.count = 40;
o = (frac(soundtotal)*0.5) -1.5;
for (x=0;x<20;x=x+4) {
r.data[x] = o;
r.data[x+1] = 0.5;
r.data[x+2] = o+0.5;
r.data[x+3] = 1.0;
o = o + 0.5;
}
soundtotal2 = soundtotal2 + 0.01*((1+mysound)*(1+mysound)*mysound);
o = (-frac(soundtotal2)*0.5) - 1.0;
for (x=20;x<40;x=x+4) {
r.data[x] = o;
r.data[x+1] = -1.0;
r.data[x+2] = o+0.5;
r.data[x+3] = -0.5;
o = o + 0.5;
}
}

void reset() {}
Rovastar
 
Posts: 423
Joined: Mon May 19, 2003 3:15 am
Location: Derby & London, England

Postby rabidhamster » Tue Nov 11, 2003 1:38 pm

seems good. If you want to make it different, you could make the rectangles smaller so there's a gap (or maybe pulse with bass)

you could do this with something like:
r.data[x] = o+0.05;
r.data[x+1] = 0.55;
r.data[x+2] = o+0.45;
r.data[x+3] = 0.95;

for the first set, and a similar thing (either adding or subtracting 0.05) for the next.

Infact you could use a feedback as the background so you get recursive rectangles. To do that you'd modify the bit up the top (i removed invert too):

TEXTURE pic();
BUFLOAD bl();
MEDUSA med(bl,pic);
RENDER r(med,med);
BUFSAVE bs(r);

and in the render() section add: bl.handle = bs.handle;
rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England

Postby rabidhamster » Tue Nov 11, 2003 1:40 pm

rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England

Postby rabidhamster » Tue Nov 11, 2003 6:10 pm

rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England

Postby Rovastar » Wed Nov 12, 2003 2:39 pm

Nice but is it possible to make.

for (y=0;y<24;y=y+1)
for (x=0;x<32;x=x+1) {
m.x[y][x] = ((y%3)-1)*0.01;
m.y[y][x] = ((x%3)-1)*0.01;
m.r[y][x] = 0.8;
m.g[y][x] = 0.8;
m.b[y][x] = 0.8;
}

with any higher 'mesh' then 24 by 32

I tried and it gotr all messed up.

for (y=0;y<24;y=y+1)
for (x=0;x<32;x=x+1) {
m.x[y][x] = sin((y-0.5)*x*2)*0.004 + sin((y-0.5)*x*2.66667)*0.004;
m.y[y][x] = cos((x-0.5)*x*2.666667)*0.003 + cos((x-0.5)*x*2)*0.003;
m.r[y][x] = 0.9;
m.g[y][x] = 0.9;
m.b[y][x] = 0.9;
}

Might look better at 48*64 or above or would teh slowdown be too big.
Rovastar
 
Posts: 423
Joined: Mon May 19, 2003 3:15 am
Location: Derby & London, England

Postby rabidhamster » Wed Nov 12, 2003 4:07 pm

The module itself will only handle 32x24 - i can make it bigger but i think some people will experience slowdowns - especially on slower PCs. The scripting language isn't massively quick.

When i finally get around to a module SDK i'll include the source to the MAP module, and you can just make a high res version by increasing values.

- Gordon
rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England


Return to R4 Custom Scenes

Who is online

Users browsing this forum: No registered users and 45 guests

cron