anyone know how (extract texture)
Does anyone know how to extract texture data from video memory?
I know that I could probably draw a texture to a quad and use glReadPixels, but I'd like to know : is there's a way to do this without rendering anything?
Even random thoughts about this would be most welcome!
Feel free to email me.
Edited by - Lord Karnus on September 29, 2001 9:20:44 PM
[email=JValentine_13@hotmail.com]contact[/email]
September 30, 2001 09:51 AM
I don''t think that this is possible, perhaps with lowlevel access to the 3D chip.
But why would one want to do that, it has no sense ?
You don''t want to steal textures from other games, do you ?
But why would one want to do that, it has no sense ?
You don''t want to steal textures from other games, do you ?
hehe, not to steal textures from games, I could get them from the game''s data files if that was the point.
Basically, given any texture in my game, I want to get a copy of it so I can modify it without actually reloading the image from disk, or disrupting the flow of onscreen rendering. If there''s a way to render it to an offscreen buffer, that would do just fine, but I don''t want it to be visible.
Maybe I''m confusing everyone else as much as I am about this
email
Something kinda sad about
the way that things have come to be.
Desensitized to everything.
What became of subtlety?
--Tool
Basically, given any texture in my game, I want to get a copy of it so I can modify it without actually reloading the image from disk, or disrupting the flow of onscreen rendering. If there''s a way to render it to an offscreen buffer, that would do just fine, but I don''t want it to be visible.
Maybe I''m confusing everyone else as much as I am about this

Something kinda sad about
the way that things have come to be.
Desensitized to everything.
What became of subtlety?
--Tool
[email=JValentine_13@hotmail.com]contact[/email]
It should be possible provided you have an openGL surface that you can mix with gdi (such as ''windowed'' mode). That way you can use CreateDIBSection to get a useable handle to a bitmap, select it into a memory dc, then blt the ''opengl'' dc into the memory dc. It''s a simple matter to save the dib to file from there.
Hope that''s of some help. Feel free to email me.
Hope that''s of some help. Feel free to email me.
Country: Scotland [not listed in the ''Country'' combobox].
October 01, 2001 11:19 AM
Karnus:
I don''t get it. If you need a copy of your texture in local RAM, then load it from disk, and then upload the texture to the 3D card from your memory copy. Where is the problem ?
I don''t get it. If you need a copy of your texture in local RAM, then load it from disk, and then upload the texture to the 3D card from your memory copy. Where is the problem ?
http://www.sun.com/software/graphics/OpenGL/manpages/glGetTexImage.html
Celeron ][ 566 @ 850256MB PC-100 CAS2 RAMDFI PA-61 Mainboard (250MB memory bandwidth sucks, it should be 500MB)ATI Radeon 32MB DDR LEWindows 98SE
Thanks for the glGetTexImage, NitroGL!!
**************************************************************
....and after trying it out (ie glGetTexImage) and seeing its limitations I have to agree with anonymous poster and the 'what's the point?' party. It was fun to play about with though...
Edited by - Ken Fitlike on October 1, 2001 9:14:09 PM
**************************************************************
....and after trying it out (ie glGetTexImage) and seeing its limitations I have to agree with anonymous poster and the 'what's the point?' party. It was fun to play about with though...
Edited by - Ken Fitlike on October 1, 2001 9:14:09 PM
Country: Scotland [not listed in the ''Country'' combobox].
Yeah, no kidding, that looks like it may do what I need!
Anon : Read the earlier posts, I mention why I don''t want to load from disk
email
Something kinda sad about
the way that things have come to be.
Desensitized to everything.
What became of subtlety?
--Tool
Anon : Read the earlier posts, I mention why I don''t want to load from disk
Something kinda sad about
the way that things have come to be.
Desensitized to everything.
What became of subtlety?
--Tool
[email=JValentine_13@hotmail.com]contact[/email]
I think that there''s a variation of glDrawPixels that draws on a texture surface instead of the screen. You can use it to modify rectangular sections of a texture without re-uploading the texture.
I think that what the Anonymous Poster meant, was that you probably load the textures into RAM at the beginning of your program (possibly from a disk), and then send them to openGL to store in video memory. So, why not maintain copies of those textures in RAM so that you can modify them if you need to, and then update the copy in video memory. This would probably be faster than what you suggest, since reads/writes to video memory are slower than to RAM.
J.W.
J.W.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement