Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Aditive Blending; for making great effects
Topic Started: Jun 13 2006, 07:44 PM (811 Views)
Haunebu
Member Avatar
WW2 games developer
[ *  *  * ]
(I'm not sure that Aditive Blending is the True word)

I want to do more realistic fire and explosions with :U3D: particles. I would do it using simply Flamethower example (first picture), but I haven't seen any idea in the U3D help.

Posted Image

Have someone done it?
Posted Image
I don't like american heroes.
Offline Profile Quote Post Goto Top
 
Zip
Member Avatar
Forum Leader
[ *  *  *  *  * ]
Dr. Best in hes Hovercraft Wars told that he had used a vertex shader for the explosions, maybe he can ask here and post it.
That will be useful to whole communuty! :rolleyes:
Sorry if i've made some errors, I'm not english!
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
The best and easiest solution, which I can think of, which also is very efficient, looks nice and is lag-free is that you can use a 2D texture to draw the explosion. Many commercial games do this and you can make it look nice and realistic if you draw a nice looking explosion texture. Like this:
Posted Image
And just make an animation of it with several images using LoadTexture.
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
I agree with Despellanion. The only problem is setting up the material options so that it seems actually bright. To realize this I recommend the use of the variable no_light. Set it to true to reach that the colors of the texture get rendered absolutely unchanged.
Offline Profile Quote Post Goto Top
 
Zip
Member Avatar
Forum Leader
[ *  *  *  *  * ]
But how i can make the billboard transparent, like using the blend mode in standard 2D gamemaker?
Sorry if i've made some errors, I'm not english!
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Zip
Jun 14 2006, 09:49 PM
But how i can make the billboard transparent, like using the blend mode in standard 2D gamemaker?

Use a transparent .png or .tga texture of the explosion.
Offline Profile Quote Post Goto Top
 
Haunebu
Member Avatar
WW2 games developer
[ *  *  * ]
Yeah, the bilboard graphics are used for exapmle in UT2004. I'm sad, that I wount be able to make effects like in Desert rats vs. Afrika Korps. Maybe bilboard explosion + particle smoke will be good enough.
Posted Image
I don't like american heroes.
Offline Profile Quote Post Goto Top
 
Haunebu
Member Avatar
WW2 games developer
[ *  *  * ]
how can I do simple animated bilboard effect? :U3D: doesn't support GIF files. I tryed to do that effect by 30 BMP images. But the bilboard was only white.
i used this code:
Code:
 

texture+=1
Create2D()
Posted Image
I don't like american heroes.
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
Use this code instead:
Code:
 
// Create event
texture=<index of the first explosion texture>;
Create2D();
// Step event
texture+=1;
if(texture > <index of the last explosion texture>){
   texture=<index of the first explosion texture>;
}
Step();
Offline Profile Quote Post Goto Top
 
Haunebu
Member Avatar
WW2 games developer
[ *  *  * ]
it didn't work. Maybe I've done something wrong in control of explosion object:
Code:
 

Information about object: explosion

Sprite: <no sprite>
Solid: false
Visible: false
Depth: -1
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
set variable z to -GetDistanceToModel( Island, x, y, 0, -90, 0)
execute code:

no_light = true
texture=20
width = 6
height = 6
originx = 1/2
originy = 1
Create2D ()

Destroy Event:
execute script Destroy with arguments (0,0,0,0,0)

Step Event:
execute code:

texture+=1;
if(texture > 39){
texture=20;
}
Step();


Code:
 

Information about object: control

Sprite: Controller
Solid: false
Visible: false
Depth: -9
Persistent: true
Parent: <no parent>
Mask: <same as sprite>

Create Event:
set variable range to 4000
set variable BG_r to 0
set variable BG_g to 0
set variable BG_b to 0
execute script Init with arguments (0,0,0,0,0)
COMMENT: Load textures here
execute code:

LoadTexture('gfx\4.bmp',0);
//LoadTexture('gfx\house7.jpg',1);
//LoadTexture('gfx\house8.jpg',2);
LoadTexture('gfx\tex.jpg',3,256,256);
LoadTexture('gfx\tree.bmp',4,256,256);
//LoadTexture('gfx\house3.jpg',5);
//LoadTexture('gfx\house2.jpg',6);
//LoadTexture('gfx\house4.jpg',7);
//LoadTexture('gfx\house5.jpg',8);
LoadTexture('gfx\les.png',9,4563,760);
LoadTexture('gfx\sign1.bmp',10);
LoadTexture('gfx\Zamerovac.png',11);
LoadTexture('gfx\point.png',12);
LoadTexture('gfx\smoke.png',13);
LoadTexture('gfx\spheremap.bmp',14);
LoadTexture('gfx\spheremap2.bmp',15);
LoadTexture('gfx\obloha.jpg',16);

LoadTexture('gfx\ex\ex_1.bmp',20);
LoadTexture('gfx\ex\ex_2.bmp',21);
LoadTexture('gfx\ex\ex_3.bmp',22);
LoadTexture('gfx\ex\ex_4.bmp',23);
LoadTexture('gfx\ex\ex_5.bmp',24);
LoadTexture('gfx\ex\ex_6.bmp',25);
LoadTexture('gfx\ex\ex_7.bmp',26);
LoadTexture('gfx\ex\ex_8.bmp',27);
LoadTexture('gfx\ex\ex_9.bmp',28);
LoadTexture('gfx\ex\ex_10.bmp',29);
LoadTexture('gfx\ex\ex_11.bmp',30);
LoadTexture('gfx\ex\ex_12.bmp',31);
LoadTexture('gfx\ex\ex_13.bmp',32);
LoadTexture('gfx\ex\ex_14.bmp',33);
LoadTexture('gfx\ex\ex_15.bmp',34);
LoadTexture('gfx\ex\ex_16.bmp',35);
LoadTexture('gfx\ex\ex_17.bmp',36);
LoadTexture('gfx\ex\ex_18.bmp',37);
LoadTexture('gfx\ex\ex_19.bmp',38);
LoadTexture('gfx\ex\ex_20.bmp',39);
execute script LoadBackground with arguments ('gfx\obloha.jpg',0,0,0,0)
execute script SetAmbient with arguments (70,77,56,0,0)
execute script SetFog with arguments (163,171,184,100,1000)
execute code:

instance_create(3000,3000,Island)

Destroy Event:
execute code:

if(global.loaded==true){
   external_call(global.cleanup);
   global.loaded=false;}

Begin Step Event:
if expression global.loaded is true
     execute code:

external_call(global.present);

End Step Event:
if expression global.loaded is true
     execute script MoveCamera with arguments (0,0,0,0,0)
     execute code:

external_call(global.render);

Keyboard Event for <Backspace> Key:
execute code:

global.vitr=random(360)

Other Event: Game End:
execute code:

if(global.loaded==true){
   external_call(global.cleanup);
   global.loaded=false;}

Key Press Event for F3 Key:
execute script Snapshot with arguments ('snapshot '+string(current_year)+' '+string(current_month)+' '+string(current_day)+' - '+string(current_hour)+' '+string(current_minute)+' '+string(current_second)+'.bmp',0,0,0,0)

Key Press Event for F6 Key:
execute script SwitchView with arguments (0,0,0,0,0)
execute code:

with(all){
   visible=(visible==0);}

Posted Image
I don't like american heroes.
Offline Profile Quote Post Goto Top
 
Haunebu
Member Avatar
WW2 games developer
[ *  *  * ]
Well, now it's a bit more clear:

Information about object: explosion

Sprite: <no sprite>
Solid: false
Visible: false
Depth: -1
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
texture=20
Create2D ()

Step Event:
texture+=1;
if(texture > 39){
texture=20;
}
Step();

Information about object: control

Sprite: Controller
Solid: false
Visible: false
Depth: -9
Persistent: true
Parent: <no parent>
Mask: <same as sprite>

Create Event:
LoadTexture('gfx\ex\ex_1.bmp',20);
LoadTexture('gfx\ex\ex_2.bmp',21);
LoadTexture('gfx\ex\ex_3.bmp',22);
LoadTexture('gfx\ex\ex_4.bmp',23);
LoadTexture('gfx\ex\ex_5.bmp',24);
LoadTexture('gfx\ex\ex_6.bmp',25);
LoadTexture('gfx\ex\ex_7.bmp',26);
LoadTexture('gfx\ex\ex_8.bmp',27);
LoadTexture('gfx\ex\ex_9.bmp',28);
LoadTexture('gfx\ex\ex_10.bmp',29);
LoadTexture('gfx\ex\ex_11.bmp',30);
LoadTexture('gfx\ex\ex_12.bmp',31);
LoadTexture('gfx\ex\ex_13.bmp',32);
LoadTexture('gfx\ex\ex_14.bmp',33);
LoadTexture('gfx\ex\ex_15.bmp',34);
LoadTexture('gfx\ex\ex_16.bmp',35);
LoadTexture('gfx\ex\ex_17.bmp',36);
LoadTexture('gfx\ex\ex_18.bmp',37);
LoadTexture('gfx\ex\ex_19.bmp',38);
LoadTexture('gfx\ex\ex_20.bmp',39);

so what's wrong? All the images are supported. All the images were load. All the images were add to animation. HUH? Did I forget about something else?
Posted Image
I don't like american heroes.
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
What's wrong is that you have set visible = false. Visible must always be true when drawing 2D textures.
Offline Profile Quote Post Goto Top
 
Haunebu
Member Avatar
WW2 games developer
[ *  *  * ]
the explosion is still white. :sad:
Posted Image
I don't like american heroes.
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Have you added Destroy(); and tried setting no_light=true ?
Offline Profile Quote Post Goto Top
 
Haunebu
Member Avatar
WW2 games developer
[ *  *  * ]
I didn't find out what was wrong, but if i made another object with the same functions it works!!! It's strange, isn't it? :wacko:
Posted Image
I don't like american heroes.
Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply