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.

Author
Message
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 21st Apr 2010 03:48
How do I make a little ball of light that I can place any where to light up the objects around it?
I have tried this but I am trying to do this on a map that has lightmaps included in the .dbo, is it even possible for me to have a secondary light source light the walls, even though they already have lighting?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Apr 2010 04:11
If you want to make a ball of light, you can do it with just a sphere, and then SET OBJECT LIGHT MY_OBJ,100 then just make a light, and put it inside the ball.

If you want to illuminate a level .dbo that has already lightmappings, that is not possible as you won´t be able to see the light as lightmaps will not change.

cheers.

I'm not a grumpy grandpa
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 21st Apr 2010 04:21
Quite simple. I did this just recently on a project with a sun/moon cycle. You could use a sphere as mentioned, or even more simple and to look really nice is just use a plane, texture it with a image that has a sun/light flare on it (so there will be transparent sections) and then position it where your light is located in the program.

From there, you just have to make the plane always be facing the camera, and you will have a light that wherever you put your light in the program it'll follow and always be looking at the camera.

www.myspace.com/norseblod
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 21st Apr 2010 19:31
Quote: "If you want to illuminate a level .dbo that has already lightmappings, that is not possible as you won´t be able to see the light as lightmaps will not change."


Actually, lightmapping is just a texture on the object, and it will still react to light. It will take some tweaking to get the right light color and effect you want though.

gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 22nd Apr 2010 01:23
So how could I do these tweaks?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 22nd Apr 2010 02:22
Quote: "Actually, lightmapping is just a texture on the object, and it will still react to light. It will take some tweaking to get the right light color and effect you want though"



@KISTech
If you are sure of that....can you show us how you make react the texture on a dbo....please....please


cheers.

I'm not a grumpy grandpa
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 22nd Apr 2010 04:23
if you are using the dark basic lights... try the color light command, or look in the light menu. if you are planning on a shader... I don't know nearly enough about that...

www.myspace.com/norseblod
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 22nd Apr 2010 18:35 Edited at: 22nd Apr 2010 18:37
It was a few years ago, but here are a couple of screenshots of a building that I textured and lightmapped in 3D World Studio.

The interior was lit by lamps on the ceiling, and there was going to be one porch light just to the left of the door.



When I brought up the sunlight for the day cycle.



It's a matter of how you apply the lightmap, and adjusting the ambient light, and the primary light sources. I was playing around with this while working out a Day/Night cycle. I can't seem to locate the code right now, but it's around here somewhere.

If I'm wrong about lights affecting a lightmapped object, then the images above were achieved through another method of dynamic lighting that I was attempting at the time. That involved using DarkLights, and creating a new lightmap for the object based on the current lighting conditions. It used DarkLights ability to go off in another thread and create the lightmap while the program continued to run. It checked each loop to see if the pending lightmap was ready, and when it was it applied it to the appropriate texture stage of the object.

I didn't use any shaders at the time. (I was a little intimidated by them) So I was using the SET BLEND MAPPING ON command. A command that I've spent weeks playing with, and still don't understand it's full potential.

In the end the best way is probably going to be with a shader.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 22nd Apr 2010 19:05 Edited at: 22nd Apr 2010 19:09
Quote: "If I'm wrong about lights affecting a lightmapped object, then the images above were achieved through another method of dynamic lighting that I was attempting at the time. That involved using DarkLights, and creating a new lightmap "


Yeah...here we go !! this is the trick...there are a lot of ways to get the same.

That´s like advanced terrain..they won´t be affected by any light and we have to play with the texture....but that is another theme.

cheers.

I'm not a grumpy grandpa
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 22nd Apr 2010 20:56
I don't really know much about Advanced Terrain. I never messed with it.

However, a lightmap is just a texture whose color is being added to the existing textures. So there's no real reason why light wouldn't still have an impact on it. The darker areas should lighten, and the light areas will probably wash out to white depending on your light settings.

I'll see if I can code a quick example today.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 22nd Apr 2010 21:33 Edited at: 22nd Apr 2010 21:35
Quote: "However, a lightmap is just a texture whose color is being added to the existing textures. So there's no real reason why light wouldn't still have an impact on it. The darker areas should lighten, and the light areas will probably wash out to white depending on your light settings."


Yeaaah..I wish it was like that.That would be great...but unfortunately, .dbo levels don`t react to lights.

Quote: "gopherbro 94 said:... I have tried this but I am trying to do this on a map that has lightmaps included in the .dbo"
.

Believe me ...that`s way I told him all this story.

If you still have any doubt...just load from darkbasic pro, one of your pretty levels, and hide light 0 and set mabient light to cero...you will notice that your level will be lit like when you exported from your 3D program.

I`m an old dog !!

cheers.

I'm not a grumpy grandpa
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 23rd Apr 2010 01:23 Edited at: 23rd Apr 2010 01:32
Quote: "I`m an old dog"


Me too.


I found the code for that building above.

What I found was,

- The building model is a DBO
- The base textures are included in the DBO
- The lightmap was saved separately

Taking all the lights to 0, the lightmapped areas are of course still lit, but the base texture colors are diminished, and areas not receiving light from the lightmap are completely black. As I bring up the ambient light, everything lightens.

So it seems the answer is to separate the lightmap from the model before export, and save it separately. Then use this command to apply it to the model in DBPro.

set blend mapping on OBJ, 2, LM_IMAGE, 3, 8 ` The 8 is ADDSIGNED blending

In the case where I wanted the porch light to be switched off during the daytime hours I just cleared the object's textures with a TEXTURE OBJECT Obj, 0 and then retextured it with the original textures excluding the lightmap.

To turn the porch light back on for the next evening, just use the set blend mapping on command above.

Come to think of it. That's the last model I ever used that had the textures included in it from the graphics program. Ever since then I've always textured them myself.

I'm not certain what texture stage, or what blending technique the graphics app might be using when saving the lightmap with the DBO, but whatever it's doing, that is probably what is stopping the model from receiving light. Which would make sense why separating the lightmap and applying it yourself would work.

Here's another pair of screenshots from the code I found. The only difference between the two is the ambient light color. 255 in the first one, 0 in the second.



chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Apr 2010 02:58 Edited at: 23rd Apr 2010 02:58
Yeah..I`m with you about making a trick with the blend mapping on, but when I explained to gopherbro 94 about the problem of the dbo file, I wasn´t wrong.Our friend gopherbro 94, is learning a lot from this two old dogs ...or perhapas he`s getting bored with us.

Here I show in the picture, how lights affect to objects , regardless there are a lot of ways to do a trick.The level, is an dbo file, while the box and the sphere, are primitives from Dbpro.



cheers.

I'm not a grumpy grandpa
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 23rd Apr 2010 03:45
Hey, I learned something today too. So it's all good.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Apr 2010 03:51
we never go bed without something learned.

cheers.

I'm not a grumpy grandpa
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 23rd Apr 2010 06:32
I'm definitely learning, but I was hoping I could have the lightmaps on the map and also have an object light up certain parts of the walls even more... like a flashlight
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Apr 2010 14:09
@gopherbro 94

As you say, you can have the map lightmapped, and you can add so many object you need to make it more realistic, and this objects, could react to lights...that depends of what you need.

cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-26 05:59:12
Your offset time is: 2026-07-26 05:59:12