PDA

View Full Version : Several issues with lightmap packer


Gumgo
09-13-2008, 10:17 PM
I made a lightmap packer in MAXScript. When rendering the baked lighting, I'm doing this:

bi = obj.INodeBakeProperties
bi.nDilations = LM_PADDING
...

to set the padding. However, the padded pixels are VERY dim, nearly black. Attached is an image of what I mean (zoom in around the edges of the triangles, you can see a dim outline of them). How do I fix this and make the padding the correct color?

thatoneguy
09-14-2008, 05:59 AM
That attached image is WAY too small.

Quick question though. Are you pulling the baked bitmap from the VFB or the output path? The texture baking VFB is messed up and shouldn't be used.

Gumgo
09-14-2008, 07:01 AM
Sorry, here is a bigger version (the padding is there, but very very dim). I am getting the image from the output path. Here is my code (also, for some reason if I use fileName I get an "Error creating bitmap" but fileType works...)

obj = objects[i]

lightmap = lightingMap()
lightmap.outputSzX = LM_DIMS
lightmap.outputSzY = LM_DIMS
lightmap.fileType = "C:\\3dsmax7\\scripts\\LM" + (objects[i].name) + ".tga"

bi = obj.INodeBakeProperties
bi.addBakeElement lightmap
bi.nDilations = LM_PADDING
bi.bakeChannel = 4
bi.bakeEnabled = true

clearSelection()
select objects[i]
new_bitmap = render rendertype:#bakeSelected outputwidth:LM_DIMS outputheight:LM_DIMS

bi.removeAllBakeElements()
bi.bakeEnabled = false

Is this correct? (Again, I'm taking the image from C:\3dsmax7\scripts\LM....tga)

EDIT: Hehe, forgot to attach it... now I did though.

CGTalk Moderation
09-14-2008, 07:01 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.