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.

Dark GDK / Basic Lightmapping

Author
Message
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 22nd Nov 2009 22:10 Edited at: 22nd Nov 2009 22:12
Hi,
I'm trying to get Lightmapping to work in DarkGDK.
To create the lightmaps I use a free tool called LightMapMaker.
What are the basic steps to apply lightmaps to a x-model (e.g. a map)?
I guess lightmaps use a certain texture stage and have their own uv-coordinates. Does the built-in dbSetLightmappingOn work with shaders?

EDIT: attached a basic test-map with a lightmap image.

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.

Attachments

Login to view attachments
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 22nd Nov 2009 23:03
I use a shader to add a lightmap to a .X file. The good thing is I can set the intensity ingame

_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 23rd Nov 2009 10:05
I already thought about a shader, and writing one is easy. But I don't really understand how a lightmap is mapped on an object!
As you can see in the previously attached texture, all lightmaps for the whole model are put into one image file. I don't know how to uv-map them on my object.
Or do lightmapping-tools in general generate a new set of uv-coordinates? (exporting x-files from LightMapMaker is possible)

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 24th Nov 2009 17:06 Edited at: 24th Nov 2009 17:35
Ok, I can load the object with working light map now, as you can see in the attached screenshot.
But I can't texture the object anymore! I mean I can't do anything about the texture, not even re-texture it with some random image!
I am not using a shader on the object yet.
Is this a bug?

EDIT:
To explain:
I have one x-file with the small test map with the UV for the diffuse texture in it. Then I have another x-file exported from Light Map Maker, that is shown in screenshot and which texture I can not change! I need a way to somehow merge these two UV sets/textures together!

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.

Attachments

Login to view attachments
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Feb 2010 12:24
@Pauli


I am just guessing, but isn't it possible to add multiple layers in DBP together?

http://darkbasicpro.thegamecreators.com/?f=tour7

Sorry if this isn't helpful...

TheComet

_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 21st Feb 2010 12:45
Ok, thanks for the reply TheComet!
Well, I knew that you can apply multiple texture stages...
I just want to know how a lightmapper sets the uv coordinates in a light mapped model, because the lightmap for a whole model is stored in one single image!

By the way, I found these command in DarkSDKBasic3D.h:



Does anybody know if they work?
I thought one would have to buy DarkLights to have lightmap functionality in DarkGDK!

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Feb 2010 01:39
@ Pauli

I downloaded and tried this out, and the models it exports make NOOOO sense to me at all... If I load them into DBP, they show up all lightmapped, but if I import one of the models into AC3D, it isn't textured and the UV map is all screwed up.

Also, the lightmapped images this program exports make no sense either. I think my camel can write a better exporter than whoever made it...

I then tried to resize each limb on the lightmapped object so every surface is over the surface of the original, unlightmapped object, and then I ghosted the two together using negative alpha blending. It didn't turn out that bad actually, a bit too dark though.

If you have time on your back, you can try that, but it is VERY time consuming and inefficient.

Another possibility is to disable the zdepth of the lightmapped object and then use negative alpha blending. Still a bit dark, but you don't get ugly scrapes here and there. The only problem is that the whole object will then draw over everything else, including the player. So if you have an FPS game, it may just work.

Hope this helps a bit...

TheComet

Login to post a reply

Server time is: 2024-10-05 16:21:16
Your offset time is: 2024-10-05 16:21:16