Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Light Mapping Objects in DBP? (or is it called Illumination Mapping?)

Author
Message
Straxus
16
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 3rd Apr 2011 01:44
Trying to understand how to do light mapping in DBP.
Now by light mapping I mean the method used in many video games to add a texture for illumination that is usually black on the areas you don't want illumination and shades of grey and white for areas you want to glow. While searching arround on the forums I came across talk of illuminated maps in FPSC Chat. So maybe that is what it is called officially?
Been playing arround with the set light mapping on command. Applying a lightmap image only seems to apply the lightmap over the normal map and with if lights removed from scene, still provides no illumination. (That and the darkened area just leaves rest of object black.) I also tried applying the lightmap via 3ds studio max and exporting model to use in DBP with no success.
When doing game mods in the past the light map textures were applied in the "self illumination" area of material box in 3DS MAX.
So my questions are:
1) What is light mapping (as far as DarkBasic Pro is concerned)
2) Can "Set Light Mapping On" be used to make textures illuminate with lack of light?
3) Will I have to learn about shaders to acheive "light mapping"? (If so I will hold off on this part of my learning till I am ready to tackle those.)

Was hoping my forums searches would give the answers I seeked but it just left me more confused.
Daniel wright 2311
User Banned
Posted: 3rd Apr 2011 01:58
1) Light mapping is A prosess used to show shadows where light shines, in the process textures are made that are used to tell the program Where the lights and shadows should look)
2) Yes and no,Setting Light Mapping On realy only works with light mapping textures for that object or leval ?
3) yes and no(there are many many pre made effect files you can use now for any light maping,bump maping,or even specular maping.)

If I where you I would use only effect files for thease issues.

my signature keeps being erased by a mod So this is my new signature.
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 3rd Apr 2011 03:20
Quote: "1) What is light mapping (as far as DarkBasic Pro is concerned)"

Lightmapping is a very efficient way of putting lights and shadows into a game, because all of the lighting is pre-rendered onto textures. These textures are then loaded, and use some sort of blend mapping to be drawn onto the object. You should understand that "lightmapping" is nothing more than that: just prerendered lightmap textures blended onto the object.

Quote: "2) Can "Set Light Mapping On" be used to make textures illuminate with lack of light?"

I'm not sure about how the native dbpro command works, but if used properly, lightmapping would allow you to have static lighting on an object without needing any "dynamic" lights. Most people use set light mapping on in conjunction with set object light, so that the object has only the lightmap.

Quote: "3) Will I have to learn about shaders to acheive "light mapping"? (If so I will hold off on this part of my learning till I am ready to tackle those.)"

Simple answer: probably not!
If you want to apply lightmapping through code, dbpro has a native lightmapping command, and if that doesn't work, there are shader alternatives that people have written, that are relatively easy to use without any shader knowledge.
Also, some model or level editors (3DWorldStudio for example) actually save the model file already with the object multitexturing applied. If you can figure out how to do this, it'll save a lot of time, because you do not need to add any code to load and apply a lightmap. I also believe that Dark Lights does this.

Straxus
16
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 3rd Apr 2011 08:02 Edited at: 3rd Apr 2011 08:26
OK so it sounds like what DBP calls lightmapping is the same as what I understand it to be from my experience in game modding circles over the years.
Though don't remember any lightmaps I worked with being able to effect shadows, just glow areas of the texture mesh in the dark. Also just to make sure we are on same page I am adding a image of lightmap via 3D studio max.
A while back I was going to pick up 3D World Studio, though tested demo and it kept crashing before I could do anything with it..
I was really hoping it would just export from 3DMax but no such luck.
Found a few effect shaders I am gonna play arround with and see what I can do with them.
Quote: "If you want to apply lightmapping through code, dbpro has a native lightmapping command"

There are other commands related to this other than "Set Light Mapping On"?
Matty H
17
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 3rd Apr 2011 15:12 Edited at: 3rd Apr 2011 15:13
Try 'Dark Lights', there is a free demo, you can also find a free solution on Evolved's site, I think Dark Lights is the best option though as I think Evolved uses this in Mapscape.

'Mapscape', try that too, its free

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Apr 2011 15:55
He there. I have used Darklights and works ok....mapscape works as well, but has some limitation....Gile(s) is good ....but one of the best lightmapping I´v seen, is Deled, now it is free, and with its own plugin ,we can export to .x or directly to .dbo.

I´v got my own method as well, using just Dbpro code
Cheers.

I'm not a grumpy grandpa
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 3rd Apr 2011 18:43
Quote: "OK so it sounds like what DBP calls lightmapping is the same as what I understand it to be from my experience in game modding circles over the years.
Though don't remember any lightmaps I worked with being able to effect shadows, just glow areas of the texture mesh in the dark. Also just to make sure we are on same page I am adding a image of lightmap via 3D studio max."

I think we are actually both getting confused. I thought you were talking about lightmapping, which is rendering a texture of all the lighting, as seen as in this screenshot: Blender lightmap
Based on the example screenshot you posted, you are actually talking about illumination maps, which are something entirely different... they are images that specify which parts of an object are not affected by the light and will "glow".
Sorry for the confusion. I do think that there are shaders that do this, I'll try to find one for you.

Straxus
16
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 3rd Apr 2011 21:01 Edited at: 3rd Apr 2011 21:19
Thanks guys!
Sorry about the confusion. From years in modding communities they kept insisting that the illumination mapping was lightmapping.
Though after seeing and understanding what actual lightmapping is, I definitely want to use that as well. Just now explains why it was not working the way I expected it to.
Thanks for the info guys!
matty halewood & chafari, I downloaded gile(s) and darklights demo last night. Will check out the others. Now that I know the actual purpose for the software I can use it more effectively...
Thenerd, thanks for helping with this.

Just found thischanged it, was wrong link) http://code.google.com/p/fpscreatorengine/source/browse/trunk/effectbank/ps_2_0/illuminationmap.fx?spec=svn109&r=109

Would that be code for illumination style fx I might need? Attempting to turn it into a .fx file, though not sure if the formatting is gonna hold up right.
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 4th Apr 2011 00:24
I found a shader you could use, not sure who made it but it works very well. It might be a bit complicated, but it has normal, specular, and illumination mapping.

Straxus
16
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 4th Apr 2011 01:25
Ran the example and looks great! Coverers the others I would need as well. Now I just need to figure it out to apply it to my project...
Thanks!

Login to post a reply

Server time is: 2026-07-11 14:57:04
Your offset time is: 2026-07-11 14:57:04