On 21-Aug-05, at 12:53 AM, Lo Saeteurn wrote:
Well, it doesn't light properly if the object has been rotated.
...
What am I doing wrong?
Not sure you'll be able to do this using Quaternion.Transform - IIRC,
that rotates around the origin and is generally only useful when
dealing with unit direction vectors. The "proper" way to do this is
to run the rotated geometry (or a copy of it) through an appropriate
matrix transform in software (i.e. rotate the vertexes/triangles,
then recalculate the normals). You might be able to take some
shortcuts but I can't think of anything at the moment. The 3DMF
Workshop source has some software transform routines you might be
able to adapt (Generic3DModel.RotateX/Y/Z in particular).
Not sure what you mean by a "mesh-based" lightmap (a highly
tessellated version of the original mesh?)
A mesh generated by the rays hitting a surface. Or, instead, attach
the new points onto the mesh that the ray hits so that the shadows
are sharper and more accurate.
The latter is really your only viable option in Quesa. Better yet,
just subdivide the model prior to lighting.
Either way it's pretty much impossible to render per-pixel
lightmaps through Quesa, as it only allows one texture per
triangle (and one set of UV's for that matter).
That's what I mean. Since Quesa cannot support multiple UVs, the
2nd texture must be on a separate mesh that is slightly shifted
over the original.
It will be nearly impossible to do this for models of any complexity.
Even if you can generate a mesh that's cleanly shifted above the
original geometry (which isn't as simple as it may seem) shifting it
too far will ruin the effect, and not shifting it enough will cause z-
fighting errors. Add to that that Quesa will treat the lightmap
surface as transparent and it'll likely render too slow to be of any
good. The only reliable way to render lightmaps is using a
multitexture pass, or a second blended pass with depth writes
disabled. Neither of these techniques are available with Quesa.
Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|