hi,what do you think is the best way to modify textures at runtime?
I tried to acces directly to texture pixel data calling ITexture::lock,
but it works well only with not mipmapped textures.
I tried to disable mipmapping when loading the textures I need to
modify using texture creation flag,and reactivating it when loading
textures i don't need to modify,but with direct3d 8.1 mipmapping
seems to enable and disable in an almost random way.
so what shall I do?I have to modify textures every frame,so I need
a fast way.
thank you for your attention,and excuse me for my english.
bye
how to modify textures?
well,I would like to use runtime-modified textures to render a spaceship command console.
I considered to use a 2d bitmap instead (like many space combats games,as xwing vs tie fighter),but a command console on texture would be much better,because i would like to make possible to walk around the space ship.
If I found good documentations on the way textures with mipmaps are stored in memory,I think i'll implement a proc that draws bitmaps correctly
and fastly to textures.
I hope i'we wrote something understandable
goodbye and good coding!
I considered to use a 2d bitmap instead (like many space combats games,as xwing vs tie fighter),but a command console on texture would be much better,because i would like to make possible to walk around the space ship.
If I found good documentations on the way textures with mipmaps are stored in memory,I think i'll implement a proc that draws bitmaps correctly
and fastly to textures.
I hope i'we wrote something understandable
goodbye and good coding!
If you wanted to make stairs like on lemmings, it would be much easier to be able to add them to a bitmap being used as a mask for collision detection than to make an array or linked list of steps that you have to go through all the time to check if the character is on the stairs or not, because with adding them to the mask bitmap you can just use getpixel and check the color of the pixel under the character's foot to see if they are there. So, being able to edit a bitmap in game is something desirable, although perhaps old school.
are you talking about 2d lemmings?I think the problem is quite different:textures(mipmapped ones) are harder to modify,I need to update every mipmap level.
anyway I'm writing some code that writes IImage to direct3d texture,I think to solve my problem in this way.
old school?i think the access to video memory it's really slow compared to access to system memory on modern hardware,but i need to write not too much pixels (about 10% of texture surface approx),so maybe it's faster than hardware rebuilding all the texture everytime.
anyway I'm writing some code that writes IImage to direct3d texture,I think to solve my problem in this way.
old school?i think the access to video memory it's really slow compared to access to system memory on modern hardware,but i need to write not too much pixels (about 10% of texture surface approx),so maybe it's faster than hardware rebuilding all the texture everytime.