Jump to content
  • Advertisement
Sign in to follow this  
ZebulonPi

Individual pixel control of a textue? (XNA)

This topic is 3320 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all! Long time programming dabbler (like, Fortran and Pascal long time), but C#, XNA, and OOP are so different it's like I'm starting all over again... Anyway, I'm trying to implement a procedural terrain creation algorithm (a 2d equivalent of the 3D "split sphere" routine), and I'm not sure quite how to do it. The routine is easy enough... determine a random line that splits a texture, "raise" one side, "lower" the other, and repeat this about 10,000 times. :) Viola! Instant terrain. The problem I'm having is getting this data into a texture. Can I manipulate the pixels in a texture directly with XNA? Can I write this data to an array and then somehow load this into a texture? Thanks for the help in advance!

Share this post


Link to post
Share on other sites
Advertisement
Found it!

My bad for not more fully checking these very forums. :)

It's GetData() and SetData(), which seem to do exactly what I'd like them to do.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!