Implemented idRenderBackend::DBG_TestImage() for Vulkan

This commit is contained in:
Robert Beckebans 2020-05-01 16:52:48 +02:00
parent 3afb67ab8e
commit 6037889a85
3 changed files with 127 additions and 6 deletions

View file

@ -55,9 +55,9 @@ I started this project in 2012 and focused on making this code being future proo
really good which should give you stable 100 fps on todays hardware (2014).
* Changed light interaction shaders to use Half-Lambert lighting like in Half-Life 2 to
make the game less dark. https://developer.valvesoftware.com/wiki/Half_Lambert
* True 64 bit HDR lighting with adaptive tone mapping and gamma-correct rendering in linear RGB space
* True internal 64 bit HDR lighting with filmic ACES tone mapping and gamma-correct rendering in linear RGB space
* Enhanced Subpixel Morphological Antialiasing. For more information see "Anti-Aliasing Methods in CryENGINE 3" and the docs at http://www.iryoku.com/smaa/
* Filmic post process effects like Technicolor color grading and film grain
* Filmic post process effects like Chromatic Aberration and Dithering
* Additional ambient render pass to make the game less dark similar to the Quake 4 r_forceAmbient technique
* Screen Space Ambient Occlusion http://graphics.cs.williams.edu/papers/SAOHPG12/
* Fixed Bink video playback through libbinkdec (thanks to Daniel Gibson) or FFmpeg (thanks to Carl Kenner)

View file

@ -13,7 +13,6 @@ RBDOOM-3-BFG Release Notes - https://github.com/RobertBeckebans/RBDOOM-3-BFG
Thank you for downloading RBDOOM-3-BFG.
_______________________________________
TBD mid 2020 - Changes since RBDOOM-3-BFG 1.2.0
@ -52,6 +51,8 @@ The main goal is that the new content looks the same in RBDOOM-3-BFG as in Blend
* Added HACK to look for PBR reflection maps with the suffix _rmao if a specular map was specified and ends with _s.tga. This allows to override the materials with PBR textures without touching the material .mtr files.
* Fixed ambient lights being too bright in HDR mode
[VULKAN]
* Fixed GPU Skinning with Vulkan
@ -74,6 +75,8 @@ The main goal is that the new content looks the same in RBDOOM-3-BFG as in Blend
* Added Blue Noise based Filmic Dithering by Timothy Lottes and Chromatic Aberration
* Improved Shadow Mapping performance by reducing the number of taps from 12 to 6 and keeping a good quality using dithering the result with Blue Noise magic by Alan Wolfe
* Artistic Style C++ beautifier configuration has slightly changed to work closer to Clang Format's behaviour
* Updated documentation regarding modding support in the README
@ -106,9 +109,9 @@ This is a maintenance release without Vulkan support even though it contains a l
* Added in-engine Flash debugging tools and new console variables.
These tools help to analyse the id Tech view of Flash and what SWF tags are supported and how they are interpreted
by id Tech's own ActionScript 2 interpreter
- swf_exportAtlas
- swf_exportSWF
- swf_exportJSON
- postLoadExportAtlas
- postLoadExportSWF
- postLoadExportJSON
- swf_show : Draws the bounding box of instanced Flash sprites in red and their names
* Added Steel Storm 2 Engine render demo fixes

View file

@ -547,7 +547,117 @@ Display a single image over most of the screen
*/
void idRenderBackend::DBG_TestImage()
{
idImage* image = NULL;
idImage* imageCr = NULL;
idImage* imageCb = NULL;
int max;
float w, h;
image = tr.testImage;
if( !image )
{
return;
}
if( tr.testVideo )
{
cinData_t cin;
cin = tr.testVideo->ImageForTime( viewDef->renderView.time[1] - tr.testVideoStartTime );
if( cin.imageY != NULL )
{
image = cin.imageY;
imageCr = cin.imageCr;
imageCb = cin.imageCb;
}
else
{
tr.testImage = NULL;
return;
}
w = 0.25;
h = 0.25;
}
else
{
max = image->GetUploadWidth() > image->GetUploadHeight() ? image->GetUploadWidth() : image->GetUploadHeight();
w = 0.25 * image->GetUploadWidth() / max;
h = 0.25 * image->GetUploadHeight() / max;
w *= ( float )renderSystem->GetHeight() / renderSystem->GetWidth();
}
// Set State
GL_State( GLS_DEPTHFUNC_ALWAYS | GLS_CULL_TWOSIDED | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
// Set Parms
float texS[4] = { 1.0f, 0.0f, 0.0f, 0.0f };
float texT[4] = { 0.0f, 1.0f, 0.0f, 0.0f };
renderProgManager.SetRenderParm( RENDERPARM_TEXTUREMATRIX_S, texS );
renderProgManager.SetRenderParm( RENDERPARM_TEXTUREMATRIX_T, texT );
float texGenEnabled[4] = { 0, 0, 0, 0 };
renderProgManager.SetRenderParm( RENDERPARM_TEXGEN_0_ENABLED, texGenEnabled );
// not really necessary but just for clarity
const float screenWidth = 1.0f;
const float screenHeight = 1.0f;
const float halfScreenWidth = screenWidth * 0.5f;
const float halfScreenHeight = screenHeight * 0.5f;
float scale[16] = { 0 };
scale[0] = w; // scale
scale[5] = h; // scale
scale[12] = halfScreenWidth - ( halfScreenWidth * w ); // translate
scale[13] = halfScreenHeight - ( halfScreenHeight * h ); // translate
scale[10] = 1.0f;
scale[15] = 1.0f;
// RB: orthographic projection is changed for Vulkan
float ortho[16] = { 0 };
ortho[0] = 2.0f / screenWidth;
ortho[5] = 2.0f / screenHeight;
ortho[10] = -1.0f;
ortho[12] = -1.0f;
ortho[13] = -1.0f;
ortho[14] = 0.0f;
ortho[15] = 1.0f;
float finalOrtho[16];
R_MatrixMultiply( scale, ortho, finalOrtho );
float projMatrixTranspose[16];
R_MatrixTranspose( finalOrtho, projMatrixTranspose );
renderProgManager.SetRenderParms( RENDERPARM_MVPMATRIX_X, projMatrixTranspose, 4 );
// Set Color
GL_Color( 1, 1, 1, 1 );
// Bind the Texture
if( ( imageCr != NULL ) && ( imageCb != NULL ) )
{
GL_SelectTexture( 0 );
image->Bind();
GL_SelectTexture( 1 );
imageCr->Bind();
GL_SelectTexture( 2 );
imageCb->Bind();
renderProgManager.BindShader_Bink();
}
else
{
GL_SelectTexture( 0 );
image->Bind();
renderProgManager.BindShader_Texture();
}
// Draw!
DrawElementsWithCounters( &testImageSurface );
}
// RB begin
@ -588,7 +698,15 @@ idRenderBackend::DBG_RenderDebugTools
*/
void idRenderBackend::DBG_RenderDebugTools( drawSurf_t** drawSurfs, int numDrawSurfs )
{
// don't do much if this was a 2D rendering
if( !viewDef->viewEntitys )
{
DBG_TestImage();
DBG_ShowLines();
return;
}
// TODO
}
/*