Notifications
Clear all

[Closed] Several issues with lightmap packer

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?

2 Replies

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.

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.