Hi, I expect this gets asked now and then but a quick search didn't bring up any recent answers that spelt it out.
Does the 360 support this method (specifically using the rect version for grabbing a pixel of texture data)? Ok, it runs and grabs the data accurately but it would seem that it can't do it in a timely manner. I first expected the 360 to have the advantage with the unified memory so was quite surprised when 6 calls of
| temp_Rect = new Rectangle((int)Position.X, (int)Position.Y, 1, 1); |
| windRedGreen.GetData<Color>(0, temp_Rect, temp_Col, 0, 1); |
each Update() cause very noticeable framerate issues. I then quickly got to the point where I could no longer get a Draw() out of the box when this was increased to around 20 calls (roughly). Of course this was a bit of a shocker as a low end PC I develop on was happily running several hundred between Draw()s without showing any sign of slowdown from that part of the code (unlike the shaders, which are causing some framerate issues).
I was planning on using this texture lookup to grab displacement data rather than calculating it from the base information (which takes a bit of maths to do but obviously on the 360 turns out to be many orders of magnitude faster) and was just wondering if this is a 'not really implemented in a workable state' Method on the 360 version of XNA but still probably a fine plan on the average PC or if something weird is going on. I've seen some examples of collision code using Texture2D.GetData() for transparency checks in 2D games but from what I'm seeing that wouldn't be a practical solution on the 360 for anything but a very sparse game.