DGL
https://delphigl.com/forum/

generate 3d textures, how?
https://delphigl.com/forum/viewtopic.php?f=19&t=6224
Seite 1 von 1

Autor:  noeska [ Di Dez 19, 2006 20:25 ]
Betreff des Beitrags:  generate 3d textures, how?

How do i generate 3d textures?

Is there an easy way to render a part of an scene into an 3d texture?

Thanks for your answers in advance!

Autor:  JSoftware [ Fr Dez 22, 2006 22:27 ]
Betreff des Beitrags: 

I haven't tried but I would believe that you can do it like this

generate a 3d texture like a normal texture though using this call instead:
Code:
  1. glbindtexture(GL_TEXTURE_3D, texture);
  2. glteximage3d(GL_TEXTURE_3D, 0,GL_RGB,256,256,256,
  3.             0,gl_rgb,GL_UNSIGNED_BYTE,nil);


Then you can copy to it from the screen like this:
Code:
  1. glCopyTexSubImage3D(GL_TEXTURE_3D, 0,0,0,plane,0,0,256,256);

where plane indicates the z plane to copy to. As it's a 256x256x256 texture you can specify 0..255

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/