Modifying Textures

Started by
2 comments, last by Samith 20 years, 3 months ago
I like messing around with cellular automaton things, but I don''t know any efficient way to change the lattice each time around. The way it''s done now is that I have a big array the size of the grid, and I do all the cellular automaton stuff on that, then at the end of the iteration I create a texture using the lattice. Obviously, this is a horrible waste of memory since I''m creating a new texture each iteration. I need a way to modify the original texture, so I don''t have to keep making new ones and sucking up my memory. I''m pretty sure this is possible, I just don''t know how. Any helpw ould be great, and if this post is a big incoherent, well I''m sorry. If you need more information or don''t know what I''m talking about just ask, I''ll explain it better.
Advertisement
glTexSubImage2D is probably what you need. You should find it's a lot faster than creating new textures all the time.

[edited by - benjamin bunny on January 19, 2004 1:30:44 AM]

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

quote:Original post by benjamin bunny
glTexSubImage2D is probably what you need. You should find it''s a lot faster than creating new textures all the time.

[edited by - benjamin bunny on January 19, 2004 1:30:44 AM]


How does that function know which texture to edit though?
Since OpenGL is a state machine it will edit the currently bound texture.

Enigma

This topic is closed to new replies.

Advertisement