   fx shader custom struct arrays
  Im looking at having a custom struct in my .fx file that lookssomething like this. With an array to hold N lights.// Inside an .fx file ////struct light_point{    float range;    float3 position;    float3 color;};light_point lights[N];How do I go about setting N based off the number of lights I collectat render time, which would be dynamic based on the objects being rendered location and the number of lights in range, and how would I fill those structswith information from my c++ structs? I havent attempted this yet so the layout might be totally wrong.   
  If you mean you want to do dynamic memory allocation in the shader - you can't.   ;  Is there any way of doing something like this?Would I need a set number of items in the array, instead of N make it 8?So how is dynamic lighting done in a game level?Maybe send in array of float4s that the shader would know how to unload?Something like this, for every light send 2 float4s and an int to secifynumber of lights?//light1float4(pos.x,pos.y,pos.z,range);float4(color.r,color.g,color.b, intensity);//light2float4(pos.x,.....[Edited by - WOsborn on June 13, 2006 10:06:01 AM]