Original Post
Hi!
I have been trying to generate static lightmaps for a while now but i find it quit hard. I'm trying to follow this article now : Lightmaps
if someone could help me with the steps explained in the tutorial i would be really thankful.
*1 Determine the primary axis plane based on the absolute value of the normal for this surface.
- I guess i can just check wich axis is the largest?
*2 Get the min and max (2D vertices) along that plane. This means to use only the 2 relevant coordinate components for this particular plane. For example if you're using the XY plane, only x and y at the vertices count for this step.
- I dont really know what this means. is min a vector at "0,0" corner and max "1,1" corner if the polygon would start at 0,0 and be 1 wide and high?
*Assign the UV vectors (ie, the normalized vectors pointing 'right' and 'down' respectively. You don't have to use 'right' and 'down', but it makes more sense to trace in those directions as you'll see in the loop below).
- This i got working i think.
*3 Determine the texture plane origin (p) from the min. This, and the previous step can be done very simply by getting the 3D points based on your 2D (projected) min/max using the equation of the plane. You have only 1 unknown (the missing vertex component), so solving for it is trivial.
- Texture plane origin?
*4 Determine the u and v lengths (max-min)
- If i just had the min and max hmm?
*5 And finally, determine lightmap coordinates:
(for each vertex) ltu=((pu - minu) / ulen) and ltv=((pv - minv) / vlen)
where pu and pv are the x and y in PLANE space (not world space).
- ?? Texture coordinates??
Thanks!
I have been trying to generate static lightmaps for a while now but i find it quit hard. I'm trying to follow this article now : Lightmaps
if someone could help me with the steps explained in the tutorial i would be really thankful.
*1 Determine the primary axis plane based on the absolute value of the normal for this surface.
- I guess i can just check wich axis is the largest?
*2 Get the min and max (2D vertices) along that plane. This means to use only the 2 relevant coordinate components for this particular plane. For example if you're using the XY plane, only x and y at the vertices count for this step.
- I dont really know what this means. is min a vector at "0,0" corner and max "1,1" corner if the polygon would start at 0,0 and be 1 wide and high?
*Assign the UV vectors (ie, the normalized vectors pointing 'right' and 'down' respectively. You don't have to use 'right' and 'down', but it makes more sense to trace in those directions as you'll see in the loop below).
- This i got working i think.
*3 Determine the texture plane origin (p) from the min. This, and the previous step can be done very simply by getting the 3D points based on your 2D (projected) min/max using the equation of the plane. You have only 1 unknown (the missing vertex component), so solving for it is trivial.
- Texture plane origin?
*4 Determine the u and v lengths (max-min)
- If i just had the min and max hmm?
*5 And finally, determine lightmap coordinates:
(for each vertex) ltu=((pu - minu) / ulen) and ltv=((pv - minv) / vlen)
where pu and pv are the x and y in PLANE space (not world space).
- ?? Texture coordinates??
Thanks!