Jump to content

Photo

Toolset lightmapper project


23 replies to this topic

#1
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Hi all,

I have created a project for the toolset lightmapper, and to kick things off I have already uploaded an updated lightmapping script that you can use to patch your toolset. Version 1.0.1:

- Suppresses the command windows for texture processing and atlasing.
- Fixes a bug where certain models would cause the lightmapper to fail.

So head on over to get the new script:

http://social.bioware.com/project/717/

- James G


UPDATE 11-24-2009:

Lightmapper script updated!

Go to http://social.bioware.com/project/717/
to get the latest version. Just unzip the files into wherever your
lightmapper is currently installed, although I do recommend deleting
the existing files to be sure.

Fixes in this update:
Directional light now hits all terrain chunks
Lightmap seams should be gone
Mapper failure now dumps a Python stack trace to errlog.txt so we have something to work with
Version numbers in both the script and the executable to help track down problems.

[/list]Let me know how it goes!

- JamesG

PS. I'm suppressing the "lightmap-atlas" and "no renderable parts"
messages for the end user tools. They should be gone next time we
release an update.


UPDATE 12-03-2009:

Lightmapper updated. In this revision (1.2):
  • Fixed sunlight and shadows!
  • Better multithreading - now auto-detects the number of cores.
  • Better error reporting in general. Only one "failed to create EngGFFReader" message now!
NOTES: The lightmap hang seems to be coming from the level editor, not the lightmapper itself, so I encourage those of you that aren't having that problem to make sure you clear the --cpus=1 option from your command line so the new script can auto-detect the number of cores to use. For those of you who ARE experiencing this bug, we are looking into it and will hopefully have a fix for it included in the next toolset release.

Also, an update for any of you that are experiencing black triangles in your lightmaps: I have traced down one case of this happening and it is because of the art asset, not the lightmapper as such. EclipseRay presumably uses a different technique than the one used in house (which is 3rd party software that we can not include with the toolset). If you are seeing this, please let me know via toolsetsupport@bioware.com so I can confirm this is the case. I have some ideas how to attack the problem and would like to know how prevalent it is.

Edited by James Goldman, 11 December 2009 - 12:43 AM.


#2
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Mithrildream: look under the files tab. There's a zip file there. Cador: Look in the level editor options for the path to the lightmapper executable. The script is named Lightmapper.py and should be in the same directory as eclipseray.exe

#3
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Hmm. Seems there's a "group members only" option. I turned it off. How about now?

#4
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
The water problem is unrelated to the lightmapper. I have passed that on to a colleague that knows more about level rims than I do, so a fix should be in the works.



Sunlight appears in shadow maps. If you apply a static light (as opposed to a baked light) and move it around, you should see the effects in the editor. Otherwise, can you give me some details as to how it's non-existant?

#5
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Thanks, Tikigod! I'm glad things are working for you.



Bioxx & Akaliel: terrain should not be black. Here I'm not seeing it as black, either with or without shadowmaps, so you should check your sunlight settings (yes, they are on the exportable area). My comment about the static lights means this: sunlight is rendered in shadowmaps, which only affect static lights. So, if you render lightmaps and apply them you can verify that sunlight is there by turning off fully lit, then moving a static light around. If they're there you will see the static light on the terrain, if not you won't. That's in the level editor, at any rate.

#6
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Hakmon, I have another user who is seeing something like that, but when I lightmapped his level on several test machines it looked fine. It looks like the results are being atlased incorrectly. My best guess is that you have some old files lying around. Try shutting down the tools, then go to wherever you saved your level (.lvl) and delete the .erf. Then start up the toolset again and re-run the lightmapper. Confirm that you see the "EclipseRay 1.1" message in the log window. If the problem still happens, you can send me the .lvl file at toolsetsupport@bioware.com (attn to me in the subject line, please) and I can try it here. Also, don't put the old version (1.0.1) of the script in there. You want the version (1.0.2) that comes with the newer zip file as it has some logging improvements.

Also, I've added instructions to the project.

Edited by James Goldman, 25 November 2009 - 08:41 PM.


#7
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Thanks Hakmon, I got the level file and I'm seeing the triangles as well. I'll get to this as soon as I can. Please be patient though, we are very busy here right now.

#8
Allan Smith

Allan Smith
  • BioWare Employees
  • 83 posts
@dorotea

If your engine.dll is not registered, there are instructions to do it manually (its not hard) at

http://social.biowar...troubleshooting

under the heading "Installer hangs at the stage of "Execute:regsvr32.exe /s "C:\\Dragon Age\\tools\\Engine.dll"

That should get rid of the errors regarding engine.dll registration. See what happens after that.

#9
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
akaliel: No, trees do not cast shadows in sunlight in DA, so that's as expected.

dorotea: Those messages can be ignored. I have suppressed them for the next release of the toolset.

oni_step: I have heard that regsvr32 hanging is a general problem with the installer with some versions of XP. My understanding was that the library does actually get registered, but regsrv just hangs in memory until reboot. Interesting about the safe mode, I'll have to let them know. It's a clue at any rate.

