My attempt on making light beams

Discuss artwork in all of its forms here, from level design to GUI button themes. New MODs planning, work-in-progress and other samples are welcome in this forum as well.
Post Reply
Sindwiller
Posts:108
Joined:2006-04-14, 21:11
Location:Zürich, Switzerland
My attempt on making light beams

Post by Sindwiller » 2007-05-06, 21:56

... kind of failed ;)

http://xs115.xs.to/xs115/07180/pic0001.jpg
(yes, the level is unlit)

Well, I've got two questions:

1) How can I get rid of these very sharp change overs? Id like to make rays similiar to this : http://media.pc.ign.com/media/492/49283 ... 77290.html

2) How can I make an animation (out of multiple images probably?)

My .cmat looks like this:

Code: Select all

Models/Static/light_beam/light_beam01
{
	diffusemap Models/Static/light_beam01.png
//	lumamap Models/Static/light_beam01_luma.png
//	ambientMask d
//	nodynLight
	blendFunc src_alpha dst_alpha
	noShadows
	clip nothing
	twoSided
	alphaTest 0.2
	alpha 0.5
}
Im Working on:
- Some Linux Bash-Scripts for installing stuff. Dont ask further questions, because i can't explain that more simple ^^
User avatar
Kai
Posts:177
Joined:2004-08-19, 15:56
Location:Germany
Contact:

Post by Kai » 2007-05-07, 13:45

Hi Sindwiller

It looks like your alpha is not correct set. You need a soft transition not a clipped alpha (that is mainly used for stencil out purpose like plants), so the one on your shot looks clipped at some range.

Im currrently not uptodate for the mat prefixes to get soft alpha blending but it is documented in the wiki !

Animation:
Add a bone to every plane and rotate them, animate them by some small script like sinus wave or just manual rotate the joints whatsoever.
Export them , should work well.
User avatar
Thrawn
Posts:302
Joined:2004-08-30, 10:38
Location:NRW, Germany
Contact:

Post by Thrawn » 2007-05-07, 14:09

You should talk with Carsten, I think light beams are in most games created with sprites, though I admit that the sort of beams you want to achieve are made like you did them.

I would suggest you to create a better transition in the alpha channels and also not to make the channel for the visible parts of the beams white (for 100% visibility). I think something around 30% is quite better.

Anyways, nice try, your tests should be a great addition in knowledge for us, maybe we can work something proper out :)
Image
Sindwiller
Posts:108
Joined:2006-04-14, 21:11
Location:Zürich, Switzerland

Post by Sindwiller » 2007-05-07, 16:41

Im currrently not uptodate for the mat prefixes to get soft alpha blending but it is documented in the wiki !
No, it's not.
It looks like your alpha is not correct set. You need a soft transition not a clipped alpha (that is mainly used for stencil out purpose like plants), so the one on your shot looks clipped at some range.
That's becaue of 'alphatest 0.2'. And I played alot with those values...
I would suggest you to create a better transition in the alpha channels and also not to make the channel for the visible parts of the beams white (for 100% visibility). I think something around 30% is quite better.
Okay, will try :)
Im Working on:
- Some Linux Bash-Scripts for installing stuff. Dont ask further questions, because i can't explain that more simple ^^
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: My attempt on making light beams

Post by Carsten » 2007-05-08, 16:04

Hi Sindwiller,
Sindwiller wrote:1) How can I get rid of these very sharp change overs? Id like to make rays similiar to this : http://media.pc.ign.com/media/492/49283 ... 77290.html
For completeness, as mentioned in the chat yesterday, I'd recommend to try a similar approach as the "glowing balls" that a thrown FaceHugger emits. The material script that is used by these glowing balls is found in DeathMatch\Materials\Sprites.cmat, here is the relevant excerpt:

Code: Select all

Sprites/Generic1
{
    diffusemap Textures/Sprites/Generic1.png

    noDynLight

    blendFunc one one
 // blendFunc src_alpha one_minus_src_alpha

    red   fParam0     // Use 1.0 instead of fParam* !
    green fParam1
    blue  fParam2
    alpha fParam3

    ambientMask d       // Don't write into the depth buffer!
}
You'll want to write "1.0" instead of the "fParam*" keywords, try different values with "alpha", experiment with the blendFunc and ambientMask, but the above should get you started.

Also note that with "red", "green", "blue" and "alpha", the value 1.0 is the default, that is, you can omit/remove lines like "red 1.0" entirely.

Code: Select all

2) How can I make an animation (out of multiple images probably?)
Currently the MatSys doesn't support this at all, but I'll add support for multi-frame images and video textures soon.
My .cmat looks like this:

Code: Select all

Models/Static/light_beam/light_beam01
{
	diffusemap Models/Static/light_beam01.png
//	lumamap Models/Static/light_beam01_luma.png
//	ambientMask d
//	nodynLight
	blendFunc src_alpha dst_alpha
	noShadows
	clip nothing
	twoSided
	alphaTest 0.2
	alpha 0.5
}
"clip nothing" and "twoSided" are certainly good ideas and should be added above...

Please keep us posted on your progress - you're exploring new areas for everyones benefit! :cheesy: :up:
Best regards,
Carsten
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests