God Rays - Light Rays and other effects with irrlicht?

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
random
Posts: 158
Joined: Wed Aug 11, 2010 6:01 am

God Rays - Light Rays and other effects with irrlicht?

Post by random »

Well currently i use a particle system for the tail of a rocket propulsion, and i must say it is somehow ok aslong as it stands still, but as soon as it moves, turns it starts to flicker.

what i am basicly searching for are some God -Ray like effect for this and also later on also for some other parts of my project.

if you may want to have a look at this video of a game named copperhead http://www.youtube.com/watch?v=ueN1Z4Dq ... re=related
and watch the propulsions, ot looks like a straight tail, like a kind of a god ray.

here is annother video that shows such god rays
http://www.youtube.com/watch?v=Iy0hHsC1 ... re=related
(made with ogre)

from the last video i found a nearby similar looking example with sourcecode, why does Ogre has many similar classes and structure like Irllicht?

Anyway, i asked myself if there are some Irrlicht specific sourcecodes for uses like this, some other lightning effects that might be interresting too, some book especcialy about that?

any kind of help would be realy nice.
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Post by pippy3 »

It's called volumetric Lighting and there are a many resources out there.

Two ways off the top of my head to approach this: I'd just use a shadow bake on the shadow layer of a level and use meshes to make the "god rays". Or a pixel/vertex shader.

There's no inbuilt shader for this, and irrlicht only has a few inbuilt shaders.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Irrlicht does have a volumetric light scene node. The documentation is here:
http://irrlicht.sourceforge.net/docu/cl ... _node.html there should be a sample on how to use it in the special FX tutorial.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
random
Posts: 158
Joined: Wed Aug 11, 2010 6:01 am

Post by random »

yes i found it in api...

My first steps:

Code: Select all

//!Test VolueLightNode
scene::IVolumeLightSceneNode* vlight = smgr->addVolumeLightSceneNode (0,
		-1,
		32,
		32,
		video::SColor(51, 0, 230, 180),
		video::SColor(0, 0, 0, 0),
		core::vector3df(0, 5, 0),
		core::vector3df(0, 0, 0),
		core::vector3df(0.5f, 10.0f, 0.5f)
	);

    vlight->setMaterialFlag(video::EMF_LIGHTING, false);
    //vlight->setScale(core::vector3df(-1,-1,-1));
    vlight->setMaterialTexture( 0, txturevolume );
	//vlight->setMaterialFlag(EMF_LIGHTING, false);
	//!vlight->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
	//!vlight->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);
	//!vlight->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
    vlight->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
	vlight->setMaterialFlag(EMF_BACK_FACE_CULLING, false);
	vlight->setMaterialFlag(EMF_FRONT_FACE_CULLING, false);
	//vlight->setPosition(core::vector3df(0.628f,0.965f,2.4f));

//! end volumetric light
As you can see i need to play arround a little bit, i dident worked with irrlicht for a few month, so my own project is a little bit strange to me aswell as irrlicht code/api itself.

The code above is not realy satisfing yet i can´t see diferences with Material texture and surely i should read a little bit more.

In my current project i also use a modified billboard (aka CBeamNode) that would maybe also an option.

I will try both with animated texture (after i found out how it works for the volumetricLightNode).

One more question, i also found thisone:

Code: Select all

//!test VolumeLightMesh
scene::IAnimatedMesh* vlightm = smgr->addVolumeLightMesh ( "../../media/apotext3.obj",
		32,
		32,
		video::SColor(51, 0, 230, 180),
		video::SColor(0, 0, 0, 0)
	);
But it doesent show up anything, google even did not found an example...
is there something wrong with the code?

Thanks for pointing in the right direction.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Yeah, you just added a volume light mesh in the last one. You need to add a scene node using that mesh.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Also note that ou need to play around with textures a little bit. Check example 7 for an example how the volume light can look like (in case it's used as a light). You will probably have to use very different textures for your purpose, though.
random
Posts: 158
Joined: Wed Aug 11, 2010 6:01 am

Post by random »

hybrid wrote:Check example 7 for an example how the volume light can look like (in case it's used as a light)
you talk about this : http://www.youtube.com/watch?v=W84gFvTVRb4 example 7 ?

btw. it compiles for me but the sreen stays black, i need to check that but wanted to ask you if you realy mean this because in the video i dont seethe light you mean.

@3DModelerMan well i need to play arrount a little bit more, especially with animated texture, in the current version its just a lightbeam.

i´ll be back with better results i hope.


EDIT: i did not find yet if there is a way to use a sexture along the tail just at the "bottom" of the head... wether i will rewrite some classes or combine it with a plane or a üarticle system.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Sorry, I meant example 8. The video you find at the same location you linked to is old, though. There's not yet the volume light. But you can see an image here: http://irrlicht.sourceforge.net/docu/example008.html
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Post by pippy3 »

3DModelerMan wrote:Irrlicht does have a volumetric light scene node. The documentation is here:
http://irrlicht.sourceforge.net/docu/cl ... _node.html there should be a sample on how to use it in the special FX tutorial.
ha, TIL
random
Posts: 158
Joined: Wed Aug 11, 2010 6:01 am

Post by random »

well ok, there i see volumetric light.

The problem is still that it has no buildin options to have a animated texture along the tail axis so that there is just a not realy controllable texture that slowly fades out, for the desired rocket propulsion tail that would be real hard to use, i will still try to play arround with it a bit.

i walked through watching a few special fx from games wich i liked and realized that allmost every of those effects is made with billboards or modified billboards and textues partly made with after effects or similar, i will also have a look in this direction.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

You can scroll the texture coordinates each update step with the material layer: SMaterialLayer TextureLayer [MATERIAL_MAX_TEXTURES] and then use the void irr::video::SMaterialLayer::setTextureMatrix ( const core::matrix4 & mat ) function to animate the texture.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Post Reply