#10
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
One more thing: I don't recommend that you roll back to the older version of eclipseray. It uses the same engine.dll to read in the geometry so it likely won't fix anything, but you'll get back the cracking and sunlight bugs.

#11
Allan Smith

Allan Smith
  • BioWare Employees
  • 83 posts

dorotea wrote...

grr - oni -- thanks for the advice! I was finally able to register Engine.dll from the safe mode - maybe this bit should be added to the wiki. But now I cannot even get the lightmapper to submit lightmaps for rendering anymore - all I get is continuous :

 Failed to find lightmap-atlas info for model 'fhi_wallbasic_0', part '_1k5' type errors .

And no, they don't go away after first, or second, or third, or fourth, etc attempt to render a ligtmap for a simple tiny room with 3 walls, a barrel and two lights. Will try to roll back to lightmapper  1.0 tomorrow and use the safety mode trick to reg the Engine.dll. As Alice used to say - this is getting curiouser and curiouser. ( All of the above is happening on Win xp 64 bit system)


I will put this info on the wiki.  As for your other errors, can you verify which version of Python you have?  If your are using ActiveState Python 64 bit edition, it is does not have all of the things necessary for the lightmapper.  The 32 bit version does work on a 64 bit machine though.

#12
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
What the ...?? OK, sunlight does not appear to be showing up in the shadow maps. I'll be looking into that. Static lights are working fine for shadows.



Otherwise, akaliel, the answer is "yes". ;)

#13
Allan Smith

Allan Smith
  • BioWare Employees
  • 83 posts
If you are using the new lightmapper files and are still seeing the issues that were fixed, it may be that there are some old files getting in the way. Delete MyDocuments\\Bioware\\Dragon Age\\Toolset\\lvlworkspace\\ and you should be good to go.

Edited by Allan Smith, 26 November 2009 - 08:27 PM.


#14
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
oni_step: at one point during development of eclipseray, I suspected there was a race condition in Yafray (the open source raytracer backend, see http://www.yafaray.org/) that could cause it to hang, but the problem went away and I couldn't reproduce it again. Go to your level editor options and make sure the lightmapper command has --cpus=1 and see if that helps.

#15
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Sorry, that's assuming you have a multi-core CPU and it's already set to more than one, of course.

#16
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
oni and dorotea: The lightmap-atlas info messages are suppressed in the code now, but that is in the level editor, so you won`t get that until the next toolset update. Sorry. Can you please make sure that you put --cpus=1 (with two dashes). If it has one dash it won`t respect the option, but I just noticed that it doesn`t actually report that failure. :S One more fix for the next version (early next week, if all goes well).



Aergia is the wrapper library around Yafray that exposes its objects to Python. If you comment out that import, then you are commenting out the raytracer. Needless to say, that won`t work. ;) I`m still thinking that it`s the elusive race condition I was trying to track down. When I get to work on Monday I`ll build a force non-multithreaded version you can try.



These kind of errors are difficult to track down because unfortunately everyone`s system is a bit different. That`s the big challenge of developing for the PC!

#17
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
You can't run that script from Python. Python has to be called from Eclipseray, which also provides the aergia library.

#18
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Oni, can you tell me something? When you say the lightmapper is hanging, are you talking about it stalling on the "Render Lightmaps and Wait" stage in the Manage Exports dialog? If so, do you see a message in the log window like "Lightmapper script completed successfully"? If so, that might explain why I can't track this down - I've been running the lightmapper manually and it succeeds. The hang seems to be somewhere else entirely.

#19
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Sharpaz: is the path correct? Failed to run means the process wasn't created.

#20
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Expected until the next release of the lightmapper (soon)

#21
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Hey everyone, the new version (1.2) is up ready for downloading. Yes, it fixes sunlight! (See updated OP for full details)

http://social.bioware.com/project/717

James

Edited by James Goldman, 04 December 2009 - 01:11 AM.


#22
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
akaliel: there is a workaround. You have to post from Single Player, I think. Water is not a lightmapper issue, but coming up with a better solution is on the to-do list.

#23
Allan Smith

Allan Smith
  • BioWare Employees
  • 83 posts

James Goldman wrote...

akaliel: there is a workaround. You have to post from Single Player, I think. Water is not a lightmapper issue, but coming up with a better solution is on the to-do list.


This is documented on the toolset wiki under "water"

http://social.biowar...index.php/Water

#24
James Goldman

James Goldman
  • BioWare Employees
  • 25 posts
Thanks, Trampzabout, always nice to hear :)



BioSpirit: The seams around terrain chunks should be fixed since the 1.1 release. If you are still seeing it, can you please send me your level at toolsetsupport@bioware.com (attn: James Goldman) and I'll take a look. As to the black triangles, it seems that there are some art assets that have overlapping texture coordinates, and that breaks a key assumption of the lightmapper. It doesn't show up in the game because we used different software in-house that uses a different algorithm. I'm trying to gather information on how prevalent the problem is and how it shows up so I can determine a solution (I already have four possibilities in mind). If you encounter these, please do let me know which models they are and I can examine the source art and also make sure that it's not a new bug in the lightmapper itself.