mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Bugfixed and flipped environment probe glReadPixels output
This commit is contained in:
parent
2391ba1b43
commit
8c397e9463
3 changed files with 27 additions and 17 deletions
|
@ -642,6 +642,7 @@ byte* R_MipMap( const byte* in, int width, int height );
|
|||
void R_BlendOverTexture( byte* data, int pixelCount, const byte blend[4] );
|
||||
void R_HorizontalFlip( byte* data, int width, int height );
|
||||
void R_VerticalFlip( byte* data, int width, int height );
|
||||
void R_VerticalFlipRGB16F( byte* data, int width, int height );
|
||||
void R_RotatePic( byte* data, int width );
|
||||
void R_ApplyCubeMapTransforms( int i, byte* data, int size );
|
||||
|
||||
|
|
|
@ -528,6 +528,31 @@ void R_VerticalFlip( byte* data, int width, int height )
|
|||
}
|
||||
}
|
||||
|
||||
// RB: halfFloat_t helper
|
||||
struct ColorRGB16F
|
||||
{
|
||||
uint16 red;
|
||||
uint16 green;
|
||||
uint16 blue;
|
||||
};
|
||||
|
||||
void R_VerticalFlipRGB16F( byte* data, int width, int height )
|
||||
{
|
||||
int i, j;
|
||||
ColorRGB16F temp;
|
||||
|
||||
for( i = 0; i < width; i++ )
|
||||
{
|
||||
for( j = 0; j < height / 2; j++ )
|
||||
{
|
||||
temp = *( ( ColorRGB16F* )data + j * width + i );
|
||||
|
||||
*( ( ColorRGB16F* )data + j * width + i ) = *( ( ColorRGB16F* )data + ( height - 1 - j ) * width + i );
|
||||
*( ( ColorRGB16F* )data + ( height - 1 - j ) * width + i ) = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void R_RotatePic( byte* data, int width )
|
||||
{
|
||||
int i, j;
|
||||
|
|
|
@ -838,23 +838,7 @@ void R_ReadTiledPixels( int width, int height, byte* buffer, renderView_t* ref =
|
|||
glPixelStorei( GL_PACK_ROW_LENGTH, RADIANCE_CUBEMAP_SIZE );
|
||||
glReadPixels( 0, 0, w, h, GL_RGB, GL_HALF_FLOAT, buffer );
|
||||
|
||||
#if 0
|
||||
// TODO vertical flip with half floats
|
||||
{
|
||||
int i, j;
|
||||
uint64 temp;
|
||||
|
||||
for( i = 0 ; i < width ; i++ )
|
||||
{
|
||||
for( j = 0 ; j < height / 2 ; j++ )
|
||||
{
|
||||
temp = *( ( uint64* )buffer + j * width + i );
|
||||
*( ( uint64* )buffer + j * width + i ) = *( ( uint64* )buffer + ( height - 1 - j ) * width + i );
|
||||
*( ( uint64* )buffer + ( height - 1 - j ) * width + i ) = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
R_VerticalFlipRGB16F( buffer, w, h );
|
||||
|
||||
Framebuffer::Unbind();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue