问题
6 images 800x640 need to be rendered from a point of view, and based on these images one new image 800x640, a sort of fish-eye view, should be created. At the moment the application draw each image and read the colors by calling this RenderTarget2D.GetData method and based on each pixel position it calculates new position for that final image. It works fine.
but since calling RenderTarget2D.GetData reduces the performance I tried to declare a 800x640 array in shader and then render 6 images consecutively. Then in pixel shader find the new coordinate of the new fish-eye view image.
float4 PSTooBasic(VertexPSInput pin) : COLOR
{
int xCoord = GetWaldXCoordinate(pin.PositionWS.x);
int yCoord = GetWaldYCoordinate(pin.PositionWS.y);
WaldPixs[xCoord][yCoord] = 1;
return BlackColor;
}
But this array declaration line: uniform int WaldPixs[800][640];
gives this compile error: error X3059: 'WaldPixs': array dimension must be between 1 and 65536
Any suggestion or workaround?
Thanks,
来源:https://stackoverflow.com/questions/18145237/declaring-2d-array-in-xna