RE: [Algorithms] Lighting Issues From: Michael Pohoreski - 2001-07-31 20:07:27 ```Not Maya, but this might help. Our artists use Max (which has a FarStart and FarEnd.) We want the far end to fade out to 0 so we have light.range =3D nFarEnd D3D does *NOT* normalize d (not sure about OpenGL), and we also want Attenutation =3D 1 at zero distance . Using the D3D & OpenGL Attenuation which is =3D 1 / (a0 + a1*d + a2*d^2) and solving for a nice quadratic falloff we get: 1 =3D 1 / (a0 + a1*d + a2*d^2) Therefore a0 =3D 1 And similiarly const float attenuation_far =3D 1.f / ( nFarEnd - nFarStart ); light.Attenuation_Constant =3D 1.f; // aka a0 light.Attenuation_Linear =3D attenuation_far; // aka a1 light.Attenuation_Quadratic =3D (attenuation_far * attenuation_far); = // aka a2 Cheers -----Original Message----- From: Michael Hughes [mailto:mhughes@...] Sent: Tuesday, July 31, 2001 3:36 PM To: gdalgorithms-list@... Subject: [Algorithms] Lighting Issues Just in case there's anyone not quite sick of discussing lighting with those of us that just can't quite get it :) I've looked over all of the posts in the last couple of months. I know that people (answering a lot of my questions) have gone over some of this, but I still have a question. Lights in Maya have the following properties: intensity, falloff type (linear, quadratic and cubic) and color. Lights in D3D have no intensity, a range and 3 values for the attenuation formula, which is (1 / (A + (B * d) + (C * d^2))) [where d is the distance from the light to a vertex]. Does anyone know how to convert the lighting values from Maya to something I can use in either OGL or D3D? I can't find any Maya documentation that helps on this. How have others handled this? Are the other 3D packages lighting models closer to the major 3D API's? Any help would be much appreciated. Thanks, Mike _______________________________________________ GDAlgorithms-list mailing list GDAlgorithms-list@... http://lists.sourceforge.net/lists/listinfo/gdalgorithms-list ```
 RE: [Algorithms] Lighting Issues From: Michael Pohoreski - 2001-07-31 20:07:27 ```Not Maya, but this might help. Our artists use Max (which has a FarStart and FarEnd.) We want the far end to fade out to 0 so we have light.range =3D nFarEnd D3D does *NOT* normalize d (not sure about OpenGL), and we also want Attenutation =3D 1 at zero distance . Using the D3D & OpenGL Attenuation which is =3D 1 / (a0 + a1*d + a2*d^2) and solving for a nice quadratic falloff we get: 1 =3D 1 / (a0 + a1*d + a2*d^2) Therefore a0 =3D 1 And similiarly const float attenuation_far =3D 1.f / ( nFarEnd - nFarStart ); light.Attenuation_Constant =3D 1.f; // aka a0 light.Attenuation_Linear =3D attenuation_far; // aka a1 light.Attenuation_Quadratic =3D (attenuation_far * attenuation_far); = // aka a2 Cheers -----Original Message----- From: Michael Hughes [mailto:mhughes@...] Sent: Tuesday, July 31, 2001 3:36 PM To: gdalgorithms-list@... Subject: [Algorithms] Lighting Issues Just in case there's anyone not quite sick of discussing lighting with those of us that just can't quite get it :) I've looked over all of the posts in the last couple of months. I know that people (answering a lot of my questions) have gone over some of this, but I still have a question. Lights in Maya have the following properties: intensity, falloff type (linear, quadratic and cubic) and color. Lights in D3D have no intensity, a range and 3 values for the attenuation formula, which is (1 / (A + (B * d) + (C * d^2))) [where d is the distance from the light to a vertex]. Does anyone know how to convert the lighting values from Maya to something I can use in either OGL or D3D? I can't find any Maya documentation that helps on this. How have others handled this? Are the other 3D packages lighting models closer to the major 3D API's? Any help would be much appreciated. Thanks, Mike _______________________________________________ GDAlgorithms-list mailing list GDAlgorithms-list@... http://lists.sourceforge.net/lists/listinfo/gdalgorithms-list ```