Aller au contenu

Photo

Fixing the Lightmapper?


  • Veuillez vous connecter pour répondre
17 réponses à ce sujet

#1
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
social.bioware.com/project/2793/&v=discussions#discussions 

No promises, no expectations, no disappointments, but something should be done so I'll start the ball rolling even if I can't finish it.

#2
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Oh look, its a download!

#3
-Semper-

-Semper-
  • Members
  • 2 256 messages
finally after 2 years of development - gratz to you and thx for all the invested effort!
now i only have to install da:o and the toolset again to do some testing :D

Modifié par -Semper-, 15 juillet 2012 - 01:20 .


#4
sea-

sea-
  • Members
  • 264 messages
Can't believe I missed this. Awesome work! I'm going to test it out ASAP. I hate lighting interior levels due to all the bugs in the existing lightmapper, so hopefully this one handles them better.

Can you clarify what has changed from the standard one (other than the algorithm used of course)? For example, do you still have to post from Single Player? Are transparency issues fixed? Do baked lights work properly? I'd love to finally be rid of EclipseRay, that's for sure.

EDIT: I receive the following error every time I try to render lights, and the lightmapper crashes:

http://i.minus.com/iQsLaJAMfRe9e.png

I have set things up as indicated in the readme file, though I might be making a mistake. Running Windows 7 x64.

Modifié par sea-, 03 août 2012 - 06:03 .


#5
sea-

sea-
  • Members
  • 264 messages
Never mind, got it working - for some reason I had to manually select the working directory, copy-pasting it in didn't work.

Only problem is, the lightmapper is basically unusable. It does work for sure, in that it creates lightmaps and interacts well with the Toolset... but they make (most) of the level entirely blue, even without an ambient light present. Most of the static lights also failed to render at all.

#6
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Yeah I did a brief test and found that it didn't reproduce the colour of the lights, required a super high intensity compared to EclipseRay, and produced seams at mesh boundaries, as posted in the project's forum - http://social.biowar...scussion/80639/

I had assumed the blueness was a result of using purple-coloured statics, but your similar results would suggest otherwise.

#7
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Could you send me your level files? There are instructions in the project on which ones. If its not an ambient light issue, then perhaps the colour value is too big for the variable I am using. I may be scaling it wrong, or I may just be reading the colour of lights wrong, though I doubt it since it seems to work fine for the colour of the lights I have tested it with.

#8
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Ok, looking at darth's files, it seems that I am not doing shadow maps correctly. The lights are exported as (RGB) (0.001,0.0,1.0) even though they are clearly not that colour in the editor (0.68,0.29,0.85), so thats why its all blue. They do have a shadow colour of (1.0,0.0,0.0) though. I'm not sure what a shadow map is really for, but even then I don't see how those two colours map to the in editor colour. perhaps its because they are animated.

#9
tmp7704

tmp7704
  • Members
  • 11 156 messages

ChewyGumball wrote...

I'm not sure what a shadow map is really for, but even then I don't see how those two colours map to the in editor colour. perhaps its because they are animated.

Shadow maps contribute to overall lighting the object receives, as documented here

Diffuse = DynamicAmbient + F(DynamicLights, DynamicShadows) + ( LightmapRGB + LightmapShadowMap * F(StaticLights , DynamicShadows) )

Where F is the function which calculates light contribution given the dynamic shadow map.

#10
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Ok, the shadow map (blue) issue should be fixed, though the seams have not. I am not sure what is causing them yet. I have updated the download.

#11
sea-

sea-
  • Members
  • 264 messages
Things have been significantly improved by your update. Colour and light intensity are both calculated correctly.

Posted Image

However, it seems as if the lightmaps themselves aren't being applied to the correct surfaces, and several objects are missing lightmaps entirely.

Modifié par sea-, 11 août 2012 - 08:47 .


#12
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Have you confirmed that in the area editor or the game? The level editor always mis-applies light maps after a while.

#13
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
That is interesting. I have updated the download with some improvements to fix some of the seam issues. One thing I noticed, Darth,  is that your lightmaps are pretty small (32x32). That exaggerates seams and pixelation so another thing to try is increasing the size.

Modifié par ChewyGumball, 12 août 2012 - 04:02 .


#14
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Run the lightmapper a few times, even without changing anything, and eventually the lightmaps will be "corrupted", inasmuch as the level editor will start applying them to the wrong models. When you post to local though and check the area editor or the game, the lightmaps are properly applied. I'm not sure what the cause is, but this has always been a problem with the level editor. Possibly it's a clash between all the various different cached maps. It helps to clean them all out regularly - http://bg2redux.stud...ngLightmapFiles

As to lightmap size, you have manual control over that? Where is that specified? I've looked in the past for that and never found anything, so I assumed the lightmapper automatically determined it.

Modifié par DarthParametric, 12 août 2012 - 04:25 .


#15
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
They are determined by the .met (I think thats the extention) files. They are xml files that eshme's tool should create. It may be defaulting to 32x32 if there are none.

#16
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Yeah metadata. Props won't lightmap without it. But there's nothing in there specifying map size that I can see, in either ones exported by Eshme's script or vanilla ones.

Edit: Whoops, I'm blind.

<LightmapSize>
						<Value>
							<![CDATA[64]]>
						</Value>
					</LightmapSize>

Might have to ask Eshme to add in some option to specify this somewhere. It seems to be variable between files, so it's not a static value. Presumably the script is deciding what to set it at somehow.

Modifié par DarthParametric, 12 août 2012 - 06:21 .


#17
sea-

sea-
  • Members
  • 264 messages
The new version of your lightmapper doesn't work for me. When I start rendering, it hangs pretty much indefinitely, consuming increasingly more memory (I saw 4+GB), and brings my entire system to a screeching halt. I'm also not sure but it doesn't seem to like outdoor areas or levels with lots of rooms (maybe you already knew this though).

#18
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Thats interesting. Can you send me the scene files you were using? I know that there are some model files I can't read properly, so it may be that, but I won't know without your files.