13.07.2015 Views

Manual de Apoio 2010

Manual de Apoio 2010

Manual de Apoio 2010

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figura 8.2: Pipeline - Carregamento <strong>de</strong> ImagensglCopyTexImage2D (int target , int level , int internalformat ,int x, int y, int width , int height ,int bor<strong>de</strong>r);O significado dos argumentos é semelhante aos argumentos da função glTexImage, mas neste caso o x, y,width e height especificam a área no color buffer a ler. O source buffer po<strong>de</strong> ser <strong>de</strong>finido utilizando a funçãoglReadBuffer.8.1.3 Actualização <strong>de</strong> TexturasO carregamento repetido <strong>de</strong> texturas po<strong>de</strong> ser dispendioso em termos <strong>de</strong> processamento. Substituir uma<strong>de</strong>terminada textura po<strong>de</strong> ser mais rápido, na maior parte das vezes do que o carregamento utilizando glTexImage.Para tal utilizamos as funções:glTexSubImage1D (int target , int level ,int xoffset ,int width ,int format , int type , Buffer data);glTexSubImage2D (int target , int level ,int xoffset , int yoffset ,int width , int height ,int format , int type , Buffer data);glTexSubImage3D (int target , int level ,int xoffset , int yoffset , int zoffset ,int width , int height , int <strong>de</strong>pth ,int format , int type , Buffer data);Mais uma vez, os argumentos são semelhantes aos utilizados em glTexImage. O xoffset, yoffset e zoffsetespecificam o local na textura actual para começar a fazer a substituição. O tamanho da textura no argumentodata é especificado pelos argumentos width, height e <strong>de</strong>pth.Finalmente um conjunto final <strong>de</strong> funções permite-nos substituir uma parte <strong>de</strong> uma textura utilizandoinformação extraída directamente do color buffer:glCopyTexSubImage1D (int target , int level ,int xoffset ,int x, GLint y,int width);glCopyTexSubImage2D (int target , int level ,int xoffset , int yoffset ,80

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!