case study: lightmap renderer tool

I was thinking in a potential use for Collada, based on the troubles I’ve been having with my latest project when I needed to render lightmaps on some environments.

The idea would be this: you have a program where you input a Collada document describing a typical environment scene, the tool adds extra UV channels to all geommetries, generates texture lightmaps, and modifies the materials to fit the new lightmaps. When all the work is done, it export the lit environment, also as a Collada document.

Questions are:

was collada intended to be used this way?

to store the scene in memory and perform the lighning/radiosity operations, it is wise to do so with the Collada DOM itself, or it is mandatory to load the document in custom structures, do the work, and convert/export again as collada (probably loosing lots of custom porperties of the input document)

is there any plans for some API, in which you can load a Collada doc, then safely perform complex geometric/lightning operations, and then export again as collada?

any other ideas about this project case?

Hello,

YES!! that is exactly what COLLADA is intended for.

Your second question is a little harder to answer. It all depends on how you need the data to be arranged for the algoriths that you need to do. Most likely you will have to convert the COLLADA data structures into something more suitable and then convert back. The COLLADA DOM could be a good starting place for you since it allows you to add/modify all the data you need, but it doesn’t do some of the basic conversions for you.

FCOLLADA, from FeelingSoftware, is a higher level API and it will convert the data into something more easily renderable, which might be closer to the structures you need for algorithms. I am unsure about how much they allow you to add/modify the data. It might be worth looking into. FeelingSoftware uses FCOLLADA for the Maya and Max plugins so looking at their source you can get a good idea on how they do their data creation for that library.

-Andy