Dust in air particle shader ???

Posted By: pegamode

Dust in air particle shader ??? - 06/26/17 19:58

Hey there,

I'm searching for some kind of dust in air particle shader, maybe something like this

Dust in Air FX

I need it for a dusty attic room.

Maybe someone has done something like that already and likes to share?

Best regards,
Sascha
Posted By: 3run

Re: Dust in air particle shader ??? - 06/26/17 20:13

Hi!

Why not use particles or sprites?

Greets.
Posted By: pegamode

Re: Dust in air particle shader ??? - 06/26/17 20:21

Particles, sprites, shader or a combination ... I just thought that someone did some kind of dust in air fx already.
Posted By: Ayumi

Re: Dust in air particle shader ??? - 06/26/17 20:29

Code:
#define Partikelraum skill1 
#define Partikelmenge skill2 


BMAP* bmapGlow = "P_Dust.tga";

var glowFade = 0;			// fadegeschwindigkeit
var glowMove = 0.5;		// Bewegungsgeschwindigkeit


function GlowRemove(PARTICLE *p)
{
	if(p.alpha <= 100 && p.skill_a == 0)
	{
		p.alpha += glowFade*time_step;
	}
	if(p.alpha >= 100){p.skill_a = 1;}
	if(p.alpha >= 1 && p.skill_a == 1)
	{
		p.alpha -= glowFade*time_step;
	}
	if(p.alpha <= 1 && p.skill_a == 1){p.lifespan = 0;}
}




´

function Glow(PARTICLE *p)
{
	glowFade = 3;
	p.vel_x = 1-random(4)*glowMove;
	p.vel_y = 1-random(4)*glowMove;
	p.vel_z = 1-random(2)*glowMove;
	p.alpha = 0;
	p.skill_a = 0;
	p.size = 20;
	p.bmap = bmapGlow;
	p.flags |= (BRIGHT | TRANSLUCENT | MOVE);
	p.green =  255;
	p.event = GlowRemove;
}


// uses: Partikelmenge, Partikelraum
action GlowErmitterBlob()
{
	VECTOR glowPos;
	set(my,PASSABLE | INVISIBLE);
	if(!my.Partikelraum) { my.Partikelraum = 3000; }
	if(!my.Partikelmenge) { my.Partikelmenge = -0.1; }
	
	while(!player) wait(1);
	while(1)
	{
		glowPos.x = my.x - random(my.Partikelraum) + my.Partikelraum/2;
		glowPos.y = my.y - random(my.Partikelraum) + my.Partikelraum/4;
		glowPos.z = my.z - random(my.Partikelraum) + my.Partikelraum/12;
		effect(Glow,1,glowPos,nullvector); 
		wait(my.Partikelmenge);
	}
	
	my.eflags &= ~DYNAMIC;
}

// uses: Partikelraum, Partikelmenge
action GlowErmitterPlayer()
{
	VECTOR glowPos;
	if(!my.Partikelraum){my.Partikelraum = 600;}
	set(my,PASSABLE|INVISIBLE);
	
	while(!player) wait(1);
	while(1)
	{
		glowPos.x = player.x - random(my.Partikelraum) + my.Partikelraum/2;
		glowPos.y = player.y - random(my.Partikelraum) + my.Partikelraum/2;
		glowPos.z = player.z - random(my.Partikelraum) + my.Partikelraum/2;
		effect(Glow,1,glowPos,nullvector);
		wait(my.Partikelmenge);
	}
}



Der Code ist sehr alt, darum sind die Bezeichnungen noch in deutsch. Aber da du ja scheinbar aus Deutschland kommst, brauch ich das nicht extra aufarbeiten.

The code is very old, so the names are still in German. But since you seem to come from Germany, i do not need to work that up.


EDIT: Added glowFade var

EDIT2: Reworked and testet, updated Code


Posted By: pegamode

Re: Dust in air particle shader ??? - 06/27/17 19:34

Hey Ayumi,

thank you very much ... I will check it out tomorrow.

Thanks
Sascha
© 2024 lite-C Forums