dynamic lightmaps

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
floppyfreak
Posts: 117
Joined: Sat Apr 19, 2008 10:14 am

dynamic lightmaps

Post by floppyfreak »

I want to reproduce an effect like this one (taken from descent3):
Image
obove you see a flare and its halo on a wall. (I don't mean the frames, they just shal point :lol: )
under you see two yellow laser shots and their halos touching the wall.

I don't find a standard method in irrlicht to make this. As far as I have understood so far I can write a shader or use lightmaps. The second seems to be more simple, so I want to manipulate the existing lightmap and add the volatile lights to it every some frames. Or is it more clever to blend a new texture to the existing textures? How is this done?

Does anybody have an idea or tool in his box how to make it as simple as possible?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

It looks like ordinary dynamic lighting to me. Per-pixel, but ordinary.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
floppyfreak
Posts: 117
Joined: Sat Apr 19, 2008 10:14 am

Post by floppyfreak »

I tought so it could be done with per pixel lighting. But I don't find an irrlicht material to use here (irr::video::E_MATERIAL_TYPE)
How can I use ordinary per pixel lighting to achieve this effect in irrlicht ?
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

You gotta write your own shader, or use material of type parallax map(normal would probably work too)
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

Let's clear up a tiny bit: a lightmap is a texture that controls the lighting of an object. It's static - it doesn't change. This can be good because if you have an object whose lighting in a scene doesn't change, rendering using a lightmap is a lot faster than doing dynamic light calculations.

Dynamic light is calculated, well, dynamically. Per-vertex lighting (which is done with the normal, fixed-function graphics pipeline) only calculates lighting at every vertex of the geometry and interpolates between vertices. With per-pixel lighting, you use a pixel shader that runs on every pixel of an object to calculate lighting effects.

You may be able to use the bump or parallax map material, but if you're not using a bump or parallax map (additional textures that affect how the object is lit), you might as well use your own custom shader.

Dynamic lighting is often done with Phong shading, which not only lights the surface but adds specular highlights (little points of bright reflections) automatically. NVIDIA provides a sample phong shader in their shader library. You can find it here.
Post Reply